Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16lf1459.h
blobe85467430ef4318b47652f979c0af01fc21c4864
1 /*
2 * This declarations of the PIC16LF1459 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:05 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 __PIC16LF1459_H__
26 #define __PIC16LF1459_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 PIR1_ADDR 0x0011
54 #define PIR2_ADDR 0x0012
55 #define TMR0_ADDR 0x0015
56 #define TMR1_ADDR 0x0016
57 #define TMR1L_ADDR 0x0016
58 #define TMR1H_ADDR 0x0017
59 #define T1CON_ADDR 0x0018
60 #define T1GCON_ADDR 0x0019
61 #define TMR2_ADDR 0x001A
62 #define PR2_ADDR 0x001B
63 #define T2CON_ADDR 0x001C
64 #define TRISA_ADDR 0x008C
65 #define TRISB_ADDR 0x008D
66 #define TRISC_ADDR 0x008E
67 #define PIE1_ADDR 0x0091
68 #define PIE2_ADDR 0x0092
69 #define OPTION_REG_ADDR 0x0095
70 #define PCON_ADDR 0x0096
71 #define WDTCON_ADDR 0x0097
72 #define OSCTUNE_ADDR 0x0098
73 #define OSCCON_ADDR 0x0099
74 #define OSCSTAT_ADDR 0x009A
75 #define ADRES_ADDR 0x009B
76 #define ADRESL_ADDR 0x009B
77 #define ADRESH_ADDR 0x009C
78 #define ADCON0_ADDR 0x009D
79 #define ADCON1_ADDR 0x009E
80 #define ADCON2_ADDR 0x009F
81 #define LATA_ADDR 0x010C
82 #define LATB_ADDR 0x010D
83 #define LATC_ADDR 0x010E
84 #define CM1CON0_ADDR 0x0111
85 #define CM1CON1_ADDR 0x0112
86 #define CM2CON0_ADDR 0x0113
87 #define CM2CON1_ADDR 0x0114
88 #define CMOUT_ADDR 0x0115
89 #define BORCON_ADDR 0x0116
90 #define FVRCON_ADDR 0x0117
91 #define DACCON0_ADDR 0x0118
92 #define DACCON1_ADDR 0x0119
93 #define APFCON_ADDR 0x011D
94 #define ANSELA_ADDR 0x018C
95 #define ANSELB_ADDR 0x018D
96 #define ANSELC_ADDR 0x018E
97 #define PMADR_ADDR 0x0191
98 #define PMADRL_ADDR 0x0191
99 #define PMADRH_ADDR 0x0192
100 #define PMDAT_ADDR 0x0193
101 #define PMDATL_ADDR 0x0193
102 #define PMDATH_ADDR 0x0194
103 #define PMCON1_ADDR 0x0195
104 #define PMCON2_ADDR 0x0196
105 #define RCREG_ADDR 0x0199
106 #define TXREG_ADDR 0x019A
107 #define SPBRG_ADDR 0x019B
108 #define SPBRGL_ADDR 0x019B
109 #define SPBRGH_ADDR 0x019C
110 #define RCSTA_ADDR 0x019D
111 #define TXSTA_ADDR 0x019E
112 #define BAUDCON_ADDR 0x019F
113 #define WPUA_ADDR 0x020C
114 #define WPUB_ADDR 0x020D
115 #define SSP1BUF_ADDR 0x0211
116 #define SSPBUF_ADDR 0x0211
117 #define SSP1ADD_ADDR 0x0212
118 #define SSPADD_ADDR 0x0212
119 #define SSP1MSK_ADDR 0x0213
120 #define SSPMSK_ADDR 0x0213
121 #define SSP1STAT_ADDR 0x0214
122 #define SSPSTAT_ADDR 0x0214
123 #define SSP1CON1_ADDR 0x0215
124 #define SSPCON_ADDR 0x0215
125 #define SSPCON1_ADDR 0x0215
126 #define SSP1CON2_ADDR 0x0216
127 #define SSPCON2_ADDR 0x0216
128 #define SSP1CON3_ADDR 0x0217
129 #define SSPCON3_ADDR 0x0217
130 #define IOCAP_ADDR 0x0391
131 #define IOCAN_ADDR 0x0392
132 #define IOCAF_ADDR 0x0393
133 #define IOCBP_ADDR 0x0394
134 #define IOCBN_ADDR 0x0395
135 #define IOCBF_ADDR 0x0396
136 #define CLKRCON_ADDR 0x039A
137 #define ACTCON_ADDR 0x039B
138 #define PWM1DCL_ADDR 0x0611
139 #define PWM1DCH_ADDR 0x0612
140 #define PWM1CON_ADDR 0x0613
141 #define PWM1CON0_ADDR 0x0613
142 #define PWM2DCL_ADDR 0x0614
143 #define PWM2DCH_ADDR 0x0615
144 #define PWM2CON_ADDR 0x0616
145 #define PWM2CON0_ADDR 0x0616
146 #define CWG1DBR_ADDR 0x0691
147 #define CWG1DBF_ADDR 0x0692
148 #define CWG1CON0_ADDR 0x0693
149 #define CWG1CON1_ADDR 0x0694
150 #define CWG1CON2_ADDR 0x0695
151 #define UCON_ADDR 0x0E8E
152 #define USTAT_ADDR 0x0E8F
153 #define UIR_ADDR 0x0E90
154 #define UCFG_ADDR 0x0E91
155 #define UIE_ADDR 0x0E92
156 #define UEIR_ADDR 0x0E93
157 #define UFRM_ADDR 0x0E94
158 #define UFRMH_ADDR 0x0E94
159 #define UFRML_ADDR 0x0E95
160 #define UADDR_ADDR 0x0E96
161 #define UEIE_ADDR 0x0E97
162 #define UEP0_ADDR 0x0E98
163 #define UEP1_ADDR 0x0E99
164 #define UEP2_ADDR 0x0E9A
165 #define UEP3_ADDR 0x0E9B
166 #define UEP4_ADDR 0x0E9C
167 #define UEP5_ADDR 0x0E9D
168 #define UEP6_ADDR 0x0E9E
169 #define UEP7_ADDR 0x0E9F
170 #define STATUS_SHAD_ADDR 0x0FE4
171 #define WREG_SHAD_ADDR 0x0FE5
172 #define BSR_SHAD_ADDR 0x0FE6
173 #define PCLATH_SHAD_ADDR 0x0FE7
174 #define FSR0L_SHAD_ADDR 0x0FE8
175 #define FSR0H_SHAD_ADDR 0x0FE9
176 #define FSR1L_SHAD_ADDR 0x0FEA
177 #define FSR1H_SHAD_ADDR 0x0FEB
178 #define STKPTR_ADDR 0x0FED
179 #define TOSL_ADDR 0x0FEE
180 #define TOSH_ADDR 0x0FEF
182 #endif // #ifndef NO_ADDR_DEFINES
184 //==============================================================================
186 // Register Definitions
188 //==============================================================================
190 extern __at(0x0000) __sfr INDF0;
191 extern __at(0x0001) __sfr INDF1;
192 extern __at(0x0002) __sfr PCL;
194 //==============================================================================
195 // STATUS Bits
197 extern __at(0x0003) __sfr STATUS;
199 typedef struct
201 unsigned C : 1;
202 unsigned DC : 1;
203 unsigned Z : 1;
204 unsigned NOT_PD : 1;
205 unsigned NOT_TO : 1;
206 unsigned : 1;
207 unsigned : 1;
208 unsigned : 1;
209 } __STATUSbits_t;
211 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
213 #define _C 0x01
214 #define _DC 0x02
215 #define _Z 0x04
216 #define _NOT_PD 0x08
217 #define _NOT_TO 0x10
219 //==============================================================================
221 extern __at(0x0004) __sfr FSR0;
222 extern __at(0x0004) __sfr FSR0L;
223 extern __at(0x0005) __sfr FSR0H;
224 extern __at(0x0006) __sfr FSR1;
225 extern __at(0x0006) __sfr FSR1L;
226 extern __at(0x0007) __sfr FSR1H;
228 //==============================================================================
229 // BSR Bits
231 extern __at(0x0008) __sfr BSR;
233 typedef union
235 struct
237 unsigned BSR0 : 1;
238 unsigned BSR1 : 1;
239 unsigned BSR2 : 1;
240 unsigned BSR3 : 1;
241 unsigned BSR4 : 1;
242 unsigned : 1;
243 unsigned : 1;
244 unsigned : 1;
247 struct
249 unsigned BSR : 5;
250 unsigned : 3;
252 } __BSRbits_t;
254 extern __at(0x0008) volatile __BSRbits_t BSRbits;
256 #define _BSR0 0x01
257 #define _BSR1 0x02
258 #define _BSR2 0x04
259 #define _BSR3 0x08
260 #define _BSR4 0x10
262 //==============================================================================
264 extern __at(0x0009) __sfr WREG;
265 extern __at(0x000A) __sfr PCLATH;
267 //==============================================================================
268 // INTCON Bits
270 extern __at(0x000B) __sfr INTCON;
272 typedef union
274 struct
276 unsigned IOCIF : 1;
277 unsigned INTF : 1;
278 unsigned TMR0IF : 1;
279 unsigned IOCIE : 1;
280 unsigned INTE : 1;
281 unsigned TMR0IE : 1;
282 unsigned PEIE : 1;
283 unsigned GIE : 1;
286 struct
288 unsigned : 1;
289 unsigned : 1;
290 unsigned T0IF : 1;
291 unsigned : 1;
292 unsigned : 1;
293 unsigned T0IE : 1;
294 unsigned : 1;
295 unsigned : 1;
297 } __INTCONbits_t;
299 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
301 #define _IOCIF 0x01
302 #define _INTF 0x02
303 #define _TMR0IF 0x04
304 #define _T0IF 0x04
305 #define _IOCIE 0x08
306 #define _INTE 0x10
307 #define _TMR0IE 0x20
308 #define _T0IE 0x20
309 #define _PEIE 0x40
310 #define _GIE 0x80
312 //==============================================================================
315 //==============================================================================
316 // PORTA Bits
318 extern __at(0x000C) __sfr PORTA;
320 typedef struct
322 unsigned RA0 : 1;
323 unsigned RA1 : 1;
324 unsigned : 1;
325 unsigned RA3 : 1;
326 unsigned RA4 : 1;
327 unsigned RA5 : 1;
328 unsigned : 1;
329 unsigned : 1;
330 } __PORTAbits_t;
332 extern __at(0x000C) volatile __PORTAbits_t PORTAbits;
334 #define _RA0 0x01
335 #define _RA1 0x02
336 #define _RA3 0x08
337 #define _RA4 0x10
338 #define _RA5 0x20
340 //==============================================================================
343 //==============================================================================
344 // PORTB Bits
346 extern __at(0x000D) __sfr PORTB;
348 typedef struct
350 unsigned : 1;
351 unsigned : 1;
352 unsigned : 1;
353 unsigned : 1;
354 unsigned RB4 : 1;
355 unsigned RB5 : 1;
356 unsigned RB6 : 1;
357 unsigned RB7 : 1;
358 } __PORTBbits_t;
360 extern __at(0x000D) volatile __PORTBbits_t PORTBbits;
362 #define _RB4 0x10
363 #define _RB5 0x20
364 #define _RB6 0x40
365 #define _RB7 0x80
367 //==============================================================================
370 //==============================================================================
371 // PORTC Bits
373 extern __at(0x000E) __sfr PORTC;
375 typedef struct
377 unsigned RC0 : 1;
378 unsigned RC1 : 1;
379 unsigned RC2 : 1;
380 unsigned RC3 : 1;
381 unsigned RC4 : 1;
382 unsigned RC5 : 1;
383 unsigned RC6 : 1;
384 unsigned RC7 : 1;
385 } __PORTCbits_t;
387 extern __at(0x000E) volatile __PORTCbits_t PORTCbits;
389 #define _RC0 0x01
390 #define _RC1 0x02
391 #define _RC2 0x04
392 #define _RC3 0x08
393 #define _RC4 0x10
394 #define _RC5 0x20
395 #define _RC6 0x40
396 #define _RC7 0x80
398 //==============================================================================
401 //==============================================================================
402 // PIR1 Bits
404 extern __at(0x0011) __sfr PIR1;
406 typedef struct
408 unsigned TMR1IF : 1;
409 unsigned TMR2IF : 1;
410 unsigned : 1;
411 unsigned SSP1IF : 1;
412 unsigned TXIF : 1;
413 unsigned RCIF : 1;
414 unsigned ADIF : 1;
415 unsigned TMR1GIF : 1;
416 } __PIR1bits_t;
418 extern __at(0x0011) volatile __PIR1bits_t PIR1bits;
420 #define _TMR1IF 0x01
421 #define _TMR2IF 0x02
422 #define _SSP1IF 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 : 1;
439 unsigned ACTIF : 1;
440 unsigned USBIF : 1;
441 unsigned BCL1IF : 1;
442 unsigned : 1;
443 unsigned C1IF : 1;
444 unsigned C2IF : 1;
445 unsigned OSFIF : 1;
446 } __PIR2bits_t;
448 extern __at(0x0012) volatile __PIR2bits_t PIR2bits;
450 #define _ACTIF 0x02
451 #define _USBIF 0x04
452 #define _BCL1IF 0x08
453 #define _C1IF 0x20
454 #define _C2IF 0x40
455 #define _OSFIF 0x80
457 //==============================================================================
459 extern __at(0x0015) __sfr TMR0;
460 extern __at(0x0016) __sfr TMR1;
461 extern __at(0x0016) __sfr TMR1L;
462 extern __at(0x0017) __sfr TMR1H;
464 //==============================================================================
465 // T1CON Bits
467 extern __at(0x0018) __sfr T1CON;
469 typedef union
471 struct
473 unsigned TMR1ON : 1;
474 unsigned : 1;
475 unsigned NOT_T1SYNC : 1;
476 unsigned T1OSCEN : 1;
477 unsigned T1CKPS0 : 1;
478 unsigned T1CKPS1 : 1;
479 unsigned TMR1CS0 : 1;
480 unsigned TMR1CS1 : 1;
483 struct
485 unsigned : 4;
486 unsigned T1CKPS : 2;
487 unsigned : 2;
490 struct
492 unsigned : 6;
493 unsigned TMR1CS : 2;
495 } __T1CONbits_t;
497 extern __at(0x0018) volatile __T1CONbits_t T1CONbits;
499 #define _TMR1ON 0x01
500 #define _NOT_T1SYNC 0x04
501 #define _T1OSCEN 0x08
502 #define _T1CKPS0 0x10
503 #define _T1CKPS1 0x20
504 #define _TMR1CS0 0x40
505 #define _TMR1CS1 0x80
507 //==============================================================================
510 //==============================================================================
511 // T1GCON Bits
513 extern __at(0x0019) __sfr T1GCON;
515 typedef union
517 struct
519 unsigned T1GSS0 : 1;
520 unsigned T1GSS1 : 1;
521 unsigned T1GVAL : 1;
522 unsigned T1GGO_NOT_DONE : 1;
523 unsigned T1GSPM : 1;
524 unsigned T1GTM : 1;
525 unsigned T1GPOL : 1;
526 unsigned TMR1GE : 1;
529 struct
531 unsigned T1GSS : 2;
532 unsigned : 6;
534 } __T1GCONbits_t;
536 extern __at(0x0019) volatile __T1GCONbits_t T1GCONbits;
538 #define _T1GSS0 0x01
539 #define _T1GSS1 0x02
540 #define _T1GVAL 0x04
541 #define _T1GGO_NOT_DONE 0x08
542 #define _T1GSPM 0x10
543 #define _T1GTM 0x20
544 #define _T1GPOL 0x40
545 #define _TMR1GE 0x80
547 //==============================================================================
549 extern __at(0x001A) __sfr TMR2;
550 extern __at(0x001B) __sfr PR2;
552 //==============================================================================
553 // T2CON Bits
555 extern __at(0x001C) __sfr T2CON;
557 typedef union
559 struct
561 unsigned T2CKPS0 : 1;
562 unsigned T2CKPS1 : 1;
563 unsigned TMR2ON : 1;
564 unsigned T2OUTPS0 : 1;
565 unsigned T2OUTPS1 : 1;
566 unsigned T2OUTPS2 : 1;
567 unsigned T2OUTPS3 : 1;
568 unsigned : 1;
571 struct
573 unsigned T2CKPS : 2;
574 unsigned : 6;
577 struct
579 unsigned : 3;
580 unsigned T2OUTPS : 4;
581 unsigned : 1;
583 } __T2CONbits_t;
585 extern __at(0x001C) volatile __T2CONbits_t T2CONbits;
587 #define _T2CKPS0 0x01
588 #define _T2CKPS1 0x02
589 #define _TMR2ON 0x04
590 #define _T2OUTPS0 0x08
591 #define _T2OUTPS1 0x10
592 #define _T2OUTPS2 0x20
593 #define _T2OUTPS3 0x40
595 //==============================================================================
598 //==============================================================================
599 // TRISA Bits
601 extern __at(0x008C) __sfr TRISA;
603 typedef struct
605 unsigned : 1;
606 unsigned : 1;
607 unsigned : 1;
608 unsigned : 1;
609 unsigned TRISA4 : 1;
610 unsigned TRISA5 : 1;
611 unsigned : 1;
612 unsigned : 1;
613 } __TRISAbits_t;
615 extern __at(0x008C) volatile __TRISAbits_t TRISAbits;
617 #define _TRISA4 0x10
618 #define _TRISA5 0x20
620 //==============================================================================
623 //==============================================================================
624 // TRISB Bits
626 extern __at(0x008D) __sfr TRISB;
628 typedef struct
630 unsigned : 1;
631 unsigned : 1;
632 unsigned : 1;
633 unsigned : 1;
634 unsigned TRISB4 : 1;
635 unsigned TRISB5 : 1;
636 unsigned TRISB6 : 1;
637 unsigned TRISB7 : 1;
638 } __TRISBbits_t;
640 extern __at(0x008D) volatile __TRISBbits_t TRISBbits;
642 #define _TRISB4 0x10
643 #define _TRISB5 0x20
644 #define _TRISB6 0x40
645 #define _TRISB7 0x80
647 //==============================================================================
650 //==============================================================================
651 // TRISC Bits
653 extern __at(0x008E) __sfr TRISC;
655 typedef struct
657 unsigned TRISC0 : 1;
658 unsigned TRISC1 : 1;
659 unsigned TRISC2 : 1;
660 unsigned TRISC3 : 1;
661 unsigned TRISC4 : 1;
662 unsigned TRISC5 : 1;
663 unsigned TRISC6 : 1;
664 unsigned TRISC7 : 1;
665 } __TRISCbits_t;
667 extern __at(0x008E) volatile __TRISCbits_t TRISCbits;
669 #define _TRISC0 0x01
670 #define _TRISC1 0x02
671 #define _TRISC2 0x04
672 #define _TRISC3 0x08
673 #define _TRISC4 0x10
674 #define _TRISC5 0x20
675 #define _TRISC6 0x40
676 #define _TRISC7 0x80
678 //==============================================================================
681 //==============================================================================
682 // PIE1 Bits
684 extern __at(0x0091) __sfr PIE1;
686 typedef struct
688 unsigned TMR1IE : 1;
689 unsigned TMR2IE : 1;
690 unsigned : 1;
691 unsigned SSP1IE : 1;
692 unsigned TXIE : 1;
693 unsigned RCIE : 1;
694 unsigned ADIE : 1;
695 unsigned TMR1GIE : 1;
696 } __PIE1bits_t;
698 extern __at(0x0091) volatile __PIE1bits_t PIE1bits;
700 #define _TMR1IE 0x01
701 #define _TMR2IE 0x02
702 #define _SSP1IE 0x08
703 #define _TXIE 0x10
704 #define _RCIE 0x20
705 #define _ADIE 0x40
706 #define _TMR1GIE 0x80
708 //==============================================================================
711 //==============================================================================
712 // PIE2 Bits
714 extern __at(0x0092) __sfr PIE2;
716 typedef struct
718 unsigned : 1;
719 unsigned ACTIE : 1;
720 unsigned USBIE : 1;
721 unsigned BCL1IE : 1;
722 unsigned : 1;
723 unsigned C1IE : 1;
724 unsigned C2IE : 1;
725 unsigned OSFIE : 1;
726 } __PIE2bits_t;
728 extern __at(0x0092) volatile __PIE2bits_t PIE2bits;
730 #define _ACTIE 0x02
731 #define _USBIE 0x04
732 #define _BCL1IE 0x08
733 #define _C1IE 0x20
734 #define _C2IE 0x40
735 #define _OSFIE 0x80
737 //==============================================================================
740 //==============================================================================
741 // OPTION_REG Bits
743 extern __at(0x0095) __sfr OPTION_REG;
745 typedef union
747 struct
749 unsigned PS0 : 1;
750 unsigned PS1 : 1;
751 unsigned PS2 : 1;
752 unsigned PSA : 1;
753 unsigned TMR0SE : 1;
754 unsigned TMR0CS : 1;
755 unsigned INTEDG : 1;
756 unsigned NOT_WPUEN : 1;
759 struct
761 unsigned : 1;
762 unsigned : 1;
763 unsigned : 1;
764 unsigned : 1;
765 unsigned T0SE : 1;
766 unsigned T0CS : 1;
767 unsigned : 1;
768 unsigned : 1;
771 struct
773 unsigned PS : 3;
774 unsigned : 5;
776 } __OPTION_REGbits_t;
778 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits;
780 #define _PS0 0x01
781 #define _PS1 0x02
782 #define _PS2 0x04
783 #define _PSA 0x08
784 #define _TMR0SE 0x10
785 #define _T0SE 0x10
786 #define _TMR0CS 0x20
787 #define _T0CS 0x20
788 #define _INTEDG 0x40
789 #define _NOT_WPUEN 0x80
791 //==============================================================================
794 //==============================================================================
795 // PCON Bits
797 extern __at(0x0096) __sfr PCON;
799 typedef struct
801 unsigned NOT_BOR : 1;
802 unsigned NOT_POR : 1;
803 unsigned NOT_RI : 1;
804 unsigned NOT_RMCLR : 1;
805 unsigned NOT_RWDT : 1;
806 unsigned : 1;
807 unsigned STKUNF : 1;
808 unsigned STKOVF : 1;
809 } __PCONbits_t;
811 extern __at(0x0096) volatile __PCONbits_t PCONbits;
813 #define _NOT_BOR 0x01
814 #define _NOT_POR 0x02
815 #define _NOT_RI 0x04
816 #define _NOT_RMCLR 0x08
817 #define _NOT_RWDT 0x10
818 #define _STKUNF 0x40
819 #define _STKOVF 0x80
821 //==============================================================================
824 //==============================================================================
825 // WDTCON Bits
827 extern __at(0x0097) __sfr WDTCON;
829 typedef union
831 struct
833 unsigned SWDTEN : 1;
834 unsigned WDTPS0 : 1;
835 unsigned WDTPS1 : 1;
836 unsigned WDTPS2 : 1;
837 unsigned WDTPS3 : 1;
838 unsigned WDTPS4 : 1;
839 unsigned : 1;
840 unsigned : 1;
843 struct
845 unsigned : 1;
846 unsigned WDTPS : 5;
847 unsigned : 2;
849 } __WDTCONbits_t;
851 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
853 #define _SWDTEN 0x01
854 #define _WDTPS0 0x02
855 #define _WDTPS1 0x04
856 #define _WDTPS2 0x08
857 #define _WDTPS3 0x10
858 #define _WDTPS4 0x20
860 //==============================================================================
863 //==============================================================================
864 // OSCTUNE Bits
866 extern __at(0x0098) __sfr OSCTUNE;
868 typedef union
870 struct
872 unsigned TUN0 : 1;
873 unsigned TUN1 : 1;
874 unsigned TUN2 : 1;
875 unsigned TUN3 : 1;
876 unsigned TUN4 : 1;
877 unsigned TUN5 : 1;
878 unsigned TUN6 : 1;
879 unsigned : 1;
882 struct
884 unsigned TUN : 7;
885 unsigned : 1;
887 } __OSCTUNEbits_t;
889 extern __at(0x0098) volatile __OSCTUNEbits_t OSCTUNEbits;
891 #define _TUN0 0x01
892 #define _TUN1 0x02
893 #define _TUN2 0x04
894 #define _TUN3 0x08
895 #define _TUN4 0x10
896 #define _TUN5 0x20
897 #define _TUN6 0x40
899 //==============================================================================
902 //==============================================================================
903 // OSCCON Bits
905 extern __at(0x0099) __sfr OSCCON;
907 typedef union
909 struct
911 unsigned SCS0 : 1;
912 unsigned SCS1 : 1;
913 unsigned IRCF0 : 1;
914 unsigned IRCF1 : 1;
915 unsigned IRCF2 : 1;
916 unsigned IRCF3 : 1;
917 unsigned SPLLMULT : 1;
918 unsigned SPLLEN : 1;
921 struct
923 unsigned SCS : 2;
924 unsigned : 6;
927 struct
929 unsigned : 2;
930 unsigned IRCF : 4;
931 unsigned : 2;
933 } __OSCCONbits_t;
935 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits;
937 #define _SCS0 0x01
938 #define _SCS1 0x02
939 #define _IRCF0 0x04
940 #define _IRCF1 0x08
941 #define _IRCF2 0x10
942 #define _IRCF3 0x20
943 #define _SPLLMULT 0x40
944 #define _SPLLEN 0x80
946 //==============================================================================
949 //==============================================================================
950 // OSCSTAT Bits
952 extern __at(0x009A) __sfr OSCSTAT;
954 typedef struct
956 unsigned HFIOFS : 1;
957 unsigned LFIOFR : 1;
958 unsigned : 1;
959 unsigned : 1;
960 unsigned HFIOFR : 1;
961 unsigned OSTS : 1;
962 unsigned PLLRDY : 1;
963 unsigned SOSCR : 1;
964 } __OSCSTATbits_t;
966 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits;
968 #define _HFIOFS 0x01
969 #define _LFIOFR 0x02
970 #define _HFIOFR 0x10
971 #define _OSTS 0x20
972 #define _PLLRDY 0x40
973 #define _SOSCR 0x80
975 //==============================================================================
977 extern __at(0x009B) __sfr ADRES;
978 extern __at(0x009B) __sfr ADRESL;
979 extern __at(0x009C) __sfr ADRESH;
981 //==============================================================================
982 // ADCON0 Bits
984 extern __at(0x009D) __sfr ADCON0;
986 typedef union
988 struct
990 unsigned ADON : 1;
991 unsigned GO_NOT_DONE : 1;
992 unsigned CHS0 : 1;
993 unsigned CHS1 : 1;
994 unsigned CHS2 : 1;
995 unsigned CHS3 : 1;
996 unsigned CHS4 : 1;
997 unsigned : 1;
1000 struct
1002 unsigned : 1;
1003 unsigned ADGO : 1;
1004 unsigned : 1;
1005 unsigned : 1;
1006 unsigned : 1;
1007 unsigned : 1;
1008 unsigned : 1;
1009 unsigned : 1;
1012 struct
1014 unsigned : 1;
1015 unsigned GO : 1;
1016 unsigned : 1;
1017 unsigned : 1;
1018 unsigned : 1;
1019 unsigned : 1;
1020 unsigned : 1;
1021 unsigned : 1;
1024 struct
1026 unsigned : 2;
1027 unsigned CHS : 5;
1028 unsigned : 1;
1030 } __ADCON0bits_t;
1032 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits;
1034 #define _ADON 0x01
1035 #define _GO_NOT_DONE 0x02
1036 #define _ADGO 0x02
1037 #define _GO 0x02
1038 #define _CHS0 0x04
1039 #define _CHS1 0x08
1040 #define _CHS2 0x10
1041 #define _CHS3 0x20
1042 #define _CHS4 0x40
1044 //==============================================================================
1047 //==============================================================================
1048 // ADCON1 Bits
1050 extern __at(0x009E) __sfr ADCON1;
1052 typedef union
1054 struct
1056 unsigned ADPREF0 : 1;
1057 unsigned ADPREF1 : 1;
1058 unsigned : 1;
1059 unsigned : 1;
1060 unsigned ADCS0 : 1;
1061 unsigned ADCS1 : 1;
1062 unsigned ADCS2 : 1;
1063 unsigned ADFM : 1;
1066 struct
1068 unsigned ADPREF : 2;
1069 unsigned : 6;
1072 struct
1074 unsigned : 4;
1075 unsigned ADCS : 3;
1076 unsigned : 1;
1078 } __ADCON1bits_t;
1080 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits;
1082 #define _ADPREF0 0x01
1083 #define _ADPREF1 0x02
1084 #define _ADCS0 0x10
1085 #define _ADCS1 0x20
1086 #define _ADCS2 0x40
1087 #define _ADFM 0x80
1089 //==============================================================================
1092 //==============================================================================
1093 // ADCON2 Bits
1095 extern __at(0x009F) __sfr ADCON2;
1097 typedef union
1099 struct
1101 unsigned : 1;
1102 unsigned : 1;
1103 unsigned : 1;
1104 unsigned : 1;
1105 unsigned TRIGSEL0 : 1;
1106 unsigned TRIGSEL1 : 1;
1107 unsigned TRIGSEL2 : 1;
1108 unsigned : 1;
1111 struct
1113 unsigned : 4;
1114 unsigned TRIGSEL : 3;
1115 unsigned : 1;
1117 } __ADCON2bits_t;
1119 extern __at(0x009F) volatile __ADCON2bits_t ADCON2bits;
1121 #define _TRIGSEL0 0x10
1122 #define _TRIGSEL1 0x20
1123 #define _TRIGSEL2 0x40
1125 //==============================================================================
1128 //==============================================================================
1129 // LATA Bits
1131 extern __at(0x010C) __sfr LATA;
1133 typedef struct
1135 unsigned : 1;
1136 unsigned : 1;
1137 unsigned : 1;
1138 unsigned : 1;
1139 unsigned LATA4 : 1;
1140 unsigned LATA5 : 1;
1141 unsigned : 1;
1142 unsigned : 1;
1143 } __LATAbits_t;
1145 extern __at(0x010C) volatile __LATAbits_t LATAbits;
1147 #define _LATA4 0x10
1148 #define _LATA5 0x20
1150 //==============================================================================
1153 //==============================================================================
1154 // LATB Bits
1156 extern __at(0x010D) __sfr LATB;
1158 typedef struct
1160 unsigned : 1;
1161 unsigned : 1;
1162 unsigned : 1;
1163 unsigned : 1;
1164 unsigned LATB4 : 1;
1165 unsigned LATB5 : 1;
1166 unsigned LATB6 : 1;
1167 unsigned LATB7 : 1;
1168 } __LATBbits_t;
1170 extern __at(0x010D) volatile __LATBbits_t LATBbits;
1172 #define _LATB4 0x10
1173 #define _LATB5 0x20
1174 #define _LATB6 0x40
1175 #define _LATB7 0x80
1177 //==============================================================================
1180 //==============================================================================
1181 // LATC Bits
1183 extern __at(0x010E) __sfr LATC;
1185 typedef struct
1187 unsigned LATC0 : 1;
1188 unsigned LATC1 : 1;
1189 unsigned LATC2 : 1;
1190 unsigned LATC3 : 1;
1191 unsigned LATC4 : 1;
1192 unsigned LATC5 : 1;
1193 unsigned LATC6 : 1;
1194 unsigned LATC7 : 1;
1195 } __LATCbits_t;
1197 extern __at(0x010E) volatile __LATCbits_t LATCbits;
1199 #define _LATC0 0x01
1200 #define _LATC1 0x02
1201 #define _LATC2 0x04
1202 #define _LATC3 0x08
1203 #define _LATC4 0x10
1204 #define _LATC5 0x20
1205 #define _LATC6 0x40
1206 #define _LATC7 0x80
1208 //==============================================================================
1211 //==============================================================================
1212 // CM1CON0 Bits
1214 extern __at(0x0111) __sfr CM1CON0;
1216 typedef struct
1218 unsigned C1SYNC : 1;
1219 unsigned C1HYS : 1;
1220 unsigned C1SP : 1;
1221 unsigned : 1;
1222 unsigned C1POL : 1;
1223 unsigned C1OE : 1;
1224 unsigned C1OUT : 1;
1225 unsigned C1ON : 1;
1226 } __CM1CON0bits_t;
1228 extern __at(0x0111) volatile __CM1CON0bits_t CM1CON0bits;
1230 #define _C1SYNC 0x01
1231 #define _C1HYS 0x02
1232 #define _C1SP 0x04
1233 #define _C1POL 0x10
1234 #define _C1OE 0x20
1235 #define _C1OUT 0x40
1236 #define _C1ON 0x80
1238 //==============================================================================
1241 //==============================================================================
1242 // CM1CON1 Bits
1244 extern __at(0x0112) __sfr CM1CON1;
1246 typedef union
1248 struct
1250 unsigned C1NCH0 : 1;
1251 unsigned C1NCH1 : 1;
1252 unsigned C1NCH2 : 1;
1253 unsigned : 1;
1254 unsigned C1PCH0 : 1;
1255 unsigned C1PCH1 : 1;
1256 unsigned C1INTN : 1;
1257 unsigned C1INTP : 1;
1260 struct
1262 unsigned C1NCH : 3;
1263 unsigned : 5;
1266 struct
1268 unsigned : 4;
1269 unsigned C1PCH : 2;
1270 unsigned : 2;
1272 } __CM1CON1bits_t;
1274 extern __at(0x0112) volatile __CM1CON1bits_t CM1CON1bits;
1276 #define _C1NCH0 0x01
1277 #define _C1NCH1 0x02
1278 #define _C1NCH2 0x04
1279 #define _C1PCH0 0x10
1280 #define _C1PCH1 0x20
1281 #define _C1INTN 0x40
1282 #define _C1INTP 0x80
1284 //==============================================================================
1287 //==============================================================================
1288 // CM2CON0 Bits
1290 extern __at(0x0113) __sfr CM2CON0;
1292 typedef struct
1294 unsigned C2SYNC : 1;
1295 unsigned C2HYS : 1;
1296 unsigned C2SP : 1;
1297 unsigned : 1;
1298 unsigned C2POL : 1;
1299 unsigned C2OE : 1;
1300 unsigned C2OUT : 1;
1301 unsigned C2ON : 1;
1302 } __CM2CON0bits_t;
1304 extern __at(0x0113) volatile __CM2CON0bits_t CM2CON0bits;
1306 #define _C2SYNC 0x01
1307 #define _C2HYS 0x02
1308 #define _C2SP 0x04
1309 #define _C2POL 0x10
1310 #define _C2OE 0x20
1311 #define _C2OUT 0x40
1312 #define _C2ON 0x80
1314 //==============================================================================
1317 //==============================================================================
1318 // CM2CON1 Bits
1320 extern __at(0x0114) __sfr CM2CON1;
1322 typedef union
1324 struct
1326 unsigned C2NCH0 : 1;
1327 unsigned C2NCH1 : 1;
1328 unsigned C2NCH2 : 1;
1329 unsigned : 1;
1330 unsigned C2PCH0 : 1;
1331 unsigned C2PCH1 : 1;
1332 unsigned C2INTN : 1;
1333 unsigned C2INTP : 1;
1336 struct
1338 unsigned C2NCH : 3;
1339 unsigned : 5;
1342 struct
1344 unsigned : 4;
1345 unsigned C2PCH : 2;
1346 unsigned : 2;
1348 } __CM2CON1bits_t;
1350 extern __at(0x0114) volatile __CM2CON1bits_t CM2CON1bits;
1352 #define _C2NCH0 0x01
1353 #define _C2NCH1 0x02
1354 #define _C2NCH2 0x04
1355 #define _C2PCH0 0x10
1356 #define _C2PCH1 0x20
1357 #define _C2INTN 0x40
1358 #define _C2INTP 0x80
1360 //==============================================================================
1363 //==============================================================================
1364 // CMOUT Bits
1366 extern __at(0x0115) __sfr CMOUT;
1368 typedef struct
1370 unsigned MC1OUT : 1;
1371 unsigned MC2OUT : 1;
1372 unsigned : 1;
1373 unsigned : 1;
1374 unsigned : 1;
1375 unsigned : 1;
1376 unsigned : 1;
1377 unsigned : 1;
1378 } __CMOUTbits_t;
1380 extern __at(0x0115) volatile __CMOUTbits_t CMOUTbits;
1382 #define _MC1OUT 0x01
1383 #define _MC2OUT 0x02
1385 //==============================================================================
1388 //==============================================================================
1389 // BORCON Bits
1391 extern __at(0x0116) __sfr BORCON;
1393 typedef struct
1395 unsigned BORRDY : 1;
1396 unsigned : 1;
1397 unsigned : 1;
1398 unsigned : 1;
1399 unsigned : 1;
1400 unsigned : 1;
1401 unsigned BORFS : 1;
1402 unsigned SBOREN : 1;
1403 } __BORCONbits_t;
1405 extern __at(0x0116) volatile __BORCONbits_t BORCONbits;
1407 #define _BORRDY 0x01
1408 #define _BORFS 0x40
1409 #define _SBOREN 0x80
1411 //==============================================================================
1414 //==============================================================================
1415 // FVRCON Bits
1417 extern __at(0x0117) __sfr FVRCON;
1419 typedef union
1421 struct
1423 unsigned ADFVR0 : 1;
1424 unsigned ADFVR1 : 1;
1425 unsigned CDAFVR0 : 1;
1426 unsigned CDAFVR1 : 1;
1427 unsigned : 1;
1428 unsigned : 1;
1429 unsigned FVRRDY : 1;
1430 unsigned FVREN : 1;
1433 struct
1435 unsigned ADFVR : 2;
1436 unsigned : 6;
1439 struct
1441 unsigned : 2;
1442 unsigned CDAFVR : 2;
1443 unsigned : 4;
1445 } __FVRCONbits_t;
1447 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits;
1449 #define _ADFVR0 0x01
1450 #define _ADFVR1 0x02
1451 #define _CDAFVR0 0x04
1452 #define _CDAFVR1 0x08
1453 #define _FVRRDY 0x40
1454 #define _FVREN 0x80
1456 //==============================================================================
1459 //==============================================================================
1460 // DACCON0 Bits
1462 extern __at(0x0118) __sfr DACCON0;
1464 typedef union
1466 struct
1468 unsigned : 1;
1469 unsigned : 1;
1470 unsigned D1PSS0 : 1;
1471 unsigned D1PSS1 : 1;
1472 unsigned DACOE2 : 1;
1473 unsigned DACOE1 : 1;
1474 unsigned : 1;
1475 unsigned DACEN : 1;
1478 struct
1480 unsigned : 2;
1481 unsigned D1PSS : 2;
1482 unsigned : 4;
1484 } __DACCON0bits_t;
1486 extern __at(0x0118) volatile __DACCON0bits_t DACCON0bits;
1488 #define _D1PSS0 0x04
1489 #define _D1PSS1 0x08
1490 #define _DACOE2 0x10
1491 #define _DACOE1 0x20
1492 #define _DACEN 0x80
1494 //==============================================================================
1497 //==============================================================================
1498 // DACCON1 Bits
1500 extern __at(0x0119) __sfr DACCON1;
1502 typedef union
1504 struct
1506 unsigned DACR0 : 1;
1507 unsigned DACR1 : 1;
1508 unsigned DACR2 : 1;
1509 unsigned DACR3 : 1;
1510 unsigned DACR4 : 1;
1511 unsigned : 1;
1512 unsigned : 1;
1513 unsigned : 1;
1516 struct
1518 unsigned DACR : 5;
1519 unsigned : 3;
1521 } __DACCON1bits_t;
1523 extern __at(0x0119) volatile __DACCON1bits_t DACCON1bits;
1525 #define _DACR0 0x01
1526 #define _DACR1 0x02
1527 #define _DACR2 0x04
1528 #define _DACR3 0x08
1529 #define _DACR4 0x10
1531 //==============================================================================
1534 //==============================================================================
1535 // APFCON Bits
1537 extern __at(0x011D) __sfr APFCON;
1539 typedef struct
1541 unsigned : 1;
1542 unsigned : 1;
1543 unsigned : 1;
1544 unsigned T1GSEL : 1;
1545 unsigned : 1;
1546 unsigned SSSEL : 1;
1547 unsigned : 1;
1548 unsigned CLKRSEL : 1;
1549 } __APFCONbits_t;
1551 extern __at(0x011D) volatile __APFCONbits_t APFCONbits;
1553 #define _T1GSEL 0x08
1554 #define _SSSEL 0x20
1555 #define _CLKRSEL 0x80
1557 //==============================================================================
1560 //==============================================================================
1561 // ANSELA Bits
1563 extern __at(0x018C) __sfr ANSELA;
1565 typedef struct
1567 unsigned : 1;
1568 unsigned : 1;
1569 unsigned : 1;
1570 unsigned : 1;
1571 unsigned ANSA4 : 1;
1572 unsigned : 1;
1573 unsigned : 1;
1574 unsigned : 1;
1575 } __ANSELAbits_t;
1577 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits;
1579 #define _ANSA4 0x10
1581 //==============================================================================
1584 //==============================================================================
1585 // ANSELB Bits
1587 extern __at(0x018D) __sfr ANSELB;
1589 typedef struct
1591 unsigned : 1;
1592 unsigned : 1;
1593 unsigned : 1;
1594 unsigned : 1;
1595 unsigned ANSB4 : 1;
1596 unsigned ANSB5 : 1;
1597 unsigned : 1;
1598 unsigned : 1;
1599 } __ANSELBbits_t;
1601 extern __at(0x018D) volatile __ANSELBbits_t ANSELBbits;
1603 #define _ANSB4 0x10
1604 #define _ANSB5 0x20
1606 //==============================================================================
1609 //==============================================================================
1610 // ANSELC Bits
1612 extern __at(0x018E) __sfr ANSELC;
1614 typedef struct
1616 unsigned ANSC0 : 1;
1617 unsigned ANSC1 : 1;
1618 unsigned ANSC2 : 1;
1619 unsigned ANSC3 : 1;
1620 unsigned : 1;
1621 unsigned : 1;
1622 unsigned ANSC6 : 1;
1623 unsigned ANSC7 : 1;
1624 } __ANSELCbits_t;
1626 extern __at(0x018E) volatile __ANSELCbits_t ANSELCbits;
1628 #define _ANSC0 0x01
1629 #define _ANSC1 0x02
1630 #define _ANSC2 0x04
1631 #define _ANSC3 0x08
1632 #define _ANSC6 0x40
1633 #define _ANSC7 0x80
1635 //==============================================================================
1637 extern __at(0x0191) __sfr PMADR;
1638 extern __at(0x0191) __sfr PMADRL;
1639 extern __at(0x0192) __sfr PMADRH;
1640 extern __at(0x0193) __sfr PMDAT;
1641 extern __at(0x0193) __sfr PMDATL;
1642 extern __at(0x0194) __sfr PMDATH;
1644 //==============================================================================
1645 // PMCON1 Bits
1647 extern __at(0x0195) __sfr PMCON1;
1649 typedef struct
1651 unsigned RD : 1;
1652 unsigned WR : 1;
1653 unsigned WREN : 1;
1654 unsigned WRERR : 1;
1655 unsigned FREE : 1;
1656 unsigned LWLO : 1;
1657 unsigned CFGS : 1;
1658 unsigned : 1;
1659 } __PMCON1bits_t;
1661 extern __at(0x0195) volatile __PMCON1bits_t PMCON1bits;
1663 #define _RD 0x01
1664 #define _WR 0x02
1665 #define _WREN 0x04
1666 #define _WRERR 0x08
1667 #define _FREE 0x10
1668 #define _LWLO 0x20
1669 #define _CFGS 0x40
1671 //==============================================================================
1673 extern __at(0x0196) __sfr PMCON2;
1674 extern __at(0x0199) __sfr RCREG;
1675 extern __at(0x019A) __sfr TXREG;
1676 extern __at(0x019B) __sfr SPBRG;
1677 extern __at(0x019B) __sfr SPBRGL;
1678 extern __at(0x019C) __sfr SPBRGH;
1680 //==============================================================================
1681 // RCSTA Bits
1683 extern __at(0x019D) __sfr RCSTA;
1685 typedef struct
1687 unsigned RX9D : 1;
1688 unsigned OERR : 1;
1689 unsigned FERR : 1;
1690 unsigned ADDEN : 1;
1691 unsigned CREN : 1;
1692 unsigned SREN : 1;
1693 unsigned RX9 : 1;
1694 unsigned SPEN : 1;
1695 } __RCSTAbits_t;
1697 extern __at(0x019D) volatile __RCSTAbits_t RCSTAbits;
1699 #define _RX9D 0x01
1700 #define _OERR 0x02
1701 #define _FERR 0x04
1702 #define _ADDEN 0x08
1703 #define _CREN 0x10
1704 #define _SREN 0x20
1705 #define _RX9 0x40
1706 #define _SPEN 0x80
1708 //==============================================================================
1711 //==============================================================================
1712 // TXSTA Bits
1714 extern __at(0x019E) __sfr TXSTA;
1716 typedef struct
1718 unsigned TX9D : 1;
1719 unsigned TRMT : 1;
1720 unsigned BRGH : 1;
1721 unsigned SENDB : 1;
1722 unsigned SYNC : 1;
1723 unsigned TXEN : 1;
1724 unsigned TX9 : 1;
1725 unsigned CSRC : 1;
1726 } __TXSTAbits_t;
1728 extern __at(0x019E) volatile __TXSTAbits_t TXSTAbits;
1730 #define _TX9D 0x01
1731 #define _TRMT 0x02
1732 #define _BRGH 0x04
1733 #define _SENDB 0x08
1734 #define _SYNC 0x10
1735 #define _TXEN 0x20
1736 #define _TX9 0x40
1737 #define _CSRC 0x80
1739 //==============================================================================
1742 //==============================================================================
1743 // BAUDCON Bits
1745 extern __at(0x019F) __sfr BAUDCON;
1747 typedef struct
1749 unsigned ABDEN : 1;
1750 unsigned WUE : 1;
1751 unsigned : 1;
1752 unsigned BRG16 : 1;
1753 unsigned SCKP : 1;
1754 unsigned : 1;
1755 unsigned RCIDL : 1;
1756 unsigned ABDOVF : 1;
1757 } __BAUDCONbits_t;
1759 extern __at(0x019F) volatile __BAUDCONbits_t BAUDCONbits;
1761 #define _ABDEN 0x01
1762 #define _WUE 0x02
1763 #define _BRG16 0x08
1764 #define _SCKP 0x10
1765 #define _RCIDL 0x40
1766 #define _ABDOVF 0x80
1768 //==============================================================================
1771 //==============================================================================
1772 // WPUA Bits
1774 extern __at(0x020C) __sfr WPUA;
1776 typedef struct
1778 unsigned : 1;
1779 unsigned : 1;
1780 unsigned : 1;
1781 unsigned WPUA3 : 1;
1782 unsigned WPUA4 : 1;
1783 unsigned WPUA5 : 1;
1784 unsigned : 1;
1785 unsigned : 1;
1786 } __WPUAbits_t;
1788 extern __at(0x020C) volatile __WPUAbits_t WPUAbits;
1790 #define _WPUA3 0x08
1791 #define _WPUA4 0x10
1792 #define _WPUA5 0x20
1794 //==============================================================================
1797 //==============================================================================
1798 // WPUB Bits
1800 extern __at(0x020D) __sfr WPUB;
1802 typedef struct
1804 unsigned : 1;
1805 unsigned : 1;
1806 unsigned : 1;
1807 unsigned : 1;
1808 unsigned WPUB4 : 1;
1809 unsigned WPUB5 : 1;
1810 unsigned WPUB6 : 1;
1811 unsigned WPUB7 : 1;
1812 } __WPUBbits_t;
1814 extern __at(0x020D) volatile __WPUBbits_t WPUBbits;
1816 #define _WPUB4 0x10
1817 #define _WPUB5 0x20
1818 #define _WPUB6 0x40
1819 #define _WPUB7 0x80
1821 //==============================================================================
1823 extern __at(0x0211) __sfr SSP1BUF;
1824 extern __at(0x0211) __sfr SSPBUF;
1825 extern __at(0x0212) __sfr SSP1ADD;
1826 extern __at(0x0212) __sfr SSPADD;
1827 extern __at(0x0213) __sfr SSP1MSK;
1828 extern __at(0x0213) __sfr SSPMSK;
1830 //==============================================================================
1831 // SSP1STAT Bits
1833 extern __at(0x0214) __sfr SSP1STAT;
1835 typedef struct
1837 unsigned BF : 1;
1838 unsigned UA : 1;
1839 unsigned R_NOT_W : 1;
1840 unsigned S : 1;
1841 unsigned P : 1;
1842 unsigned D_NOT_A : 1;
1843 unsigned CKE : 1;
1844 unsigned SMP : 1;
1845 } __SSP1STATbits_t;
1847 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits;
1849 #define _BF 0x01
1850 #define _UA 0x02
1851 #define _R_NOT_W 0x04
1852 #define _S 0x08
1853 #define _P 0x10
1854 #define _D_NOT_A 0x20
1855 #define _CKE 0x40
1856 #define _SMP 0x80
1858 //==============================================================================
1861 //==============================================================================
1862 // SSPSTAT Bits
1864 extern __at(0x0214) __sfr SSPSTAT;
1866 typedef struct
1868 unsigned BF : 1;
1869 unsigned UA : 1;
1870 unsigned R_NOT_W : 1;
1871 unsigned S : 1;
1872 unsigned P : 1;
1873 unsigned D_NOT_A : 1;
1874 unsigned CKE : 1;
1875 unsigned SMP : 1;
1876 } __SSPSTATbits_t;
1878 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits;
1880 #define _SSPSTAT_BF 0x01
1881 #define _SSPSTAT_UA 0x02
1882 #define _SSPSTAT_R_NOT_W 0x04
1883 #define _SSPSTAT_S 0x08
1884 #define _SSPSTAT_P 0x10
1885 #define _SSPSTAT_D_NOT_A 0x20
1886 #define _SSPSTAT_CKE 0x40
1887 #define _SSPSTAT_SMP 0x80
1889 //==============================================================================
1892 //==============================================================================
1893 // SSP1CON1 Bits
1895 extern __at(0x0215) __sfr SSP1CON1;
1897 typedef union
1899 struct
1901 unsigned SSP1M0 : 1;
1902 unsigned SSP1M1 : 1;
1903 unsigned SSP1M2 : 1;
1904 unsigned SSP1M3 : 1;
1905 unsigned CKP : 1;
1906 unsigned SSPEN : 1;
1907 unsigned SSPOV : 1;
1908 unsigned WCOL : 1;
1911 struct
1913 unsigned : 1;
1914 unsigned : 1;
1915 unsigned : 1;
1916 unsigned : 1;
1917 unsigned : 1;
1918 unsigned SSP1EN : 1;
1919 unsigned SSP1OV : 1;
1920 unsigned : 1;
1923 struct
1925 unsigned SSP1M : 4;
1926 unsigned : 4;
1928 } __SSP1CON1bits_t;
1930 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits;
1932 #define _SSP1M0 0x01
1933 #define _SSP1M1 0x02
1934 #define _SSP1M2 0x04
1935 #define _SSP1M3 0x08
1936 #define _CKP 0x10
1937 #define _SSPEN 0x20
1938 #define _SSP1EN 0x20
1939 #define _SSPOV 0x40
1940 #define _SSP1OV 0x40
1941 #define _WCOL 0x80
1943 //==============================================================================
1946 //==============================================================================
1947 // SSPCON Bits
1949 extern __at(0x0215) __sfr SSPCON;
1951 typedef union
1953 struct
1955 unsigned SSP1M0 : 1;
1956 unsigned SSP1M1 : 1;
1957 unsigned SSP1M2 : 1;
1958 unsigned SSP1M3 : 1;
1959 unsigned CKP : 1;
1960 unsigned SSPEN : 1;
1961 unsigned SSPOV : 1;
1962 unsigned WCOL : 1;
1965 struct
1967 unsigned : 1;
1968 unsigned : 1;
1969 unsigned : 1;
1970 unsigned : 1;
1971 unsigned : 1;
1972 unsigned SSP1EN : 1;
1973 unsigned SSP1OV : 1;
1974 unsigned : 1;
1977 struct
1979 unsigned SSP1M : 4;
1980 unsigned : 4;
1982 } __SSPCONbits_t;
1984 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits;
1986 #define _SSPCON_SSP1M0 0x01
1987 #define _SSPCON_SSP1M1 0x02
1988 #define _SSPCON_SSP1M2 0x04
1989 #define _SSPCON_SSP1M3 0x08
1990 #define _SSPCON_CKP 0x10
1991 #define _SSPCON_SSPEN 0x20
1992 #define _SSPCON_SSP1EN 0x20
1993 #define _SSPCON_SSPOV 0x40
1994 #define _SSPCON_SSP1OV 0x40
1995 #define _SSPCON_WCOL 0x80
1997 //==============================================================================
2000 //==============================================================================
2001 // SSPCON1 Bits
2003 extern __at(0x0215) __sfr SSPCON1;
2005 typedef union
2007 struct
2009 unsigned SSP1M0 : 1;
2010 unsigned SSP1M1 : 1;
2011 unsigned SSP1M2 : 1;
2012 unsigned SSP1M3 : 1;
2013 unsigned CKP : 1;
2014 unsigned SSPEN : 1;
2015 unsigned SSPOV : 1;
2016 unsigned WCOL : 1;
2019 struct
2021 unsigned : 1;
2022 unsigned : 1;
2023 unsigned : 1;
2024 unsigned : 1;
2025 unsigned : 1;
2026 unsigned SSP1EN : 1;
2027 unsigned SSP1OV : 1;
2028 unsigned : 1;
2031 struct
2033 unsigned SSP1M : 4;
2034 unsigned : 4;
2036 } __SSPCON1bits_t;
2038 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits;
2040 #define _SSPCON1_SSP1M0 0x01
2041 #define _SSPCON1_SSP1M1 0x02
2042 #define _SSPCON1_SSP1M2 0x04
2043 #define _SSPCON1_SSP1M3 0x08
2044 #define _SSPCON1_CKP 0x10
2045 #define _SSPCON1_SSPEN 0x20
2046 #define _SSPCON1_SSP1EN 0x20
2047 #define _SSPCON1_SSPOV 0x40
2048 #define _SSPCON1_SSP1OV 0x40
2049 #define _SSPCON1_WCOL 0x80
2051 //==============================================================================
2054 //==============================================================================
2055 // SSP1CON2 Bits
2057 extern __at(0x0216) __sfr SSP1CON2;
2059 typedef struct
2061 unsigned SEN : 1;
2062 unsigned RSEN : 1;
2063 unsigned PEN : 1;
2064 unsigned RCEN : 1;
2065 unsigned ACKEN : 1;
2066 unsigned ACKDT : 1;
2067 unsigned ACKSTAT : 1;
2068 unsigned GCEN : 1;
2069 } __SSP1CON2bits_t;
2071 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits;
2073 #define _SEN 0x01
2074 #define _RSEN 0x02
2075 #define _PEN 0x04
2076 #define _RCEN 0x08
2077 #define _ACKEN 0x10
2078 #define _ACKDT 0x20
2079 #define _ACKSTAT 0x40
2080 #define _GCEN 0x80
2082 //==============================================================================
2085 //==============================================================================
2086 // SSPCON2 Bits
2088 extern __at(0x0216) __sfr SSPCON2;
2090 typedef struct
2092 unsigned SEN : 1;
2093 unsigned RSEN : 1;
2094 unsigned PEN : 1;
2095 unsigned RCEN : 1;
2096 unsigned ACKEN : 1;
2097 unsigned ACKDT : 1;
2098 unsigned ACKSTAT : 1;
2099 unsigned GCEN : 1;
2100 } __SSPCON2bits_t;
2102 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits;
2104 #define _SSPCON2_SEN 0x01
2105 #define _SSPCON2_RSEN 0x02
2106 #define _SSPCON2_PEN 0x04
2107 #define _SSPCON2_RCEN 0x08
2108 #define _SSPCON2_ACKEN 0x10
2109 #define _SSPCON2_ACKDT 0x20
2110 #define _SSPCON2_ACKSTAT 0x40
2111 #define _SSPCON2_GCEN 0x80
2113 //==============================================================================
2116 //==============================================================================
2117 // SSP1CON3 Bits
2119 extern __at(0x0217) __sfr SSP1CON3;
2121 typedef struct
2123 unsigned DHEN : 1;
2124 unsigned AHEN : 1;
2125 unsigned SBCDE : 1;
2126 unsigned SDAHT : 1;
2127 unsigned BOEN : 1;
2128 unsigned SCIE : 1;
2129 unsigned PCIE : 1;
2130 unsigned ACKTIM : 1;
2131 } __SSP1CON3bits_t;
2133 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits;
2135 #define _DHEN 0x01
2136 #define _AHEN 0x02
2137 #define _SBCDE 0x04
2138 #define _SDAHT 0x08
2139 #define _BOEN 0x10
2140 #define _SCIE 0x20
2141 #define _PCIE 0x40
2142 #define _ACKTIM 0x80
2144 //==============================================================================
2147 //==============================================================================
2148 // SSPCON3 Bits
2150 extern __at(0x0217) __sfr SSPCON3;
2152 typedef struct
2154 unsigned DHEN : 1;
2155 unsigned AHEN : 1;
2156 unsigned SBCDE : 1;
2157 unsigned SDAHT : 1;
2158 unsigned BOEN : 1;
2159 unsigned SCIE : 1;
2160 unsigned PCIE : 1;
2161 unsigned ACKTIM : 1;
2162 } __SSPCON3bits_t;
2164 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits;
2166 #define _SSPCON3_DHEN 0x01
2167 #define _SSPCON3_AHEN 0x02
2168 #define _SSPCON3_SBCDE 0x04
2169 #define _SSPCON3_SDAHT 0x08
2170 #define _SSPCON3_BOEN 0x10
2171 #define _SSPCON3_SCIE 0x20
2172 #define _SSPCON3_PCIE 0x40
2173 #define _SSPCON3_ACKTIM 0x80
2175 //==============================================================================
2178 //==============================================================================
2179 // IOCAP Bits
2181 extern __at(0x0391) __sfr IOCAP;
2183 typedef struct
2185 unsigned IOCAP0 : 1;
2186 unsigned IOCAP1 : 1;
2187 unsigned : 1;
2188 unsigned IOCAP3 : 1;
2189 unsigned IOCAP4 : 1;
2190 unsigned IOCAP5 : 1;
2191 unsigned : 1;
2192 unsigned : 1;
2193 } __IOCAPbits_t;
2195 extern __at(0x0391) volatile __IOCAPbits_t IOCAPbits;
2197 #define _IOCAP0 0x01
2198 #define _IOCAP1 0x02
2199 #define _IOCAP3 0x08
2200 #define _IOCAP4 0x10
2201 #define _IOCAP5 0x20
2203 //==============================================================================
2206 //==============================================================================
2207 // IOCAN Bits
2209 extern __at(0x0392) __sfr IOCAN;
2211 typedef struct
2213 unsigned IOCAN0 : 1;
2214 unsigned IOCAN1 : 1;
2215 unsigned : 1;
2216 unsigned IOCAN3 : 1;
2217 unsigned IOCAN4 : 1;
2218 unsigned IOCAN5 : 1;
2219 unsigned : 1;
2220 unsigned : 1;
2221 } __IOCANbits_t;
2223 extern __at(0x0392) volatile __IOCANbits_t IOCANbits;
2225 #define _IOCAN0 0x01
2226 #define _IOCAN1 0x02
2227 #define _IOCAN3 0x08
2228 #define _IOCAN4 0x10
2229 #define _IOCAN5 0x20
2231 //==============================================================================
2234 //==============================================================================
2235 // IOCAF Bits
2237 extern __at(0x0393) __sfr IOCAF;
2239 typedef struct
2241 unsigned IOCAF0 : 1;
2242 unsigned IOCAF1 : 1;
2243 unsigned : 1;
2244 unsigned IOCAF3 : 1;
2245 unsigned IOCAF4 : 1;
2246 unsigned IOCAF5 : 1;
2247 unsigned : 1;
2248 unsigned : 1;
2249 } __IOCAFbits_t;
2251 extern __at(0x0393) volatile __IOCAFbits_t IOCAFbits;
2253 #define _IOCAF0 0x01
2254 #define _IOCAF1 0x02
2255 #define _IOCAF3 0x08
2256 #define _IOCAF4 0x10
2257 #define _IOCAF5 0x20
2259 //==============================================================================
2262 //==============================================================================
2263 // IOCBP Bits
2265 extern __at(0x0394) __sfr IOCBP;
2267 typedef struct
2269 unsigned : 1;
2270 unsigned : 1;
2271 unsigned : 1;
2272 unsigned : 1;
2273 unsigned IOCBP4 : 1;
2274 unsigned IOCBP5 : 1;
2275 unsigned IOCBP6 : 1;
2276 unsigned IOCBP7 : 1;
2277 } __IOCBPbits_t;
2279 extern __at(0x0394) volatile __IOCBPbits_t IOCBPbits;
2281 #define _IOCBP4 0x10
2282 #define _IOCBP5 0x20
2283 #define _IOCBP6 0x40
2284 #define _IOCBP7 0x80
2286 //==============================================================================
2289 //==============================================================================
2290 // IOCBN Bits
2292 extern __at(0x0395) __sfr IOCBN;
2294 typedef struct
2296 unsigned : 1;
2297 unsigned : 1;
2298 unsigned : 1;
2299 unsigned : 1;
2300 unsigned IOCBN4 : 1;
2301 unsigned IOCBN5 : 1;
2302 unsigned IOCBN6 : 1;
2303 unsigned IOCBN7 : 1;
2304 } __IOCBNbits_t;
2306 extern __at(0x0395) volatile __IOCBNbits_t IOCBNbits;
2308 #define _IOCBN4 0x10
2309 #define _IOCBN5 0x20
2310 #define _IOCBN6 0x40
2311 #define _IOCBN7 0x80
2313 //==============================================================================
2316 //==============================================================================
2317 // IOCBF Bits
2319 extern __at(0x0396) __sfr IOCBF;
2321 typedef struct
2323 unsigned : 1;
2324 unsigned : 1;
2325 unsigned : 1;
2326 unsigned : 1;
2327 unsigned IOCBF4 : 1;
2328 unsigned IOCBF5 : 1;
2329 unsigned IOCBF6 : 1;
2330 unsigned IOCBF7 : 1;
2331 } __IOCBFbits_t;
2333 extern __at(0x0396) volatile __IOCBFbits_t IOCBFbits;
2335 #define _IOCBF4 0x10
2336 #define _IOCBF5 0x20
2337 #define _IOCBF6 0x40
2338 #define _IOCBF7 0x80
2340 //==============================================================================
2343 //==============================================================================
2344 // CLKRCON Bits
2346 extern __at(0x039A) __sfr CLKRCON;
2348 typedef union
2350 struct
2352 unsigned CLKRDIV0 : 1;
2353 unsigned CLKRDIV1 : 1;
2354 unsigned CLKRDIV2 : 1;
2355 unsigned CLKRCD0 : 1;
2356 unsigned CLKRCD1 : 1;
2357 unsigned CLKRSLR : 1;
2358 unsigned CLKROE : 1;
2359 unsigned CLKREN : 1;
2362 struct
2364 unsigned CLKRDIV : 3;
2365 unsigned : 5;
2368 struct
2370 unsigned : 3;
2371 unsigned CLKRCD : 2;
2372 unsigned : 3;
2374 } __CLKRCONbits_t;
2376 extern __at(0x039A) volatile __CLKRCONbits_t CLKRCONbits;
2378 #define _CLKRDIV0 0x01
2379 #define _CLKRDIV1 0x02
2380 #define _CLKRDIV2 0x04
2381 #define _CLKRCD0 0x08
2382 #define _CLKRCD1 0x10
2383 #define _CLKRSLR 0x20
2384 #define _CLKROE 0x40
2385 #define _CLKREN 0x80
2387 //==============================================================================
2390 //==============================================================================
2391 // ACTCON Bits
2393 extern __at(0x039B) __sfr ACTCON;
2395 typedef struct
2397 unsigned : 1;
2398 unsigned ACTORS : 1;
2399 unsigned : 1;
2400 unsigned ACTLOCK : 1;
2401 unsigned ACTSRC : 1;
2402 unsigned : 1;
2403 unsigned ACTUD : 1;
2404 unsigned ACTEN : 1;
2405 } __ACTCONbits_t;
2407 extern __at(0x039B) volatile __ACTCONbits_t ACTCONbits;
2409 #define _ACTORS 0x02
2410 #define _ACTLOCK 0x08
2411 #define _ACTSRC 0x10
2412 #define _ACTUD 0x40
2413 #define _ACTEN 0x80
2415 //==============================================================================
2418 //==============================================================================
2419 // PWM1DCL Bits
2421 extern __at(0x0611) __sfr PWM1DCL;
2423 typedef union
2425 struct
2427 unsigned : 1;
2428 unsigned : 1;
2429 unsigned : 1;
2430 unsigned : 1;
2431 unsigned : 1;
2432 unsigned : 1;
2433 unsigned PWM1DCL0 : 1;
2434 unsigned PWM1DCL1 : 1;
2437 struct
2439 unsigned : 6;
2440 unsigned PWM1DCL : 2;
2442 } __PWM1DCLbits_t;
2444 extern __at(0x0611) volatile __PWM1DCLbits_t PWM1DCLbits;
2446 #define _PWM1DCL0 0x40
2447 #define _PWM1DCL1 0x80
2449 //==============================================================================
2452 //==============================================================================
2453 // PWM1DCH Bits
2455 extern __at(0x0612) __sfr PWM1DCH;
2457 typedef struct
2459 unsigned PWM1DCH0 : 1;
2460 unsigned PWM1DCH1 : 1;
2461 unsigned PWM1DCH2 : 1;
2462 unsigned PWM1DCH3 : 1;
2463 unsigned PWM1DCH4 : 1;
2464 unsigned PWM1DCH5 : 1;
2465 unsigned PWM1DCH6 : 1;
2466 unsigned PWM1DCH7 : 1;
2467 } __PWM1DCHbits_t;
2469 extern __at(0x0612) volatile __PWM1DCHbits_t PWM1DCHbits;
2471 #define _PWM1DCH0 0x01
2472 #define _PWM1DCH1 0x02
2473 #define _PWM1DCH2 0x04
2474 #define _PWM1DCH3 0x08
2475 #define _PWM1DCH4 0x10
2476 #define _PWM1DCH5 0x20
2477 #define _PWM1DCH6 0x40
2478 #define _PWM1DCH7 0x80
2480 //==============================================================================
2483 //==============================================================================
2484 // PWM1CON Bits
2486 extern __at(0x0613) __sfr PWM1CON;
2488 typedef struct
2490 unsigned : 1;
2491 unsigned : 1;
2492 unsigned : 1;
2493 unsigned : 1;
2494 unsigned PWM1POL : 1;
2495 unsigned PWM1OUT : 1;
2496 unsigned PWM1OE : 1;
2497 unsigned PWM1EN : 1;
2498 } __PWM1CONbits_t;
2500 extern __at(0x0613) volatile __PWM1CONbits_t PWM1CONbits;
2502 #define _PWM1POL 0x10
2503 #define _PWM1OUT 0x20
2504 #define _PWM1OE 0x40
2505 #define _PWM1EN 0x80
2507 //==============================================================================
2510 //==============================================================================
2511 // PWM1CON0 Bits
2513 extern __at(0x0613) __sfr PWM1CON0;
2515 typedef struct
2517 unsigned : 1;
2518 unsigned : 1;
2519 unsigned : 1;
2520 unsigned : 1;
2521 unsigned PWM1POL : 1;
2522 unsigned PWM1OUT : 1;
2523 unsigned PWM1OE : 1;
2524 unsigned PWM1EN : 1;
2525 } __PWM1CON0bits_t;
2527 extern __at(0x0613) volatile __PWM1CON0bits_t PWM1CON0bits;
2529 #define _PWM1CON0_PWM1POL 0x10
2530 #define _PWM1CON0_PWM1OUT 0x20
2531 #define _PWM1CON0_PWM1OE 0x40
2532 #define _PWM1CON0_PWM1EN 0x80
2534 //==============================================================================
2537 //==============================================================================
2538 // PWM2DCL Bits
2540 extern __at(0x0614) __sfr PWM2DCL;
2542 typedef union
2544 struct
2546 unsigned : 1;
2547 unsigned : 1;
2548 unsigned : 1;
2549 unsigned : 1;
2550 unsigned : 1;
2551 unsigned : 1;
2552 unsigned PWM2DCL0 : 1;
2553 unsigned PWM2DCL1 : 1;
2556 struct
2558 unsigned : 6;
2559 unsigned PWM2DCL : 2;
2561 } __PWM2DCLbits_t;
2563 extern __at(0x0614) volatile __PWM2DCLbits_t PWM2DCLbits;
2565 #define _PWM2DCL0 0x40
2566 #define _PWM2DCL1 0x80
2568 //==============================================================================
2571 //==============================================================================
2572 // PWM2DCH Bits
2574 extern __at(0x0615) __sfr PWM2DCH;
2576 typedef struct
2578 unsigned PWM2DCH0 : 1;
2579 unsigned PWM2DCH1 : 1;
2580 unsigned PWM2DCH2 : 1;
2581 unsigned PWM2DCH3 : 1;
2582 unsigned PWM2DCH4 : 1;
2583 unsigned PWM2DCH5 : 1;
2584 unsigned PWM2DCH6 : 1;
2585 unsigned PWM2DCH7 : 1;
2586 } __PWM2DCHbits_t;
2588 extern __at(0x0615) volatile __PWM2DCHbits_t PWM2DCHbits;
2590 #define _PWM2DCH0 0x01
2591 #define _PWM2DCH1 0x02
2592 #define _PWM2DCH2 0x04
2593 #define _PWM2DCH3 0x08
2594 #define _PWM2DCH4 0x10
2595 #define _PWM2DCH5 0x20
2596 #define _PWM2DCH6 0x40
2597 #define _PWM2DCH7 0x80
2599 //==============================================================================
2602 //==============================================================================
2603 // PWM2CON Bits
2605 extern __at(0x0616) __sfr PWM2CON;
2607 typedef struct
2609 unsigned : 1;
2610 unsigned : 1;
2611 unsigned : 1;
2612 unsigned : 1;
2613 unsigned PWM2POL : 1;
2614 unsigned PWM2OUT : 1;
2615 unsigned PWM2OE : 1;
2616 unsigned PWM2EN : 1;
2617 } __PWM2CONbits_t;
2619 extern __at(0x0616) volatile __PWM2CONbits_t PWM2CONbits;
2621 #define _PWM2POL 0x10
2622 #define _PWM2OUT 0x20
2623 #define _PWM2OE 0x40
2624 #define _PWM2EN 0x80
2626 //==============================================================================
2629 //==============================================================================
2630 // PWM2CON0 Bits
2632 extern __at(0x0616) __sfr PWM2CON0;
2634 typedef struct
2636 unsigned : 1;
2637 unsigned : 1;
2638 unsigned : 1;
2639 unsigned : 1;
2640 unsigned PWM2POL : 1;
2641 unsigned PWM2OUT : 1;
2642 unsigned PWM2OE : 1;
2643 unsigned PWM2EN : 1;
2644 } __PWM2CON0bits_t;
2646 extern __at(0x0616) volatile __PWM2CON0bits_t PWM2CON0bits;
2648 #define _PWM2CON0_PWM2POL 0x10
2649 #define _PWM2CON0_PWM2OUT 0x20
2650 #define _PWM2CON0_PWM2OE 0x40
2651 #define _PWM2CON0_PWM2EN 0x80
2653 //==============================================================================
2656 //==============================================================================
2657 // CWG1DBR Bits
2659 extern __at(0x0691) __sfr CWG1DBR;
2661 typedef union
2663 struct
2665 unsigned CWG1DBR0 : 1;
2666 unsigned CWG1DBR1 : 1;
2667 unsigned CWG1DBR2 : 1;
2668 unsigned CWG1DBR3 : 1;
2669 unsigned CWG1DBR4 : 1;
2670 unsigned CWG1DBR5 : 1;
2671 unsigned : 1;
2672 unsigned : 1;
2675 struct
2677 unsigned CWG1DBR : 6;
2678 unsigned : 2;
2680 } __CWG1DBRbits_t;
2682 extern __at(0x0691) volatile __CWG1DBRbits_t CWG1DBRbits;
2684 #define _CWG1DBR0 0x01
2685 #define _CWG1DBR1 0x02
2686 #define _CWG1DBR2 0x04
2687 #define _CWG1DBR3 0x08
2688 #define _CWG1DBR4 0x10
2689 #define _CWG1DBR5 0x20
2691 //==============================================================================
2694 //==============================================================================
2695 // CWG1DBF Bits
2697 extern __at(0x0692) __sfr CWG1DBF;
2699 typedef union
2701 struct
2703 unsigned CWG1DBF0 : 1;
2704 unsigned CWG1DBF1 : 1;
2705 unsigned CWG1DBF2 : 1;
2706 unsigned CWG1DBF3 : 1;
2707 unsigned CWG1DBF4 : 1;
2708 unsigned CWG1DBF5 : 1;
2709 unsigned : 1;
2710 unsigned : 1;
2713 struct
2715 unsigned CWG1DBF : 6;
2716 unsigned : 2;
2718 } __CWG1DBFbits_t;
2720 extern __at(0x0692) volatile __CWG1DBFbits_t CWG1DBFbits;
2722 #define _CWG1DBF0 0x01
2723 #define _CWG1DBF1 0x02
2724 #define _CWG1DBF2 0x04
2725 #define _CWG1DBF3 0x08
2726 #define _CWG1DBF4 0x10
2727 #define _CWG1DBF5 0x20
2729 //==============================================================================
2732 //==============================================================================
2733 // CWG1CON0 Bits
2735 extern __at(0x0693) __sfr CWG1CON0;
2737 typedef struct
2739 unsigned G1CS0 : 1;
2740 unsigned : 1;
2741 unsigned : 1;
2742 unsigned G1POLA : 1;
2743 unsigned G1POLB : 1;
2744 unsigned G1OEA : 1;
2745 unsigned G1OEB : 1;
2746 unsigned G1EN : 1;
2747 } __CWG1CON0bits_t;
2749 extern __at(0x0693) volatile __CWG1CON0bits_t CWG1CON0bits;
2751 #define _G1CS0 0x01
2752 #define _G1POLA 0x08
2753 #define _G1POLB 0x10
2754 #define _G1OEA 0x20
2755 #define _G1OEB 0x40
2756 #define _G1EN 0x80
2758 //==============================================================================
2761 //==============================================================================
2762 // CWG1CON1 Bits
2764 extern __at(0x0694) __sfr CWG1CON1;
2766 typedef union
2768 struct
2770 unsigned G1IS0 : 1;
2771 unsigned G1IS1 : 1;
2772 unsigned : 1;
2773 unsigned : 1;
2774 unsigned G1ASDLA0 : 1;
2775 unsigned G1ASDLA1 : 1;
2776 unsigned G1ASDLB0 : 1;
2777 unsigned G1ASDLB1 : 1;
2780 struct
2782 unsigned G1IS : 2;
2783 unsigned : 6;
2786 struct
2788 unsigned : 4;
2789 unsigned G1ASDLA : 2;
2790 unsigned : 2;
2793 struct
2795 unsigned : 6;
2796 unsigned G1ASDLB : 2;
2798 } __CWG1CON1bits_t;
2800 extern __at(0x0694) volatile __CWG1CON1bits_t CWG1CON1bits;
2802 #define _G1IS0 0x01
2803 #define _G1IS1 0x02
2804 #define _G1ASDLA0 0x10
2805 #define _G1ASDLA1 0x20
2806 #define _G1ASDLB0 0x40
2807 #define _G1ASDLB1 0x80
2809 //==============================================================================
2812 //==============================================================================
2813 // CWG1CON2 Bits
2815 extern __at(0x0695) __sfr CWG1CON2;
2817 typedef struct
2819 unsigned : 1;
2820 unsigned G1ASDSFLT : 1;
2821 unsigned G1ASDSC1 : 1;
2822 unsigned G1ASDSC2 : 1;
2823 unsigned : 1;
2824 unsigned : 1;
2825 unsigned G1ARSEN : 1;
2826 unsigned G1ASE : 1;
2827 } __CWG1CON2bits_t;
2829 extern __at(0x0695) volatile __CWG1CON2bits_t CWG1CON2bits;
2831 #define _G1ASDSFLT 0x02
2832 #define _G1ASDSC1 0x04
2833 #define _G1ASDSC2 0x08
2834 #define _G1ARSEN 0x40
2835 #define _G1ASE 0x80
2837 //==============================================================================
2840 //==============================================================================
2841 // UCON Bits
2843 extern __at(0x0E8E) __sfr UCON;
2845 typedef struct
2847 unsigned : 1;
2848 unsigned SUSPND : 1;
2849 unsigned RESUME : 1;
2850 unsigned USBEN : 1;
2851 unsigned PKTDIS : 1;
2852 unsigned SE0 : 1;
2853 unsigned PPBRST : 1;
2854 unsigned : 1;
2855 } __UCONbits_t;
2857 extern __at(0x0E8E) volatile __UCONbits_t UCONbits;
2859 #define _SUSPND 0x02
2860 #define _RESUME 0x04
2861 #define _USBEN 0x08
2862 #define _PKTDIS 0x10
2863 #define _SE0 0x20
2864 #define _PPBRST 0x40
2866 //==============================================================================
2869 //==============================================================================
2870 // USTAT Bits
2872 extern __at(0x0E8F) __sfr USTAT;
2874 typedef union
2876 struct
2878 unsigned : 1;
2879 unsigned PPBI : 1;
2880 unsigned DIR : 1;
2881 unsigned ENDP0 : 1;
2882 unsigned ENDP1 : 1;
2883 unsigned ENDP2 : 1;
2884 unsigned ENDP3 : 1;
2885 unsigned : 1;
2888 struct
2890 unsigned : 3;
2891 unsigned ENDP : 4;
2892 unsigned : 1;
2894 } __USTATbits_t;
2896 extern __at(0x0E8F) volatile __USTATbits_t USTATbits;
2898 #define _PPBI 0x02
2899 #define _DIR 0x04
2900 #define _ENDP0 0x08
2901 #define _ENDP1 0x10
2902 #define _ENDP2 0x20
2903 #define _ENDP3 0x40
2905 //==============================================================================
2908 //==============================================================================
2909 // UIR Bits
2911 extern __at(0x0E90) __sfr UIR;
2913 typedef struct
2915 unsigned URSTIF : 1;
2916 unsigned UERRIF : 1;
2917 unsigned ACTVIF : 1;
2918 unsigned TRNIF : 1;
2919 unsigned IDLEIF : 1;
2920 unsigned STALLIF : 1;
2921 unsigned SOFIF : 1;
2922 unsigned : 1;
2923 } __UIRbits_t;
2925 extern __at(0x0E90) volatile __UIRbits_t UIRbits;
2927 #define _URSTIF 0x01
2928 #define _UERRIF 0x02
2929 #define _ACTVIF 0x04
2930 #define _TRNIF 0x08
2931 #define _IDLEIF 0x10
2932 #define _STALLIF 0x20
2933 #define _SOFIF 0x40
2935 //==============================================================================
2938 //==============================================================================
2939 // UCFG Bits
2941 extern __at(0x0E91) __sfr UCFG;
2943 typedef union
2945 struct
2947 unsigned PPB0 : 1;
2948 unsigned PPB1 : 1;
2949 unsigned FSEN : 1;
2950 unsigned : 1;
2951 unsigned UPUEN : 1;
2952 unsigned : 1;
2953 unsigned : 1;
2954 unsigned UTEYE : 1;
2957 struct
2959 unsigned PPB : 2;
2960 unsigned : 6;
2962 } __UCFGbits_t;
2964 extern __at(0x0E91) volatile __UCFGbits_t UCFGbits;
2966 #define _PPB0 0x01
2967 #define _PPB1 0x02
2968 #define _FSEN 0x04
2969 #define _UPUEN 0x10
2970 #define _UTEYE 0x80
2972 //==============================================================================
2975 //==============================================================================
2976 // UIE Bits
2978 extern __at(0x0E92) __sfr UIE;
2980 typedef struct
2982 unsigned URSTIE : 1;
2983 unsigned UERRIE : 1;
2984 unsigned ACTVIE : 1;
2985 unsigned TRNIE : 1;
2986 unsigned IDLEIE : 1;
2987 unsigned STALLIE : 1;
2988 unsigned SOFIE : 1;
2989 unsigned : 1;
2990 } __UIEbits_t;
2992 extern __at(0x0E92) volatile __UIEbits_t UIEbits;
2994 #define _URSTIE 0x01
2995 #define _UERRIE 0x02
2996 #define _ACTVIE 0x04
2997 #define _TRNIE 0x08
2998 #define _IDLEIE 0x10
2999 #define _STALLIE 0x20
3000 #define _SOFIE 0x40
3002 //==============================================================================
3005 //==============================================================================
3006 // UEIR Bits
3008 extern __at(0x0E93) __sfr UEIR;
3010 typedef struct
3012 unsigned PIDEF : 1;
3013 unsigned CRC5EF : 1;
3014 unsigned CRC16EF : 1;
3015 unsigned DFN8EF : 1;
3016 unsigned BTOEF : 1;
3017 unsigned : 1;
3018 unsigned : 1;
3019 unsigned BTSEF : 1;
3020 } __UEIRbits_t;
3022 extern __at(0x0E93) volatile __UEIRbits_t UEIRbits;
3024 #define _PIDEF 0x01
3025 #define _CRC5EF 0x02
3026 #define _CRC16EF 0x04
3027 #define _DFN8EF 0x08
3028 #define _BTOEF 0x10
3029 #define _BTSEF 0x80
3031 //==============================================================================
3033 extern __at(0x0E94) __sfr UFRM;
3035 //==============================================================================
3036 // UFRMH Bits
3038 extern __at(0x0E94) __sfr UFRMH;
3040 typedef struct
3042 unsigned FRM8 : 1;
3043 unsigned FRM9 : 1;
3044 unsigned FRM10 : 1;
3045 unsigned : 1;
3046 unsigned : 1;
3047 unsigned : 1;
3048 unsigned : 1;
3049 unsigned : 1;
3050 } __UFRMHbits_t;
3052 extern __at(0x0E94) volatile __UFRMHbits_t UFRMHbits;
3054 #define _FRM8 0x01
3055 #define _FRM9 0x02
3056 #define _FRM10 0x04
3058 //==============================================================================
3061 //==============================================================================
3062 // UFRML Bits
3064 extern __at(0x0E95) __sfr UFRML;
3066 typedef struct
3068 unsigned FRM0 : 1;
3069 unsigned FRM1 : 1;
3070 unsigned FRM2 : 1;
3071 unsigned FRM3 : 1;
3072 unsigned FRM4 : 1;
3073 unsigned FRM5 : 1;
3074 unsigned FRM6 : 1;
3075 unsigned FRM7 : 1;
3076 } __UFRMLbits_t;
3078 extern __at(0x0E95) volatile __UFRMLbits_t UFRMLbits;
3080 #define _FRM0 0x01
3081 #define _FRM1 0x02
3082 #define _FRM2 0x04
3083 #define _FRM3 0x08
3084 #define _FRM4 0x10
3085 #define _FRM5 0x20
3086 #define _FRM6 0x40
3087 #define _FRM7 0x80
3089 //==============================================================================
3092 //==============================================================================
3093 // UADDR Bits
3095 extern __at(0x0E96) __sfr UADDR;
3097 typedef union
3099 struct
3101 unsigned ADDR0 : 1;
3102 unsigned ADDR1 : 1;
3103 unsigned ADDR2 : 1;
3104 unsigned ADDR3 : 1;
3105 unsigned ADDR4 : 1;
3106 unsigned ADDR5 : 1;
3107 unsigned ADDR6 : 1;
3108 unsigned : 1;
3111 struct
3113 unsigned ADDR : 7;
3114 unsigned : 1;
3116 } __UADDRbits_t;
3118 extern __at(0x0E96) volatile __UADDRbits_t UADDRbits;
3120 #define _ADDR0 0x01
3121 #define _ADDR1 0x02
3122 #define _ADDR2 0x04
3123 #define _ADDR3 0x08
3124 #define _ADDR4 0x10
3125 #define _ADDR5 0x20
3126 #define _ADDR6 0x40
3128 //==============================================================================
3131 //==============================================================================
3132 // UEIE Bits
3134 extern __at(0x0E97) __sfr UEIE;
3136 typedef struct
3138 unsigned PIDEE : 1;
3139 unsigned CRC5EE : 1;
3140 unsigned CRC16EE : 1;
3141 unsigned DFN8EE : 1;
3142 unsigned BTOEE : 1;
3143 unsigned : 1;
3144 unsigned : 1;
3145 unsigned BTSEE : 1;
3146 } __UEIEbits_t;
3148 extern __at(0x0E97) volatile __UEIEbits_t UEIEbits;
3150 #define _PIDEE 0x01
3151 #define _CRC5EE 0x02
3152 #define _CRC16EE 0x04
3153 #define _DFN8EE 0x08
3154 #define _BTOEE 0x10
3155 #define _BTSEE 0x80
3157 //==============================================================================
3160 //==============================================================================
3161 // UEP0 Bits
3163 extern __at(0x0E98) __sfr UEP0;
3165 typedef struct
3167 unsigned EPSTALL : 1;
3168 unsigned EPINEN : 1;
3169 unsigned EPOUTEN : 1;
3170 unsigned EPCONDIS : 1;
3171 unsigned EPHSHK : 1;
3172 unsigned : 1;
3173 unsigned : 1;
3174 unsigned : 1;
3175 } __UEP0bits_t;
3177 extern __at(0x0E98) volatile __UEP0bits_t UEP0bits;
3179 #define _EPSTALL 0x01
3180 #define _EPINEN 0x02
3181 #define _EPOUTEN 0x04
3182 #define _EPCONDIS 0x08
3183 #define _EPHSHK 0x10
3185 //==============================================================================
3188 //==============================================================================
3189 // UEP1 Bits
3191 extern __at(0x0E99) __sfr UEP1;
3193 typedef struct
3195 unsigned EPSTALL : 1;
3196 unsigned EPINEN : 1;
3197 unsigned EPOUTEN : 1;
3198 unsigned EPCONDIS : 1;
3199 unsigned EPHSHK : 1;
3200 unsigned : 1;
3201 unsigned : 1;
3202 unsigned : 1;
3203 } __UEP1bits_t;
3205 extern __at(0x0E99) volatile __UEP1bits_t UEP1bits;
3207 #define _UEP1_EPSTALL 0x01
3208 #define _UEP1_EPINEN 0x02
3209 #define _UEP1_EPOUTEN 0x04
3210 #define _UEP1_EPCONDIS 0x08
3211 #define _UEP1_EPHSHK 0x10
3213 //==============================================================================
3216 //==============================================================================
3217 // UEP2 Bits
3219 extern __at(0x0E9A) __sfr UEP2;
3221 typedef struct
3223 unsigned EPSTALL : 1;
3224 unsigned EPINEN : 1;
3225 unsigned EPOUTEN : 1;
3226 unsigned EPCONDIS : 1;
3227 unsigned EPHSHK : 1;
3228 unsigned : 1;
3229 unsigned : 1;
3230 unsigned : 1;
3231 } __UEP2bits_t;
3233 extern __at(0x0E9A) volatile __UEP2bits_t UEP2bits;
3235 #define _UEP2_EPSTALL 0x01
3236 #define _UEP2_EPINEN 0x02
3237 #define _UEP2_EPOUTEN 0x04
3238 #define _UEP2_EPCONDIS 0x08
3239 #define _UEP2_EPHSHK 0x10
3241 //==============================================================================
3244 //==============================================================================
3245 // UEP3 Bits
3247 extern __at(0x0E9B) __sfr UEP3;
3249 typedef struct
3251 unsigned EPSTALL : 1;
3252 unsigned EPINEN : 1;
3253 unsigned EPOUTEN : 1;
3254 unsigned EPCONDIS : 1;
3255 unsigned EPHSHK : 1;
3256 unsigned : 1;
3257 unsigned : 1;
3258 unsigned : 1;
3259 } __UEP3bits_t;
3261 extern __at(0x0E9B) volatile __UEP3bits_t UEP3bits;
3263 #define _UEP3_EPSTALL 0x01
3264 #define _UEP3_EPINEN 0x02
3265 #define _UEP3_EPOUTEN 0x04
3266 #define _UEP3_EPCONDIS 0x08
3267 #define _UEP3_EPHSHK 0x10
3269 //==============================================================================
3272 //==============================================================================
3273 // UEP4 Bits
3275 extern __at(0x0E9C) __sfr UEP4;
3277 typedef struct
3279 unsigned EPSTALL : 1;
3280 unsigned EPINEN : 1;
3281 unsigned EPOUTEN : 1;
3282 unsigned EPCONDIS : 1;
3283 unsigned EPHSHK : 1;
3284 unsigned : 1;
3285 unsigned : 1;
3286 unsigned : 1;
3287 } __UEP4bits_t;
3289 extern __at(0x0E9C) volatile __UEP4bits_t UEP4bits;
3291 #define _UEP4_EPSTALL 0x01
3292 #define _UEP4_EPINEN 0x02
3293 #define _UEP4_EPOUTEN 0x04
3294 #define _UEP4_EPCONDIS 0x08
3295 #define _UEP4_EPHSHK 0x10
3297 //==============================================================================
3300 //==============================================================================
3301 // UEP5 Bits
3303 extern __at(0x0E9D) __sfr UEP5;
3305 typedef struct
3307 unsigned EPSTALL : 1;
3308 unsigned EPINEN : 1;
3309 unsigned EPOUTEN : 1;
3310 unsigned EPCONDIS : 1;
3311 unsigned EPHSHK : 1;
3312 unsigned : 1;
3313 unsigned : 1;
3314 unsigned : 1;
3315 } __UEP5bits_t;
3317 extern __at(0x0E9D) volatile __UEP5bits_t UEP5bits;
3319 #define _UEP5_EPSTALL 0x01
3320 #define _UEP5_EPINEN 0x02
3321 #define _UEP5_EPOUTEN 0x04
3322 #define _UEP5_EPCONDIS 0x08
3323 #define _UEP5_EPHSHK 0x10
3325 //==============================================================================
3328 //==============================================================================
3329 // UEP6 Bits
3331 extern __at(0x0E9E) __sfr UEP6;
3333 typedef struct
3335 unsigned EPSTALL : 1;
3336 unsigned EPINEN : 1;
3337 unsigned EPOUTEN : 1;
3338 unsigned EPCONDIS : 1;
3339 unsigned EPHSHK : 1;
3340 unsigned : 1;
3341 unsigned : 1;
3342 unsigned : 1;
3343 } __UEP6bits_t;
3345 extern __at(0x0E9E) volatile __UEP6bits_t UEP6bits;
3347 #define _UEP6_EPSTALL 0x01
3348 #define _UEP6_EPINEN 0x02
3349 #define _UEP6_EPOUTEN 0x04
3350 #define _UEP6_EPCONDIS 0x08
3351 #define _UEP6_EPHSHK 0x10
3353 //==============================================================================
3356 //==============================================================================
3357 // UEP7 Bits
3359 extern __at(0x0E9F) __sfr UEP7;
3361 typedef struct
3363 unsigned EPSTALL : 1;
3364 unsigned EPINEN : 1;
3365 unsigned EPOUTEN : 1;
3366 unsigned EPCONDIS : 1;
3367 unsigned EPHSHK : 1;
3368 unsigned : 1;
3369 unsigned : 1;
3370 unsigned : 1;
3371 } __UEP7bits_t;
3373 extern __at(0x0E9F) volatile __UEP7bits_t UEP7bits;
3375 #define _UEP7_EPSTALL 0x01
3376 #define _UEP7_EPINEN 0x02
3377 #define _UEP7_EPOUTEN 0x04
3378 #define _UEP7_EPCONDIS 0x08
3379 #define _UEP7_EPHSHK 0x10
3381 //==============================================================================
3384 //==============================================================================
3385 // STATUS_SHAD Bits
3387 extern __at(0x0FE4) __sfr STATUS_SHAD;
3389 typedef struct
3391 unsigned C : 1;
3392 unsigned DC : 1;
3393 unsigned Z : 1;
3394 unsigned : 1;
3395 unsigned : 1;
3396 unsigned : 1;
3397 unsigned : 1;
3398 unsigned : 1;
3399 } __STATUS_SHADbits_t;
3401 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits;
3403 #define _STATUS_SHAD_C 0x01
3404 #define _STATUS_SHAD_DC 0x02
3405 #define _STATUS_SHAD_Z 0x04
3407 //==============================================================================
3409 extern __at(0x0FE5) __sfr WREG_SHAD;
3410 extern __at(0x0FE6) __sfr BSR_SHAD;
3411 extern __at(0x0FE7) __sfr PCLATH_SHAD;
3412 extern __at(0x0FE8) __sfr FSR0L_SHAD;
3413 extern __at(0x0FE9) __sfr FSR0H_SHAD;
3414 extern __at(0x0FEA) __sfr FSR1L_SHAD;
3415 extern __at(0x0FEB) __sfr FSR1H_SHAD;
3416 extern __at(0x0FED) __sfr STKPTR;
3417 extern __at(0x0FEE) __sfr TOSL;
3418 extern __at(0x0FEF) __sfr TOSH;
3420 //==============================================================================
3422 // Configuration Bits
3424 //==============================================================================
3426 #define _CONFIG1 0x8007
3427 #define _CONFIG2 0x8008
3429 //----------------------------- CONFIG1 Options -------------------------------
3431 #define _FOSC_LP 0x3FF8 // LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins.
3432 #define _FOSC_XT 0x3FF9 // XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins.
3433 #define _FOSC_HS 0x3FFA // HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins.
3434 #define _FOSC_EXTRC 0x3FFB // EXTRC oscillator: External RC circuit connected to CLKIN pin.
3435 #define _FOSC_INTOSC 0x3FFC // INTOSC oscillator: I/O function on CLKIN pin.
3436 #define _FOSC_ECL 0x3FFD // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pins.
3437 #define _FOSC_ECM 0x3FFE // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pins.
3438 #define _FOSC_ECH 0x3FFF // ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pins.
3439 #define _WDTE_OFF 0x3FE7 // WDT disabled.
3440 #define _WDTE_SWDTEN 0x3FEF // WDT controlled by the SWDTEN bit in the WDTCON register.
3441 #define _WDTE_NSLEEP 0x3FF7 // WDT enabled while running and disabled in Sleep.
3442 #define _WDTE_ON 0x3FFF // WDT enabled.
3443 #define _PWRTE_ON 0x3FDF // PWRT enabled.
3444 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
3445 #define _MCLRE_OFF 0x3FBF // MCLR/VPP pin function is digital input.
3446 #define _MCLRE_ON 0x3FFF // MCLR/VPP pin function is MCLR.
3447 #define _CP_ON 0x3F7F // Program memory code protection is enabled.
3448 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
3449 #define _BOREN_OFF 0x39FF // Brown-out Reset disabled.
3450 #define _BOREN_SBODEN 0x3BFF // Brown-out Reset controlled by the SBOREN bit in the BORCON register.
3451 #define _BOREN_NSLEEP 0x3DFF // Brown-out Reset enabled while running and disabled in Sleep.
3452 #define _BOREN_ON 0x3FFF // Brown-out Reset enabled.
3453 #define _CLKOUTEN_ON 0x37FF // CLKOUT function is enabled on the CLKOUT pin.
3454 #define _CLKOUTEN_OFF 0x3FFF // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin.
3455 #define _IESO_OFF 0x2FFF // Internal/External Switchover Mode is disabled.
3456 #define _IESO_ON 0x3FFF // Internal/External Switchover Mode is enabled.
3457 #define _FCMEN_OFF 0x1FFF // Fail-Safe Clock Monitor is disabled.
3458 #define _FCMEN_ON 0x3FFF // Fail-Safe Clock Monitor is enabled.
3460 //----------------------------- CONFIG2 Options -------------------------------
3462 #define _WRT_ALL 0x3FFC // 000h to 1FFFh write protected, no addresses may be modified by PMCON control.
3463 #define _WRT_HALF 0x3FFD // 000h to 0FFFh write protected, 1000h to 1FFFh may be modified by PMCON control.
3464 #define _WRT_BOOT 0x3FFE // 000h to 1FFh write protected, 200h to 1FFFh may be modified by PMCON control.
3465 #define _WRT_OFF 0x3FFF // Write protection off.
3466 #define _CPUDIV_NOCLKDIV 0x3FCF // NO CPU system divide.
3467 #define _CPUDIV_CLKDIV2 0x3FDF // CPU system clock divided by 2.
3468 #define _CPUDIV_CLKDIV3 0x3FEF // CPU system clock divided by 3.
3469 #define _CPUDIV_CLKDIV6 0x3FFF // CPU system clock divided by 6.
3470 #define _USBLSCLK_24MHz 0x3FBF // System clock expects 24 MHz, FS/LS USB CLKENs divide-by is set to 4.
3471 #define _USBLSCLK_48MHz 0x3FFF // System clock expects 48 MHz, FS/LS USB CLKENs divide-by is set to 8.
3472 #define _PLLMULT_4x 0x3F7F // 4x Output Frequency Selected.
3473 #define _PLLMULT_3x 0x3FFF // 3x Output Frequency Selected.
3474 #define _PLLEN_DISABLED 0x3EFF // 3x or 4x PLL Disabled.
3475 #define _PLLEN_ENABLED 0x3FFF // 3x or 4x PLL Enabled.
3476 #define _STVREN_OFF 0x3DFF // Stack Overflow or Underflow will not cause a Reset.
3477 #define _STVREN_ON 0x3FFF // Stack Overflow or Underflow will cause a Reset.
3478 #define _BORV_HI 0x3BFF // Brown-out Reset Voltage (Vbor), high trip point selected.
3479 #define _BORV_LO 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
3480 #define _LPBOR_ON 0x37FF // Low-Power BOR is enabled.
3481 #define _LPBOR_OFF 0x3FFF // Low-Power BOR is disabled.
3482 #define _DEBUG_ON 0x2FFF // In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger.
3483 #define _DEBUG_OFF 0x3FFF // In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins.
3484 #define _LVP_OFF 0x1FFF // High-voltage on MCLR/VPP must be used for programming.
3485 #define _LVP_ON 0x3FFF // Low-voltage programming enabled.
3487 //==============================================================================
3489 #define _DEVID1 0x8006
3491 #define _IDLOC0 0x8000
3492 #define _IDLOC1 0x8001
3493 #define _IDLOC2 0x8002
3494 #define _IDLOC3 0x8003
3496 //==============================================================================
3498 #ifndef NO_BIT_DEFINES
3500 #define ACTORS ACTCONbits.ACTORS // bit 1
3501 #define ACTLOCK ACTCONbits.ACTLOCK // bit 3
3502 #define ACTSRC ACTCONbits.ACTSRC // bit 4
3503 #define ACTUD ACTCONbits.ACTUD // bit 6
3504 #define ACTEN ACTCONbits.ACTEN // bit 7
3506 #define ADON ADCON0bits.ADON // bit 0
3507 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1, shadows bit in ADCON0bits
3508 #define ADGO ADCON0bits.ADGO // bit 1, shadows bit in ADCON0bits
3509 #define GO ADCON0bits.GO // bit 1, shadows bit in ADCON0bits
3510 #define CHS0 ADCON0bits.CHS0 // bit 2
3511 #define CHS1 ADCON0bits.CHS1 // bit 3
3512 #define CHS2 ADCON0bits.CHS2 // bit 4
3513 #define CHS3 ADCON0bits.CHS3 // bit 5
3514 #define CHS4 ADCON0bits.CHS4 // bit 6
3516 #define ADPREF0 ADCON1bits.ADPREF0 // bit 0
3517 #define ADPREF1 ADCON1bits.ADPREF1 // bit 1
3518 #define ADCS0 ADCON1bits.ADCS0 // bit 4
3519 #define ADCS1 ADCON1bits.ADCS1 // bit 5
3520 #define ADCS2 ADCON1bits.ADCS2 // bit 6
3521 #define ADFM ADCON1bits.ADFM // bit 7
3523 #define TRIGSEL0 ADCON2bits.TRIGSEL0 // bit 4
3524 #define TRIGSEL1 ADCON2bits.TRIGSEL1 // bit 5
3525 #define TRIGSEL2 ADCON2bits.TRIGSEL2 // bit 6
3527 #define ANSA4 ANSELAbits.ANSA4 // bit 4
3529 #define ANSB4 ANSELBbits.ANSB4 // bit 4
3530 #define ANSB5 ANSELBbits.ANSB5 // bit 5
3532 #define ANSC0 ANSELCbits.ANSC0 // bit 0
3533 #define ANSC1 ANSELCbits.ANSC1 // bit 1
3534 #define ANSC2 ANSELCbits.ANSC2 // bit 2
3535 #define ANSC3 ANSELCbits.ANSC3 // bit 3
3536 #define ANSC6 ANSELCbits.ANSC6 // bit 6
3537 #define ANSC7 ANSELCbits.ANSC7 // bit 7
3539 #define T1GSEL APFCONbits.T1GSEL // bit 3
3540 #define SSSEL APFCONbits.SSSEL // bit 5
3541 #define CLKRSEL APFCONbits.CLKRSEL // bit 7
3543 #define ABDEN BAUDCONbits.ABDEN // bit 0
3544 #define WUE BAUDCONbits.WUE // bit 1
3545 #define BRG16 BAUDCONbits.BRG16 // bit 3
3546 #define SCKP BAUDCONbits.SCKP // bit 4
3547 #define RCIDL BAUDCONbits.RCIDL // bit 6
3548 #define ABDOVF BAUDCONbits.ABDOVF // bit 7
3550 #define BORRDY BORCONbits.BORRDY // bit 0
3551 #define BORFS BORCONbits.BORFS // bit 6
3552 #define SBOREN BORCONbits.SBOREN // bit 7
3554 #define BSR0 BSRbits.BSR0 // bit 0
3555 #define BSR1 BSRbits.BSR1 // bit 1
3556 #define BSR2 BSRbits.BSR2 // bit 2
3557 #define BSR3 BSRbits.BSR3 // bit 3
3558 #define BSR4 BSRbits.BSR4 // bit 4
3560 #define CLKRDIV0 CLKRCONbits.CLKRDIV0 // bit 0
3561 #define CLKRDIV1 CLKRCONbits.CLKRDIV1 // bit 1
3562 #define CLKRDIV2 CLKRCONbits.CLKRDIV2 // bit 2
3563 #define CLKRCD0 CLKRCONbits.CLKRCD0 // bit 3
3564 #define CLKRCD1 CLKRCONbits.CLKRCD1 // bit 4
3565 #define CLKRSLR CLKRCONbits.CLKRSLR // bit 5
3566 #define CLKROE CLKRCONbits.CLKROE // bit 6
3567 #define CLKREN CLKRCONbits.CLKREN // bit 7
3569 #define C1SYNC CM1CON0bits.C1SYNC // bit 0
3570 #define C1HYS CM1CON0bits.C1HYS // bit 1
3571 #define C1SP CM1CON0bits.C1SP // bit 2
3572 #define C1POL CM1CON0bits.C1POL // bit 4
3573 #define C1OE CM1CON0bits.C1OE // bit 5
3574 #define C1OUT CM1CON0bits.C1OUT // bit 6
3575 #define C1ON CM1CON0bits.C1ON // bit 7
3577 #define C1NCH0 CM1CON1bits.C1NCH0 // bit 0
3578 #define C1NCH1 CM1CON1bits.C1NCH1 // bit 1
3579 #define C1NCH2 CM1CON1bits.C1NCH2 // bit 2
3580 #define C1PCH0 CM1CON1bits.C1PCH0 // bit 4
3581 #define C1PCH1 CM1CON1bits.C1PCH1 // bit 5
3582 #define C1INTN CM1CON1bits.C1INTN // bit 6
3583 #define C1INTP CM1CON1bits.C1INTP // bit 7
3585 #define C2SYNC CM2CON0bits.C2SYNC // bit 0
3586 #define C2HYS CM2CON0bits.C2HYS // bit 1
3587 #define C2SP CM2CON0bits.C2SP // bit 2
3588 #define C2POL CM2CON0bits.C2POL // bit 4
3589 #define C2OE CM2CON0bits.C2OE // bit 5
3590 #define C2OUT CM2CON0bits.C2OUT // bit 6
3591 #define C2ON CM2CON0bits.C2ON // bit 7
3593 #define C2NCH0 CM2CON1bits.C2NCH0 // bit 0
3594 #define C2NCH1 CM2CON1bits.C2NCH1 // bit 1
3595 #define C2NCH2 CM2CON1bits.C2NCH2 // bit 2
3596 #define C2PCH0 CM2CON1bits.C2PCH0 // bit 4
3597 #define C2PCH1 CM2CON1bits.C2PCH1 // bit 5
3598 #define C2INTN CM2CON1bits.C2INTN // bit 6
3599 #define C2INTP CM2CON1bits.C2INTP // bit 7
3601 #define MC1OUT CMOUTbits.MC1OUT // bit 0
3602 #define MC2OUT CMOUTbits.MC2OUT // bit 1
3604 #define G1CS0 CWG1CON0bits.G1CS0 // bit 0
3605 #define G1POLA CWG1CON0bits.G1POLA // bit 3
3606 #define G1POLB CWG1CON0bits.G1POLB // bit 4
3607 #define G1OEA CWG1CON0bits.G1OEA // bit 5
3608 #define G1OEB CWG1CON0bits.G1OEB // bit 6
3609 #define G1EN CWG1CON0bits.G1EN // bit 7
3611 #define G1IS0 CWG1CON1bits.G1IS0 // bit 0
3612 #define G1IS1 CWG1CON1bits.G1IS1 // bit 1
3613 #define G1ASDLA0 CWG1CON1bits.G1ASDLA0 // bit 4
3614 #define G1ASDLA1 CWG1CON1bits.G1ASDLA1 // bit 5
3615 #define G1ASDLB0 CWG1CON1bits.G1ASDLB0 // bit 6
3616 #define G1ASDLB1 CWG1CON1bits.G1ASDLB1 // bit 7
3618 #define G1ASDSFLT CWG1CON2bits.G1ASDSFLT // bit 1
3619 #define G1ASDSC1 CWG1CON2bits.G1ASDSC1 // bit 2
3620 #define G1ASDSC2 CWG1CON2bits.G1ASDSC2 // bit 3
3621 #define G1ARSEN CWG1CON2bits.G1ARSEN // bit 6
3622 #define G1ASE CWG1CON2bits.G1ASE // bit 7
3624 #define CWG1DBF0 CWG1DBFbits.CWG1DBF0 // bit 0
3625 #define CWG1DBF1 CWG1DBFbits.CWG1DBF1 // bit 1
3626 #define CWG1DBF2 CWG1DBFbits.CWG1DBF2 // bit 2
3627 #define CWG1DBF3 CWG1DBFbits.CWG1DBF3 // bit 3
3628 #define CWG1DBF4 CWG1DBFbits.CWG1DBF4 // bit 4
3629 #define CWG1DBF5 CWG1DBFbits.CWG1DBF5 // bit 5
3631 #define CWG1DBR0 CWG1DBRbits.CWG1DBR0 // bit 0
3632 #define CWG1DBR1 CWG1DBRbits.CWG1DBR1 // bit 1
3633 #define CWG1DBR2 CWG1DBRbits.CWG1DBR2 // bit 2
3634 #define CWG1DBR3 CWG1DBRbits.CWG1DBR3 // bit 3
3635 #define CWG1DBR4 CWG1DBRbits.CWG1DBR4 // bit 4
3636 #define CWG1DBR5 CWG1DBRbits.CWG1DBR5 // bit 5
3638 #define D1PSS0 DACCON0bits.D1PSS0 // bit 2
3639 #define D1PSS1 DACCON0bits.D1PSS1 // bit 3
3640 #define DACOE2 DACCON0bits.DACOE2 // bit 4
3641 #define DACOE1 DACCON0bits.DACOE1 // bit 5
3642 #define DACEN DACCON0bits.DACEN // bit 7
3644 #define DACR0 DACCON1bits.DACR0 // bit 0
3645 #define DACR1 DACCON1bits.DACR1 // bit 1
3646 #define DACR2 DACCON1bits.DACR2 // bit 2
3647 #define DACR3 DACCON1bits.DACR3 // bit 3
3648 #define DACR4 DACCON1bits.DACR4 // bit 4
3650 #define ADFVR0 FVRCONbits.ADFVR0 // bit 0
3651 #define ADFVR1 FVRCONbits.ADFVR1 // bit 1
3652 #define CDAFVR0 FVRCONbits.CDAFVR0 // bit 2
3653 #define CDAFVR1 FVRCONbits.CDAFVR1 // bit 3
3654 #define FVRRDY FVRCONbits.FVRRDY // bit 6
3655 #define FVREN FVRCONbits.FVREN // bit 7
3657 #define IOCIF INTCONbits.IOCIF // bit 0
3658 #define INTF INTCONbits.INTF // bit 1
3659 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
3660 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
3661 #define IOCIE INTCONbits.IOCIE // bit 3
3662 #define INTE INTCONbits.INTE // bit 4
3663 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
3664 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
3665 #define PEIE INTCONbits.PEIE // bit 6
3666 #define GIE INTCONbits.GIE // bit 7
3668 #define IOCAF0 IOCAFbits.IOCAF0 // bit 0
3669 #define IOCAF1 IOCAFbits.IOCAF1 // bit 1
3670 #define IOCAF3 IOCAFbits.IOCAF3 // bit 3
3671 #define IOCAF4 IOCAFbits.IOCAF4 // bit 4
3672 #define IOCAF5 IOCAFbits.IOCAF5 // bit 5
3674 #define IOCAN0 IOCANbits.IOCAN0 // bit 0
3675 #define IOCAN1 IOCANbits.IOCAN1 // bit 1
3676 #define IOCAN3 IOCANbits.IOCAN3 // bit 3
3677 #define IOCAN4 IOCANbits.IOCAN4 // bit 4
3678 #define IOCAN5 IOCANbits.IOCAN5 // bit 5
3680 #define IOCAP0 IOCAPbits.IOCAP0 // bit 0
3681 #define IOCAP1 IOCAPbits.IOCAP1 // bit 1
3682 #define IOCAP3 IOCAPbits.IOCAP3 // bit 3
3683 #define IOCAP4 IOCAPbits.IOCAP4 // bit 4
3684 #define IOCAP5 IOCAPbits.IOCAP5 // bit 5
3686 #define IOCBF4 IOCBFbits.IOCBF4 // bit 4
3687 #define IOCBF5 IOCBFbits.IOCBF5 // bit 5
3688 #define IOCBF6 IOCBFbits.IOCBF6 // bit 6
3689 #define IOCBF7 IOCBFbits.IOCBF7 // bit 7
3691 #define IOCBN4 IOCBNbits.IOCBN4 // bit 4
3692 #define IOCBN5 IOCBNbits.IOCBN5 // bit 5
3693 #define IOCBN6 IOCBNbits.IOCBN6 // bit 6
3694 #define IOCBN7 IOCBNbits.IOCBN7 // bit 7
3696 #define IOCBP4 IOCBPbits.IOCBP4 // bit 4
3697 #define IOCBP5 IOCBPbits.IOCBP5 // bit 5
3698 #define IOCBP6 IOCBPbits.IOCBP6 // bit 6
3699 #define IOCBP7 IOCBPbits.IOCBP7 // bit 7
3701 #define LATA4 LATAbits.LATA4 // bit 4
3702 #define LATA5 LATAbits.LATA5 // bit 5
3704 #define LATB4 LATBbits.LATB4 // bit 4
3705 #define LATB5 LATBbits.LATB5 // bit 5
3706 #define LATB6 LATBbits.LATB6 // bit 6
3707 #define LATB7 LATBbits.LATB7 // bit 7
3709 #define LATC0 LATCbits.LATC0 // bit 0
3710 #define LATC1 LATCbits.LATC1 // bit 1
3711 #define LATC2 LATCbits.LATC2 // bit 2
3712 #define LATC3 LATCbits.LATC3 // bit 3
3713 #define LATC4 LATCbits.LATC4 // bit 4
3714 #define LATC5 LATCbits.LATC5 // bit 5
3715 #define LATC6 LATCbits.LATC6 // bit 6
3716 #define LATC7 LATCbits.LATC7 // bit 7
3718 #define PS0 OPTION_REGbits.PS0 // bit 0
3719 #define PS1 OPTION_REGbits.PS1 // bit 1
3720 #define PS2 OPTION_REGbits.PS2 // bit 2
3721 #define PSA OPTION_REGbits.PSA // bit 3
3722 #define TMR0SE OPTION_REGbits.TMR0SE // bit 4, shadows bit in OPTION_REGbits
3723 #define T0SE OPTION_REGbits.T0SE // bit 4, shadows bit in OPTION_REGbits
3724 #define TMR0CS OPTION_REGbits.TMR0CS // bit 5, shadows bit in OPTION_REGbits
3725 #define T0CS OPTION_REGbits.T0CS // bit 5, shadows bit in OPTION_REGbits
3726 #define INTEDG OPTION_REGbits.INTEDG // bit 6
3727 #define NOT_WPUEN OPTION_REGbits.NOT_WPUEN // bit 7
3729 #define SCS0 OSCCONbits.SCS0 // bit 0
3730 #define SCS1 OSCCONbits.SCS1 // bit 1
3731 #define IRCF0 OSCCONbits.IRCF0 // bit 2
3732 #define IRCF1 OSCCONbits.IRCF1 // bit 3
3733 #define IRCF2 OSCCONbits.IRCF2 // bit 4
3734 #define IRCF3 OSCCONbits.IRCF3 // bit 5
3735 #define SPLLMULT OSCCONbits.SPLLMULT // bit 6
3736 #define SPLLEN OSCCONbits.SPLLEN // bit 7
3738 #define HFIOFS OSCSTATbits.HFIOFS // bit 0
3739 #define LFIOFR OSCSTATbits.LFIOFR // bit 1
3740 #define HFIOFR OSCSTATbits.HFIOFR // bit 4
3741 #define OSTS OSCSTATbits.OSTS // bit 5
3742 #define PLLRDY OSCSTATbits.PLLRDY // bit 6
3743 #define SOSCR OSCSTATbits.SOSCR // bit 7
3745 #define TUN0 OSCTUNEbits.TUN0 // bit 0
3746 #define TUN1 OSCTUNEbits.TUN1 // bit 1
3747 #define TUN2 OSCTUNEbits.TUN2 // bit 2
3748 #define TUN3 OSCTUNEbits.TUN3 // bit 3
3749 #define TUN4 OSCTUNEbits.TUN4 // bit 4
3750 #define TUN5 OSCTUNEbits.TUN5 // bit 5
3751 #define TUN6 OSCTUNEbits.TUN6 // bit 6
3753 #define NOT_BOR PCONbits.NOT_BOR // bit 0
3754 #define NOT_POR PCONbits.NOT_POR // bit 1
3755 #define NOT_RI PCONbits.NOT_RI // bit 2
3756 #define NOT_RMCLR PCONbits.NOT_RMCLR // bit 3
3757 #define NOT_RWDT PCONbits.NOT_RWDT // bit 4
3758 #define STKUNF PCONbits.STKUNF // bit 6
3759 #define STKOVF PCONbits.STKOVF // bit 7
3761 #define TMR1IE PIE1bits.TMR1IE // bit 0
3762 #define TMR2IE PIE1bits.TMR2IE // bit 1
3763 #define SSP1IE PIE1bits.SSP1IE // bit 3
3764 #define TXIE PIE1bits.TXIE // bit 4
3765 #define RCIE PIE1bits.RCIE // bit 5
3766 #define ADIE PIE1bits.ADIE // bit 6
3767 #define TMR1GIE PIE1bits.TMR1GIE // bit 7
3769 #define ACTIE PIE2bits.ACTIE // bit 1
3770 #define USBIE PIE2bits.USBIE // bit 2
3771 #define BCL1IE PIE2bits.BCL1IE // bit 3
3772 #define C1IE PIE2bits.C1IE // bit 5
3773 #define C2IE PIE2bits.C2IE // bit 6
3774 #define OSFIE PIE2bits.OSFIE // bit 7
3776 #define TMR1IF PIR1bits.TMR1IF // bit 0
3777 #define TMR2IF PIR1bits.TMR2IF // bit 1
3778 #define SSP1IF PIR1bits.SSP1IF // bit 3
3779 #define TXIF PIR1bits.TXIF // bit 4
3780 #define RCIF PIR1bits.RCIF // bit 5
3781 #define ADIF PIR1bits.ADIF // bit 6
3782 #define TMR1GIF PIR1bits.TMR1GIF // bit 7
3784 #define ACTIF PIR2bits.ACTIF // bit 1
3785 #define USBIF PIR2bits.USBIF // bit 2
3786 #define BCL1IF PIR2bits.BCL1IF // bit 3
3787 #define C1IF PIR2bits.C1IF // bit 5
3788 #define C2IF PIR2bits.C2IF // bit 6
3789 #define OSFIF PIR2bits.OSFIF // bit 7
3791 #define RD PMCON1bits.RD // bit 0
3792 #define WR PMCON1bits.WR // bit 1
3793 #define WREN PMCON1bits.WREN // bit 2
3794 #define WRERR PMCON1bits.WRERR // bit 3
3795 #define FREE PMCON1bits.FREE // bit 4
3796 #define LWLO PMCON1bits.LWLO // bit 5
3797 #define CFGS PMCON1bits.CFGS // bit 6
3799 #define RA0 PORTAbits.RA0 // bit 0
3800 #define RA1 PORTAbits.RA1 // bit 1
3801 #define RA3 PORTAbits.RA3 // bit 3
3802 #define RA4 PORTAbits.RA4 // bit 4
3803 #define RA5 PORTAbits.RA5 // bit 5
3805 #define RB4 PORTBbits.RB4 // bit 4
3806 #define RB5 PORTBbits.RB5 // bit 5
3807 #define RB6 PORTBbits.RB6 // bit 6
3808 #define RB7 PORTBbits.RB7 // bit 7
3810 #define RC0 PORTCbits.RC0 // bit 0
3811 #define RC1 PORTCbits.RC1 // bit 1
3812 #define RC2 PORTCbits.RC2 // bit 2
3813 #define RC3 PORTCbits.RC3 // bit 3
3814 #define RC4 PORTCbits.RC4 // bit 4
3815 #define RC5 PORTCbits.RC5 // bit 5
3816 #define RC6 PORTCbits.RC6 // bit 6
3817 #define RC7 PORTCbits.RC7 // bit 7
3819 #define PWM1POL PWM1CONbits.PWM1POL // bit 4
3820 #define PWM1OUT PWM1CONbits.PWM1OUT // bit 5
3821 #define PWM1OE PWM1CONbits.PWM1OE // bit 6
3822 #define PWM1EN PWM1CONbits.PWM1EN // bit 7
3824 #define PWM1DCH0 PWM1DCHbits.PWM1DCH0 // bit 0
3825 #define PWM1DCH1 PWM1DCHbits.PWM1DCH1 // bit 1
3826 #define PWM1DCH2 PWM1DCHbits.PWM1DCH2 // bit 2
3827 #define PWM1DCH3 PWM1DCHbits.PWM1DCH3 // bit 3
3828 #define PWM1DCH4 PWM1DCHbits.PWM1DCH4 // bit 4
3829 #define PWM1DCH5 PWM1DCHbits.PWM1DCH5 // bit 5
3830 #define PWM1DCH6 PWM1DCHbits.PWM1DCH6 // bit 6
3831 #define PWM1DCH7 PWM1DCHbits.PWM1DCH7 // bit 7
3833 #define PWM1DCL0 PWM1DCLbits.PWM1DCL0 // bit 6
3834 #define PWM1DCL1 PWM1DCLbits.PWM1DCL1 // bit 7
3836 #define PWM2POL PWM2CONbits.PWM2POL // bit 4
3837 #define PWM2OUT PWM2CONbits.PWM2OUT // bit 5
3838 #define PWM2OE PWM2CONbits.PWM2OE // bit 6
3839 #define PWM2EN PWM2CONbits.PWM2EN // bit 7
3841 #define PWM2DCH0 PWM2DCHbits.PWM2DCH0 // bit 0
3842 #define PWM2DCH1 PWM2DCHbits.PWM2DCH1 // bit 1
3843 #define PWM2DCH2 PWM2DCHbits.PWM2DCH2 // bit 2
3844 #define PWM2DCH3 PWM2DCHbits.PWM2DCH3 // bit 3
3845 #define PWM2DCH4 PWM2DCHbits.PWM2DCH4 // bit 4
3846 #define PWM2DCH5 PWM2DCHbits.PWM2DCH5 // bit 5
3847 #define PWM2DCH6 PWM2DCHbits.PWM2DCH6 // bit 6
3848 #define PWM2DCH7 PWM2DCHbits.PWM2DCH7 // bit 7
3850 #define PWM2DCL0 PWM2DCLbits.PWM2DCL0 // bit 6
3851 #define PWM2DCL1 PWM2DCLbits.PWM2DCL1 // bit 7
3853 #define RX9D RCSTAbits.RX9D // bit 0
3854 #define OERR RCSTAbits.OERR // bit 1
3855 #define FERR RCSTAbits.FERR // bit 2
3856 #define ADDEN RCSTAbits.ADDEN // bit 3
3857 #define CREN RCSTAbits.CREN // bit 4
3858 #define SREN RCSTAbits.SREN // bit 5
3859 #define RX9 RCSTAbits.RX9 // bit 6
3860 #define SPEN RCSTAbits.SPEN // bit 7
3862 #define SSP1M0 SSP1CON1bits.SSP1M0 // bit 0
3863 #define SSP1M1 SSP1CON1bits.SSP1M1 // bit 1
3864 #define SSP1M2 SSP1CON1bits.SSP1M2 // bit 2
3865 #define SSP1M3 SSP1CON1bits.SSP1M3 // bit 3
3866 #define CKP SSP1CON1bits.CKP // bit 4
3867 #define SSPEN SSP1CON1bits.SSPEN // bit 5, shadows bit in SSP1CON1bits
3868 #define SSP1EN SSP1CON1bits.SSP1EN // bit 5, shadows bit in SSP1CON1bits
3869 #define SSPOV SSP1CON1bits.SSPOV // bit 6, shadows bit in SSP1CON1bits
3870 #define SSP1OV SSP1CON1bits.SSP1OV // bit 6, shadows bit in SSP1CON1bits
3871 #define WCOL SSP1CON1bits.WCOL // bit 7
3873 #define SEN SSP1CON2bits.SEN // bit 0
3874 #define RSEN SSP1CON2bits.RSEN // bit 1
3875 #define PEN SSP1CON2bits.PEN // bit 2
3876 #define RCEN SSP1CON2bits.RCEN // bit 3
3877 #define ACKEN SSP1CON2bits.ACKEN // bit 4
3878 #define ACKDT SSP1CON2bits.ACKDT // bit 5
3879 #define ACKSTAT SSP1CON2bits.ACKSTAT // bit 6
3880 #define GCEN SSP1CON2bits.GCEN // bit 7
3882 #define DHEN SSP1CON3bits.DHEN // bit 0
3883 #define AHEN SSP1CON3bits.AHEN // bit 1
3884 #define SBCDE SSP1CON3bits.SBCDE // bit 2
3885 #define SDAHT SSP1CON3bits.SDAHT // bit 3
3886 #define BOEN SSP1CON3bits.BOEN // bit 4
3887 #define SCIE SSP1CON3bits.SCIE // bit 5
3888 #define PCIE SSP1CON3bits.PCIE // bit 6
3889 #define ACKTIM SSP1CON3bits.ACKTIM // bit 7
3891 #define BF SSP1STATbits.BF // bit 0
3892 #define UA SSP1STATbits.UA // bit 1
3893 #define R_NOT_W SSP1STATbits.R_NOT_W // bit 2
3894 #define S SSP1STATbits.S // bit 3
3895 #define P SSP1STATbits.P // bit 4
3896 #define D_NOT_A SSP1STATbits.D_NOT_A // bit 5
3897 #define CKE SSP1STATbits.CKE // bit 6
3898 #define SMP SSP1STATbits.SMP // bit 7
3900 #define C STATUSbits.C // bit 0
3901 #define DC STATUSbits.DC // bit 1
3902 #define Z STATUSbits.Z // bit 2
3903 #define NOT_PD STATUSbits.NOT_PD // bit 3
3904 #define NOT_TO STATUSbits.NOT_TO // bit 4
3906 #define TMR1ON T1CONbits.TMR1ON // bit 0
3907 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2
3908 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
3909 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
3910 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
3911 #define TMR1CS0 T1CONbits.TMR1CS0 // bit 6
3912 #define TMR1CS1 T1CONbits.TMR1CS1 // bit 7
3914 #define T1GSS0 T1GCONbits.T1GSS0 // bit 0
3915 #define T1GSS1 T1GCONbits.T1GSS1 // bit 1
3916 #define T1GVAL T1GCONbits.T1GVAL // bit 2
3917 #define T1GGO_NOT_DONE T1GCONbits.T1GGO_NOT_DONE // bit 3
3918 #define T1GSPM T1GCONbits.T1GSPM // bit 4
3919 #define T1GTM T1GCONbits.T1GTM // bit 5
3920 #define T1GPOL T1GCONbits.T1GPOL // bit 6
3921 #define TMR1GE T1GCONbits.TMR1GE // bit 7
3923 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
3924 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
3925 #define TMR2ON T2CONbits.TMR2ON // bit 2
3926 #define T2OUTPS0 T2CONbits.T2OUTPS0 // bit 3
3927 #define T2OUTPS1 T2CONbits.T2OUTPS1 // bit 4
3928 #define T2OUTPS2 T2CONbits.T2OUTPS2 // bit 5
3929 #define T2OUTPS3 T2CONbits.T2OUTPS3 // bit 6
3931 #define TRISA4 TRISAbits.TRISA4 // bit 4
3932 #define TRISA5 TRISAbits.TRISA5 // bit 5
3934 #define TRISB4 TRISBbits.TRISB4 // bit 4
3935 #define TRISB5 TRISBbits.TRISB5 // bit 5
3936 #define TRISB6 TRISBbits.TRISB6 // bit 6
3937 #define TRISB7 TRISBbits.TRISB7 // bit 7
3939 #define TRISC0 TRISCbits.TRISC0 // bit 0
3940 #define TRISC1 TRISCbits.TRISC1 // bit 1
3941 #define TRISC2 TRISCbits.TRISC2 // bit 2
3942 #define TRISC3 TRISCbits.TRISC3 // bit 3
3943 #define TRISC4 TRISCbits.TRISC4 // bit 4
3944 #define TRISC5 TRISCbits.TRISC5 // bit 5
3945 #define TRISC6 TRISCbits.TRISC6 // bit 6
3946 #define TRISC7 TRISCbits.TRISC7 // bit 7
3948 #define TX9D TXSTAbits.TX9D // bit 0
3949 #define TRMT TXSTAbits.TRMT // bit 1
3950 #define BRGH TXSTAbits.BRGH // bit 2
3951 #define SENDB TXSTAbits.SENDB // bit 3
3952 #define SYNC TXSTAbits.SYNC // bit 4
3953 #define TXEN TXSTAbits.TXEN // bit 5
3954 #define TX9 TXSTAbits.TX9 // bit 6
3955 #define CSRC TXSTAbits.CSRC // bit 7
3957 #define ADDR0 UADDRbits.ADDR0 // bit 0
3958 #define ADDR1 UADDRbits.ADDR1 // bit 1
3959 #define ADDR2 UADDRbits.ADDR2 // bit 2
3960 #define ADDR3 UADDRbits.ADDR3 // bit 3
3961 #define ADDR4 UADDRbits.ADDR4 // bit 4
3962 #define ADDR5 UADDRbits.ADDR5 // bit 5
3963 #define ADDR6 UADDRbits.ADDR6 // bit 6
3965 #define PPB0 UCFGbits.PPB0 // bit 0
3966 #define PPB1 UCFGbits.PPB1 // bit 1
3967 #define FSEN UCFGbits.FSEN // bit 2
3968 #define UPUEN UCFGbits.UPUEN // bit 4
3969 #define UTEYE UCFGbits.UTEYE // bit 7
3971 #define SUSPND UCONbits.SUSPND // bit 1
3972 #define RESUME UCONbits.RESUME // bit 2
3973 #define USBEN UCONbits.USBEN // bit 3
3974 #define PKTDIS UCONbits.PKTDIS // bit 4
3975 #define SE0 UCONbits.SE0 // bit 5
3976 #define PPBRST UCONbits.PPBRST // bit 6
3978 #define PIDEE UEIEbits.PIDEE // bit 0
3979 #define CRC5EE UEIEbits.CRC5EE // bit 1
3980 #define CRC16EE UEIEbits.CRC16EE // bit 2
3981 #define DFN8EE UEIEbits.DFN8EE // bit 3
3982 #define BTOEE UEIEbits.BTOEE // bit 4
3983 #define BTSEE UEIEbits.BTSEE // bit 7
3985 #define PIDEF UEIRbits.PIDEF // bit 0
3986 #define CRC5EF UEIRbits.CRC5EF // bit 1
3987 #define CRC16EF UEIRbits.CRC16EF // bit 2
3988 #define DFN8EF UEIRbits.DFN8EF // bit 3
3989 #define BTOEF UEIRbits.BTOEF // bit 4
3990 #define BTSEF UEIRbits.BTSEF // bit 7
3992 #define EPSTALL UEP0bits.EPSTALL // bit 0
3993 #define EPINEN UEP0bits.EPINEN // bit 1
3994 #define EPOUTEN UEP0bits.EPOUTEN // bit 2
3995 #define EPCONDIS UEP0bits.EPCONDIS // bit 3
3996 #define EPHSHK UEP0bits.EPHSHK // bit 4
3998 #define FRM8 UFRMHbits.FRM8 // bit 0
3999 #define FRM9 UFRMHbits.FRM9 // bit 1
4000 #define FRM10 UFRMHbits.FRM10 // bit 2
4002 #define FRM0 UFRMLbits.FRM0 // bit 0
4003 #define FRM1 UFRMLbits.FRM1 // bit 1
4004 #define FRM2 UFRMLbits.FRM2 // bit 2
4005 #define FRM3 UFRMLbits.FRM3 // bit 3
4006 #define FRM4 UFRMLbits.FRM4 // bit 4
4007 #define FRM5 UFRMLbits.FRM5 // bit 5
4008 #define FRM6 UFRMLbits.FRM6 // bit 6
4009 #define FRM7 UFRMLbits.FRM7 // bit 7
4011 #define URSTIE UIEbits.URSTIE // bit 0
4012 #define UERRIE UIEbits.UERRIE // bit 1
4013 #define ACTVIE UIEbits.ACTVIE // bit 2
4014 #define TRNIE UIEbits.TRNIE // bit 3
4015 #define IDLEIE UIEbits.IDLEIE // bit 4
4016 #define STALLIE UIEbits.STALLIE // bit 5
4017 #define SOFIE UIEbits.SOFIE // bit 6
4019 #define URSTIF UIRbits.URSTIF // bit 0
4020 #define UERRIF UIRbits.UERRIF // bit 1
4021 #define ACTVIF UIRbits.ACTVIF // bit 2
4022 #define TRNIF UIRbits.TRNIF // bit 3
4023 #define IDLEIF UIRbits.IDLEIF // bit 4
4024 #define STALLIF UIRbits.STALLIF // bit 5
4025 #define SOFIF UIRbits.SOFIF // bit 6
4027 #define PPBI USTATbits.PPBI // bit 1
4028 #define DIR USTATbits.DIR // bit 2
4029 #define ENDP0 USTATbits.ENDP0 // bit 3
4030 #define ENDP1 USTATbits.ENDP1 // bit 4
4031 #define ENDP2 USTATbits.ENDP2 // bit 5
4032 #define ENDP3 USTATbits.ENDP3 // bit 6
4034 #define SWDTEN WDTCONbits.SWDTEN // bit 0
4035 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1
4036 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2
4037 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3
4038 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4
4039 #define WDTPS4 WDTCONbits.WDTPS4 // bit 5
4041 #define WPUA3 WPUAbits.WPUA3 // bit 3
4042 #define WPUA4 WPUAbits.WPUA4 // bit 4
4043 #define WPUA5 WPUAbits.WPUA5 // bit 5
4045 #define WPUB4 WPUBbits.WPUB4 // bit 4
4046 #define WPUB5 WPUBbits.WPUB5 // bit 5
4047 #define WPUB6 WPUBbits.WPUB6 // bit 6
4048 #define WPUB7 WPUBbits.WPUB7 // bit 7
4050 #endif // #ifndef NO_BIT_DEFINES
4052 #endif // #ifndef __PIC16LF1459_H__