struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16lf1554.h
blob6b186847ede5e5e9557d98c60a4c3cda69292293
1 /*
2 * This declarations of the PIC16LF1554 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:07 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 __PIC16LF1554_H__
26 #define __PIC16LF1554_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 PORTC_ADDR 0x000E
52 #define PIR1_ADDR 0x0011
53 #define PIR2_ADDR 0x0012
54 #define TMR0_ADDR 0x0015
55 #define TMR1_ADDR 0x0016
56 #define TMR1L_ADDR 0x0016
57 #define TMR1H_ADDR 0x0017
58 #define T1CON_ADDR 0x0018
59 #define T1GCON_ADDR 0x0019
60 #define TMR2_ADDR 0x001A
61 #define PR2_ADDR 0x001B
62 #define T2CON_ADDR 0x001C
63 #define TRISA_ADDR 0x008C
64 #define TRISC_ADDR 0x008E
65 #define PIE1_ADDR 0x0091
66 #define PIE2_ADDR 0x0092
67 #define OPTION_REG_ADDR 0x0095
68 #define PCON_ADDR 0x0096
69 #define WDTCON_ADDR 0x0097
70 #define OSCCON_ADDR 0x0099
71 #define OSCSTAT_ADDR 0x009A
72 #define ADRES_ADDR 0x009B
73 #define ADRESL_ADDR 0x009B
74 #define ADRESH_ADDR 0x009C
75 #define ADCON0_ADDR 0x009D
76 #define ADCON1_ADDR 0x009E
77 #define ADCON2_ADDR 0x009F
78 #define LATA_ADDR 0x010C
79 #define LATC_ADDR 0x010E
80 #define BORCON_ADDR 0x0116
81 #define FVRCON_ADDR 0x0117
82 #define APFCON_ADDR 0x011D
83 #define ANSELA_ADDR 0x018C
84 #define ANSELC_ADDR 0x018E
85 #define PMADR_ADDR 0x0191
86 #define PMADRL_ADDR 0x0191
87 #define PMADRH_ADDR 0x0192
88 #define PMDAT_ADDR 0x0193
89 #define PMDATL_ADDR 0x0193
90 #define PMDATH_ADDR 0x0194
91 #define PMCON1_ADDR 0x0195
92 #define PMCON2_ADDR 0x0196
93 #define RCREG_ADDR 0x0199
94 #define TXREG_ADDR 0x019A
95 #define SPBRG_ADDR 0x019B
96 #define SPBRGL_ADDR 0x019B
97 #define SPBRGH_ADDR 0x019C
98 #define RCSTA_ADDR 0x019D
99 #define TXSTA_ADDR 0x019E
100 #define BAUDCON_ADDR 0x019F
101 #define WPUA_ADDR 0x020C
102 #define SSP1BUF_ADDR 0x0211
103 #define SSPBUF_ADDR 0x0211
104 #define SSP1ADD_ADDR 0x0212
105 #define SSPADD_ADDR 0x0212
106 #define SSP1MSK_ADDR 0x0213
107 #define SSPMSK_ADDR 0x0213
108 #define SSP1STAT_ADDR 0x0214
109 #define SSPSTAT_ADDR 0x0214
110 #define SSP1CON1_ADDR 0x0215
111 #define SSPCON_ADDR 0x0215
112 #define SSPCON1_ADDR 0x0215
113 #define SSP1CON2_ADDR 0x0216
114 #define SSPCON2_ADDR 0x0216
115 #define SSP1CON3_ADDR 0x0217
116 #define SSPCON3_ADDR 0x0217
117 #define IOCAP_ADDR 0x0391
118 #define IOCAN_ADDR 0x0392
119 #define IOCAF_ADDR 0x0393
120 #define PWM1DCL_ADDR 0x0611
121 #define PWM1DCH_ADDR 0x0612
122 #define PWM1CON_ADDR 0x0613
123 #define PWM1CON0_ADDR 0x0613
124 #define PWM2DCL_ADDR 0x0614
125 #define PWM2DCH_ADDR 0x0615
126 #define PWM2CON_ADDR 0x0616
127 #define PWM2CON0_ADDR 0x0616
128 #define AAD1CON0_ADDR 0x0711
129 #define AADCON0_ADDR 0x0711
130 #define AD1CON0_ADDR 0x0711
131 #define AADCON1_ADDR 0x0712
132 #define ADCOMCON_ADDR 0x0712
133 #define AAD1CON2_ADDR 0x0713
134 #define AADCON2_ADDR 0x0713
135 #define AD1CON2_ADDR 0x0713
136 #define AAD1CON3_ADDR 0x0714
137 #define AADCON3_ADDR 0x0714
138 #define AD1CON3_ADDR 0x0714
139 #define AADSTAT_ADDR 0x0715
140 #define ADSTAT_ADDR 0x0715
141 #define AAD1PRE_ADDR 0x0716
142 #define AADPRE_ADDR 0x0716
143 #define AD1PRE_ADDR 0x0716
144 #define AD1PRECON_ADDR 0x0716
145 #define AAD1ACQ_ADDR 0x0717
146 #define AADACQ_ADDR 0x0717
147 #define AD1ACQ_ADDR 0x0717
148 #define AD1ACQCON_ADDR 0x0717
149 #define AAD1GRD_ADDR 0x0718
150 #define AADGRD_ADDR 0x0718
151 #define AD1GRD_ADDR 0x0718
152 #define AAD1CAP_ADDR 0x0719
153 #define AAD1CAPCON_ADDR 0x0719
154 #define AADCAP_ADDR 0x0719
155 #define AD1CAPCON_ADDR 0x0719
156 #define AAD1RES0_ADDR 0x071A
157 #define AAD1RES0L_ADDR 0x071A
158 #define AD1RES0_ADDR 0x071A
159 #define AD1RES0L_ADDR 0x071A
160 #define ADRES0_ADDR 0x071A
161 #define AAD1RES0H_ADDR 0x071B
162 #define AD1RES0H_ADDR 0x071B
163 #define AAD1RES1_ADDR 0x071C
164 #define AAD1RES1L_ADDR 0x071C
165 #define AD1RES1_ADDR 0x071C
166 #define AD1RES1L_ADDR 0x071C
167 #define ADRES1_ADDR 0x071C
168 #define AAD1RES1H_ADDR 0x071D
169 #define AD1RES1H_ADDR 0x071D
170 #define AAD1CH_ADDR 0x071E
171 #define AD1CH_ADDR 0x071E
172 #define AAD2CON0_ADDR 0x0791
173 #define AD2CON0_ADDR 0x0791
174 #define AAD2CON2_ADDR 0x0793
175 #define AD2CON2_ADDR 0x0793
176 #define AAD2CON3_ADDR 0x0794
177 #define AD2CON3_ADDR 0x0794
178 #define AAD2PRE_ADDR 0x0796
179 #define AD2PRE_ADDR 0x0796
180 #define AD2PRECON_ADDR 0x0796
181 #define AAD2ACQ_ADDR 0x0797
182 #define AD2ACQ_ADDR 0x0797
183 #define AD2ACQCON_ADDR 0x0797
184 #define AAD2GRD_ADDR 0x0798
185 #define AD2GRD_ADDR 0x0798
186 #define AAD2CAP_ADDR 0x0799
187 #define AAD2CAPCON_ADDR 0x0799
188 #define AD2CAPCON_ADDR 0x0799
189 #define AAD2RES0_ADDR 0x079A
190 #define AAD2RES0L_ADDR 0x079A
191 #define AD2RES0_ADDR 0x079A
192 #define AD2RES0L_ADDR 0x079A
193 #define AAD2RES0H_ADDR 0x079B
194 #define AD2RES0H_ADDR 0x079B
195 #define AAD2RES1_ADDR 0x079C
196 #define AAD2RES1L_ADDR 0x079C
197 #define AD2RES1_ADDR 0x079C
198 #define AD2RES1L_ADDR 0x079C
199 #define AAD2RES1H_ADDR 0x079D
200 #define AD2RES1H_ADDR 0x079D
201 #define AAD2CH_ADDR 0x079E
202 #define AD2CH_ADDR 0x079E
203 #define ICDIO_ADDR 0x0F8C
204 #define ICDCON0_ADDR 0x0F8D
205 #define ICDSTAT_ADDR 0x0F91
206 #define ICDINSTL_ADDR 0x0F96
207 #define ICDINSTH_ADDR 0x0F97
208 #define ICDBK0CON_ADDR 0x0F9C
209 #define ICDBK0L_ADDR 0x0F9D
210 #define ICDBK0H_ADDR 0x0F9E
211 #define BSRICDSHAD_ADDR 0x0FE3
212 #define STATUS_SHAD_ADDR 0x0FE4
213 #define WREG_SHAD_ADDR 0x0FE5
214 #define BSR_SHAD_ADDR 0x0FE6
215 #define PCLATH_SHAD_ADDR 0x0FE7
216 #define FSR0L_SHAD_ADDR 0x0FE8
217 #define FSR0H_SHAD_ADDR 0x0FE9
218 #define FSR1L_SHAD_ADDR 0x0FEA
219 #define FSR1H_SHAD_ADDR 0x0FEB
220 #define STKPTR_ADDR 0x0FED
221 #define TOSL_ADDR 0x0FEE
222 #define TOSH_ADDR 0x0FEF
224 #endif // #ifndef NO_ADDR_DEFINES
226 //==============================================================================
228 // Register Definitions
230 //==============================================================================
232 extern __at(0x0000) __sfr INDF0;
233 extern __at(0x0001) __sfr INDF1;
234 extern __at(0x0002) __sfr PCL;
236 //==============================================================================
237 // STATUS Bits
239 extern __at(0x0003) __sfr STATUS;
241 typedef struct
243 unsigned C : 1;
244 unsigned DC : 1;
245 unsigned Z : 1;
246 unsigned NOT_PD : 1;
247 unsigned NOT_TO : 1;
248 unsigned : 1;
249 unsigned : 1;
250 unsigned : 1;
251 } __STATUSbits_t;
253 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
255 #define _C 0x01
256 #define _DC 0x02
257 #define _Z 0x04
258 #define _NOT_PD 0x08
259 #define _NOT_TO 0x10
261 //==============================================================================
263 extern __at(0x0004) __sfr FSR0;
264 extern __at(0x0004) __sfr FSR0L;
265 extern __at(0x0005) __sfr FSR0H;
266 extern __at(0x0006) __sfr FSR1;
267 extern __at(0x0006) __sfr FSR1L;
268 extern __at(0x0007) __sfr FSR1H;
270 //==============================================================================
271 // BSR Bits
273 extern __at(0x0008) __sfr BSR;
275 typedef union
277 struct
279 unsigned BSR0 : 1;
280 unsigned BSR1 : 1;
281 unsigned BSR2 : 1;
282 unsigned BSR3 : 1;
283 unsigned BSR4 : 1;
284 unsigned : 1;
285 unsigned : 1;
286 unsigned : 1;
289 struct
291 unsigned BSR : 5;
292 unsigned : 3;
294 } __BSRbits_t;
296 extern __at(0x0008) volatile __BSRbits_t BSRbits;
298 #define _BSR0 0x01
299 #define _BSR1 0x02
300 #define _BSR2 0x04
301 #define _BSR3 0x08
302 #define _BSR4 0x10
304 //==============================================================================
306 extern __at(0x0009) __sfr WREG;
307 extern __at(0x000A) __sfr PCLATH;
309 //==============================================================================
310 // INTCON Bits
312 extern __at(0x000B) __sfr INTCON;
314 typedef union
316 struct
318 unsigned IOCIF : 1;
319 unsigned INTF : 1;
320 unsigned TMR0IF : 1;
321 unsigned IOCIE : 1;
322 unsigned INTE : 1;
323 unsigned TMR0IE : 1;
324 unsigned PEIE : 1;
325 unsigned GIE : 1;
328 struct
330 unsigned : 1;
331 unsigned : 1;
332 unsigned T0IF : 1;
333 unsigned : 1;
334 unsigned : 1;
335 unsigned T0IE : 1;
336 unsigned : 1;
337 unsigned : 1;
339 } __INTCONbits_t;
341 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
343 #define _IOCIF 0x01
344 #define _INTF 0x02
345 #define _TMR0IF 0x04
346 #define _T0IF 0x04
347 #define _IOCIE 0x08
348 #define _INTE 0x10
349 #define _TMR0IE 0x20
350 #define _T0IE 0x20
351 #define _PEIE 0x40
352 #define _GIE 0x80
354 //==============================================================================
357 //==============================================================================
358 // PORTA Bits
360 extern __at(0x000C) __sfr PORTA;
362 typedef union
364 struct
366 unsigned RA0 : 1;
367 unsigned RA1 : 1;
368 unsigned RA2 : 1;
369 unsigned RA3 : 1;
370 unsigned RA4 : 1;
371 unsigned RA5 : 1;
372 unsigned : 1;
373 unsigned : 1;
376 struct
378 unsigned RA : 6;
379 unsigned : 2;
381 } __PORTAbits_t;
383 extern __at(0x000C) volatile __PORTAbits_t PORTAbits;
385 #define _RA0 0x01
386 #define _RA1 0x02
387 #define _RA2 0x04
388 #define _RA3 0x08
389 #define _RA4 0x10
390 #define _RA5 0x20
392 //==============================================================================
395 //==============================================================================
396 // PORTC Bits
398 extern __at(0x000E) __sfr PORTC;
400 typedef union
402 struct
404 unsigned RC0 : 1;
405 unsigned RC1 : 1;
406 unsigned RC2 : 1;
407 unsigned RC3 : 1;
408 unsigned RC4 : 1;
409 unsigned RC5 : 1;
410 unsigned : 1;
411 unsigned : 1;
414 struct
416 unsigned RC : 6;
417 unsigned : 2;
419 } __PORTCbits_t;
421 extern __at(0x000E) volatile __PORTCbits_t PORTCbits;
423 #define _RC0 0x01
424 #define _RC1 0x02
425 #define _RC2 0x04
426 #define _RC3 0x08
427 #define _RC4 0x10
428 #define _RC5 0x20
430 //==============================================================================
433 //==============================================================================
434 // PIR1 Bits
436 extern __at(0x0011) __sfr PIR1;
438 typedef union
440 struct
442 unsigned TMR1IF : 1;
443 unsigned TMR2IF : 1;
444 unsigned : 1;
445 unsigned SSP1IF : 1;
446 unsigned TXIF : 1;
447 unsigned RCIF : 1;
448 unsigned ADIF : 1;
449 unsigned TMR1GIF : 1;
452 struct
454 unsigned : 1;
455 unsigned : 1;
456 unsigned : 1;
457 unsigned : 1;
458 unsigned : 1;
459 unsigned : 1;
460 unsigned AD1IF : 1;
461 unsigned : 1;
463 } __PIR1bits_t;
465 extern __at(0x0011) volatile __PIR1bits_t PIR1bits;
467 #define _TMR1IF 0x01
468 #define _TMR2IF 0x02
469 #define _SSP1IF 0x08
470 #define _TXIF 0x10
471 #define _RCIF 0x20
472 #define _ADIF 0x40
473 #define _AD1IF 0x40
474 #define _TMR1GIF 0x80
476 //==============================================================================
479 //==============================================================================
480 // PIR2 Bits
482 extern __at(0x0012) __sfr PIR2;
484 typedef struct
486 unsigned : 1;
487 unsigned : 1;
488 unsigned : 1;
489 unsigned BCL1IF : 1;
490 unsigned : 1;
491 unsigned : 1;
492 unsigned AD2IF : 1;
493 unsigned : 1;
494 } __PIR2bits_t;
496 extern __at(0x0012) volatile __PIR2bits_t PIR2bits;
498 #define _BCL1IF 0x08
499 #define _AD2IF 0x40
501 //==============================================================================
503 extern __at(0x0015) __sfr TMR0;
504 extern __at(0x0016) __sfr TMR1;
505 extern __at(0x0016) __sfr TMR1L;
506 extern __at(0x0017) __sfr TMR1H;
508 //==============================================================================
509 // T1CON Bits
511 extern __at(0x0018) __sfr T1CON;
513 typedef union
515 struct
517 unsigned TMR1ON : 1;
518 unsigned : 1;
519 unsigned NOT_T1SYNC : 1;
520 unsigned : 1;
521 unsigned T1CKPS0 : 1;
522 unsigned T1CKPS1 : 1;
523 unsigned TMR1CS0 : 1;
524 unsigned TMR1CS1 : 1;
527 struct
529 unsigned : 4;
530 unsigned T1CKPS : 2;
531 unsigned : 2;
534 struct
536 unsigned : 6;
537 unsigned TMR1CS : 2;
539 } __T1CONbits_t;
541 extern __at(0x0018) volatile __T1CONbits_t T1CONbits;
543 #define _TMR1ON 0x01
544 #define _NOT_T1SYNC 0x04
545 #define _T1CKPS0 0x10
546 #define _T1CKPS1 0x20
547 #define _TMR1CS0 0x40
548 #define _TMR1CS1 0x80
550 //==============================================================================
553 //==============================================================================
554 // T1GCON Bits
556 extern __at(0x0019) __sfr T1GCON;
558 typedef union
560 struct
562 unsigned T1GSS0 : 1;
563 unsigned T1GSS1 : 1;
564 unsigned T1GVAL : 1;
565 unsigned T1GGO_NOT_DONE : 1;
566 unsigned T1GSPM : 1;
567 unsigned T1GTM : 1;
568 unsigned T1GPOL : 1;
569 unsigned TMR1GE : 1;
572 struct
574 unsigned : 1;
575 unsigned : 1;
576 unsigned : 1;
577 unsigned GO : 1;
578 unsigned : 1;
579 unsigned : 1;
580 unsigned : 1;
581 unsigned : 1;
584 struct
586 unsigned T1GSS : 2;
587 unsigned : 6;
589 } __T1GCONbits_t;
591 extern __at(0x0019) volatile __T1GCONbits_t T1GCONbits;
593 #define _T1GCON_T1GSS0 0x01
594 #define _T1GCON_T1GSS1 0x02
595 #define _T1GCON_T1GVAL 0x04
596 #define _T1GCON_T1GGO_NOT_DONE 0x08
597 #define _T1GCON_GO 0x08
598 #define _T1GCON_T1GSPM 0x10
599 #define _T1GCON_T1GTM 0x20
600 #define _T1GCON_T1GPOL 0x40
601 #define _T1GCON_TMR1GE 0x80
603 //==============================================================================
605 extern __at(0x001A) __sfr TMR2;
606 extern __at(0x001B) __sfr PR2;
608 //==============================================================================
609 // T2CON Bits
611 extern __at(0x001C) __sfr T2CON;
613 typedef union
615 struct
617 unsigned T2CKPS0 : 1;
618 unsigned T2CKPS1 : 1;
619 unsigned TMR2ON : 1;
620 unsigned T2OUTPS0 : 1;
621 unsigned T2OUTPS1 : 1;
622 unsigned T2OUTPS2 : 1;
623 unsigned T2OUTPS3 : 1;
624 unsigned : 1;
627 struct
629 unsigned T2CKPS : 2;
630 unsigned : 6;
633 struct
635 unsigned : 3;
636 unsigned T2OUTPS : 4;
637 unsigned : 1;
639 } __T2CONbits_t;
641 extern __at(0x001C) volatile __T2CONbits_t T2CONbits;
643 #define _T2CKPS0 0x01
644 #define _T2CKPS1 0x02
645 #define _TMR2ON 0x04
646 #define _T2OUTPS0 0x08
647 #define _T2OUTPS1 0x10
648 #define _T2OUTPS2 0x20
649 #define _T2OUTPS3 0x40
651 //==============================================================================
654 //==============================================================================
655 // TRISA Bits
657 extern __at(0x008C) __sfr TRISA;
659 typedef union
661 struct
663 unsigned TRISA0 : 1;
664 unsigned TRISA1 : 1;
665 unsigned TRISA2 : 1;
666 unsigned TRISA3 : 1;
667 unsigned TRISA4 : 1;
668 unsigned TRISA5 : 1;
669 unsigned : 1;
670 unsigned : 1;
673 struct
675 unsigned TRISA : 6;
676 unsigned : 2;
678 } __TRISAbits_t;
680 extern __at(0x008C) volatile __TRISAbits_t TRISAbits;
682 #define _TRISA0 0x01
683 #define _TRISA1 0x02
684 #define _TRISA2 0x04
685 #define _TRISA3 0x08
686 #define _TRISA4 0x10
687 #define _TRISA5 0x20
689 //==============================================================================
692 //==============================================================================
693 // TRISC Bits
695 extern __at(0x008E) __sfr TRISC;
697 typedef union
699 struct
701 unsigned TRISC0 : 1;
702 unsigned TRISC1 : 1;
703 unsigned TRISC2 : 1;
704 unsigned TRISC3 : 1;
705 unsigned TRISC4 : 1;
706 unsigned TRISC5 : 1;
707 unsigned : 1;
708 unsigned : 1;
711 struct
713 unsigned TRISC : 6;
714 unsigned : 2;
716 } __TRISCbits_t;
718 extern __at(0x008E) volatile __TRISCbits_t TRISCbits;
720 #define _TRISC0 0x01
721 #define _TRISC1 0x02
722 #define _TRISC2 0x04
723 #define _TRISC3 0x08
724 #define _TRISC4 0x10
725 #define _TRISC5 0x20
727 //==============================================================================
730 //==============================================================================
731 // PIE1 Bits
733 extern __at(0x0091) __sfr PIE1;
735 typedef union
737 struct
739 unsigned TMR1IE : 1;
740 unsigned TMR2IE : 1;
741 unsigned : 1;
742 unsigned SSP1IE : 1;
743 unsigned TXIE : 1;
744 unsigned RCIE : 1;
745 unsigned ADIE : 1;
746 unsigned TMR1GIE : 1;
749 struct
751 unsigned : 1;
752 unsigned : 1;
753 unsigned : 1;
754 unsigned : 1;
755 unsigned : 1;
756 unsigned : 1;
757 unsigned AD1IE : 1;
758 unsigned : 1;
760 } __PIE1bits_t;
762 extern __at(0x0091) volatile __PIE1bits_t PIE1bits;
764 #define _TMR1IE 0x01
765 #define _TMR2IE 0x02
766 #define _SSP1IE 0x08
767 #define _TXIE 0x10
768 #define _RCIE 0x20
769 #define _ADIE 0x40
770 #define _AD1IE 0x40
771 #define _TMR1GIE 0x80
773 //==============================================================================
776 //==============================================================================
777 // PIE2 Bits
779 extern __at(0x0092) __sfr PIE2;
781 typedef struct
783 unsigned : 1;
784 unsigned : 1;
785 unsigned : 1;
786 unsigned BCL1IE : 1;
787 unsigned : 1;
788 unsigned : 1;
789 unsigned AD2IE : 1;
790 unsigned : 1;
791 } __PIE2bits_t;
793 extern __at(0x0092) volatile __PIE2bits_t PIE2bits;
795 #define _BCL1IE 0x08
796 #define _AD2IE 0x40
798 //==============================================================================
801 //==============================================================================
802 // OPTION_REG Bits
804 extern __at(0x0095) __sfr OPTION_REG;
806 typedef union
808 struct
810 unsigned PS0 : 1;
811 unsigned PS1 : 1;
812 unsigned PS2 : 1;
813 unsigned PSA : 1;
814 unsigned TMR0SE : 1;
815 unsigned TMR0CS : 1;
816 unsigned INTEDG : 1;
817 unsigned NOT_WPUEN : 1;
820 struct
822 unsigned : 1;
823 unsigned : 1;
824 unsigned : 1;
825 unsigned : 1;
826 unsigned T0SE : 1;
827 unsigned T0CS : 1;
828 unsigned : 1;
829 unsigned : 1;
832 struct
834 unsigned PS : 3;
835 unsigned : 5;
837 } __OPTION_REGbits_t;
839 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits;
841 #define _PS0 0x01
842 #define _PS1 0x02
843 #define _PS2 0x04
844 #define _PSA 0x08
845 #define _TMR0SE 0x10
846 #define _T0SE 0x10
847 #define _TMR0CS 0x20
848 #define _T0CS 0x20
849 #define _INTEDG 0x40
850 #define _NOT_WPUEN 0x80
852 //==============================================================================
855 //==============================================================================
856 // PCON Bits
858 extern __at(0x0096) __sfr PCON;
860 typedef struct
862 unsigned NOT_BOR : 1;
863 unsigned NOT_POR : 1;
864 unsigned NOT_RI : 1;
865 unsigned NOT_RMCLR : 1;
866 unsigned NOT_RWDT : 1;
867 unsigned : 1;
868 unsigned STKUNF : 1;
869 unsigned STKOVF : 1;
870 } __PCONbits_t;
872 extern __at(0x0096) volatile __PCONbits_t PCONbits;
874 #define _NOT_BOR 0x01
875 #define _NOT_POR 0x02
876 #define _NOT_RI 0x04
877 #define _NOT_RMCLR 0x08
878 #define _NOT_RWDT 0x10
879 #define _STKUNF 0x40
880 #define _STKOVF 0x80
882 //==============================================================================
885 //==============================================================================
886 // WDTCON Bits
888 extern __at(0x0097) __sfr WDTCON;
890 typedef union
892 struct
894 unsigned SWDTEN : 1;
895 unsigned WDTPS0 : 1;
896 unsigned WDTPS1 : 1;
897 unsigned WDTPS2 : 1;
898 unsigned WDTPS3 : 1;
899 unsigned WDTPS4 : 1;
900 unsigned : 1;
901 unsigned : 1;
904 struct
906 unsigned : 1;
907 unsigned WDTPS : 5;
908 unsigned : 2;
910 } __WDTCONbits_t;
912 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
914 #define _SWDTEN 0x01
915 #define _WDTPS0 0x02
916 #define _WDTPS1 0x04
917 #define _WDTPS2 0x08
918 #define _WDTPS3 0x10
919 #define _WDTPS4 0x20
921 //==============================================================================
924 //==============================================================================
925 // OSCCON Bits
927 extern __at(0x0099) __sfr OSCCON;
929 typedef union
931 struct
933 unsigned SCS0 : 1;
934 unsigned SCS1 : 1;
935 unsigned : 1;
936 unsigned IRCF0 : 1;
937 unsigned IRCF1 : 1;
938 unsigned IRCF2 : 1;
939 unsigned IRCF3 : 1;
940 unsigned SPLLEN : 1;
943 struct
945 unsigned SCS : 2;
946 unsigned : 6;
949 struct
951 unsigned : 3;
952 unsigned IRCF : 4;
953 unsigned : 1;
955 } __OSCCONbits_t;
957 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits;
959 #define _SCS0 0x01
960 #define _SCS1 0x02
961 #define _IRCF0 0x08
962 #define _IRCF1 0x10
963 #define _IRCF2 0x20
964 #define _IRCF3 0x40
965 #define _SPLLEN 0x80
967 //==============================================================================
970 //==============================================================================
971 // OSCSTAT Bits
973 extern __at(0x009A) __sfr OSCSTAT;
975 typedef struct
977 unsigned HFIOFS : 1;
978 unsigned LFIOFR : 1;
979 unsigned : 1;
980 unsigned : 1;
981 unsigned HFIOFR : 1;
982 unsigned : 1;
983 unsigned PLLSR : 1;
984 unsigned : 1;
985 } __OSCSTATbits_t;
987 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits;
989 #define _HFIOFS 0x01
990 #define _LFIOFR 0x02
991 #define _HFIOFR 0x10
992 #define _PLLSR 0x40
994 //==============================================================================
996 extern __at(0x009B) __sfr ADRES;
997 extern __at(0x009B) __sfr ADRESL;
998 extern __at(0x009C) __sfr ADRESH;
1000 //==============================================================================
1001 // ADCON0 Bits
1003 extern __at(0x009D) __sfr ADCON0;
1005 typedef union
1007 struct
1009 unsigned ADON : 1;
1010 unsigned GO_NOT_DONE : 1;
1011 unsigned CHS0 : 1;
1012 unsigned CHS1 : 1;
1013 unsigned CHS2 : 1;
1014 unsigned CHS3 : 1;
1015 unsigned CHS4 : 1;
1016 unsigned : 1;
1019 struct
1021 unsigned AD1ON : 1;
1022 unsigned ADGO : 1;
1023 unsigned : 1;
1024 unsigned : 1;
1025 unsigned : 1;
1026 unsigned : 1;
1027 unsigned : 1;
1028 unsigned : 1;
1031 struct
1033 unsigned : 1;
1034 unsigned GO : 1;
1035 unsigned : 1;
1036 unsigned : 1;
1037 unsigned : 1;
1038 unsigned : 1;
1039 unsigned : 1;
1040 unsigned : 1;
1043 struct
1045 unsigned : 2;
1046 unsigned CHS : 5;
1047 unsigned : 1;
1049 } __ADCON0bits_t;
1051 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits;
1053 #define _ADCON0_ADON 0x01
1054 #define _ADCON0_AD1ON 0x01
1055 #define _ADCON0_GO_NOT_DONE 0x02
1056 #define _ADCON0_ADGO 0x02
1057 #define _ADCON0_GO 0x02
1058 #define _ADCON0_CHS0 0x04
1059 #define _ADCON0_CHS1 0x08
1060 #define _ADCON0_CHS2 0x10
1061 #define _ADCON0_CHS3 0x20
1062 #define _ADCON0_CHS4 0x40
1064 //==============================================================================
1067 //==============================================================================
1068 // ADCON1 Bits
1070 extern __at(0x009E) __sfr ADCON1;
1072 typedef union
1074 struct
1076 unsigned ADPREF0 : 1;
1077 unsigned ADPREF1 : 1;
1078 unsigned GO_NOT_DONE_ALL : 1;
1079 unsigned : 1;
1080 unsigned : 1;
1081 unsigned : 1;
1082 unsigned : 1;
1083 unsigned ADFM : 1;
1086 struct
1088 unsigned : 1;
1089 unsigned : 1;
1090 unsigned GO_ALL : 1;
1091 unsigned : 1;
1092 unsigned : 1;
1093 unsigned : 1;
1094 unsigned : 1;
1095 unsigned : 1;
1098 struct
1100 unsigned ADPREF : 2;
1101 unsigned : 6;
1103 } __ADCON1bits_t;
1105 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits;
1107 #define _ADCON1_ADPREF0 0x01
1108 #define _ADCON1_ADPREF1 0x02
1109 #define _ADCON1_GO_NOT_DONE_ALL 0x04
1110 #define _ADCON1_GO_ALL 0x04
1111 #define _ADCON1_ADFM 0x80
1113 //==============================================================================
1116 //==============================================================================
1117 // ADCON2 Bits
1119 extern __at(0x009F) __sfr ADCON2;
1121 typedef union
1123 struct
1125 unsigned : 1;
1126 unsigned : 1;
1127 unsigned : 1;
1128 unsigned : 1;
1129 unsigned TRIGSEL0 : 1;
1130 unsigned TRIGSEL1 : 1;
1131 unsigned TRIGSEL2 : 1;
1132 unsigned : 1;
1135 struct
1137 unsigned : 4;
1138 unsigned TRIGSEL : 3;
1139 unsigned : 1;
1141 } __ADCON2bits_t;
1143 extern __at(0x009F) volatile __ADCON2bits_t ADCON2bits;
1145 #define _ADCON2_TRIGSEL0 0x10
1146 #define _ADCON2_TRIGSEL1 0x20
1147 #define _ADCON2_TRIGSEL2 0x40
1149 //==============================================================================
1152 //==============================================================================
1153 // LATA Bits
1155 extern __at(0x010C) __sfr LATA;
1157 typedef struct
1159 unsigned LATA0 : 1;
1160 unsigned LATA1 : 1;
1161 unsigned LATA2 : 1;
1162 unsigned : 1;
1163 unsigned LATA4 : 1;
1164 unsigned LATA5 : 1;
1165 unsigned : 1;
1166 unsigned : 1;
1167 } __LATAbits_t;
1169 extern __at(0x010C) volatile __LATAbits_t LATAbits;
1171 #define _LATA0 0x01
1172 #define _LATA1 0x02
1173 #define _LATA2 0x04
1174 #define _LATA4 0x10
1175 #define _LATA5 0x20
1177 //==============================================================================
1180 //==============================================================================
1181 // LATC Bits
1183 extern __at(0x010E) __sfr LATC;
1185 typedef union
1187 struct
1189 unsigned LATC0 : 1;
1190 unsigned LATC1 : 1;
1191 unsigned LATC2 : 1;
1192 unsigned LATC3 : 1;
1193 unsigned LATC4 : 1;
1194 unsigned LATC5 : 1;
1195 unsigned : 1;
1196 unsigned : 1;
1199 struct
1201 unsigned LATC : 6;
1202 unsigned : 2;
1204 } __LATCbits_t;
1206 extern __at(0x010E) volatile __LATCbits_t LATCbits;
1208 #define _LATC0 0x01
1209 #define _LATC1 0x02
1210 #define _LATC2 0x04
1211 #define _LATC3 0x08
1212 #define _LATC4 0x10
1213 #define _LATC5 0x20
1215 //==============================================================================
1218 //==============================================================================
1219 // BORCON Bits
1221 extern __at(0x0116) __sfr BORCON;
1223 typedef struct
1225 unsigned BORRDY : 1;
1226 unsigned : 1;
1227 unsigned : 1;
1228 unsigned : 1;
1229 unsigned : 1;
1230 unsigned : 1;
1231 unsigned BORFS : 1;
1232 unsigned SBOREN : 1;
1233 } __BORCONbits_t;
1235 extern __at(0x0116) volatile __BORCONbits_t BORCONbits;
1237 #define _BORRDY 0x01
1238 #define _BORFS 0x40
1239 #define _SBOREN 0x80
1241 //==============================================================================
1244 //==============================================================================
1245 // FVRCON Bits
1247 extern __at(0x0117) __sfr FVRCON;
1249 typedef union
1251 struct
1253 unsigned ADFVR0 : 1;
1254 unsigned ADFVR1 : 1;
1255 unsigned CDAFVR0 : 1;
1256 unsigned CDAFVR1 : 1;
1257 unsigned TSRNG : 1;
1258 unsigned TSEN : 1;
1259 unsigned FVRRDY : 1;
1260 unsigned FVREN : 1;
1263 struct
1265 unsigned ADFVR : 2;
1266 unsigned : 6;
1269 struct
1271 unsigned : 2;
1272 unsigned CDAFVR : 2;
1273 unsigned : 4;
1275 } __FVRCONbits_t;
1277 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits;
1279 #define _ADFVR0 0x01
1280 #define _ADFVR1 0x02
1281 #define _CDAFVR0 0x04
1282 #define _CDAFVR1 0x08
1283 #define _TSRNG 0x10
1284 #define _TSEN 0x20
1285 #define _FVRRDY 0x40
1286 #define _FVREN 0x80
1288 //==============================================================================
1291 //==============================================================================
1292 // APFCON Bits
1294 extern __at(0x011D) __sfr APFCON;
1296 typedef struct
1298 unsigned GRDASEL : 1;
1299 unsigned GRDBSEL : 1;
1300 unsigned TXCKSEL : 1;
1301 unsigned : 1;
1302 unsigned SDSEL : 1;
1303 unsigned SSSEL : 1;
1304 unsigned SDOSEL : 1;
1305 unsigned RXDTSEL : 1;
1306 } __APFCONbits_t;
1308 extern __at(0x011D) volatile __APFCONbits_t APFCONbits;
1310 #define _GRDASEL 0x01
1311 #define _GRDBSEL 0x02
1312 #define _TXCKSEL 0x04
1313 #define _SDSEL 0x10
1314 #define _SSSEL 0x20
1315 #define _SDOSEL 0x40
1316 #define _RXDTSEL 0x80
1318 //==============================================================================
1321 //==============================================================================
1322 // ANSELA Bits
1324 extern __at(0x018C) __sfr ANSELA;
1326 typedef struct
1328 unsigned ANSA0 : 1;
1329 unsigned ANSA1 : 1;
1330 unsigned ANSA2 : 1;
1331 unsigned : 1;
1332 unsigned ANSA4 : 1;
1333 unsigned ANSA5 : 1;
1334 unsigned : 1;
1335 unsigned : 1;
1336 } __ANSELAbits_t;
1338 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits;
1340 #define _ANSA0 0x01
1341 #define _ANSA1 0x02
1342 #define _ANSA2 0x04
1343 #define _ANSA4 0x10
1344 #define _ANSA5 0x20
1346 //==============================================================================
1349 //==============================================================================
1350 // ANSELC Bits
1352 extern __at(0x018E) __sfr ANSELC;
1354 typedef union
1356 struct
1358 unsigned ANSC0 : 1;
1359 unsigned ANSC1 : 1;
1360 unsigned ANSC2 : 1;
1361 unsigned ANSC3 : 1;
1362 unsigned ANSC4 : 1;
1363 unsigned ANSC5 : 1;
1364 unsigned : 1;
1365 unsigned : 1;
1368 struct
1370 unsigned ANSC : 6;
1371 unsigned : 2;
1373 } __ANSELCbits_t;
1375 extern __at(0x018E) volatile __ANSELCbits_t ANSELCbits;
1377 #define _ANSC0 0x01
1378 #define _ANSC1 0x02
1379 #define _ANSC2 0x04
1380 #define _ANSC3 0x08
1381 #define _ANSC4 0x10
1382 #define _ANSC5 0x20
1384 //==============================================================================
1386 extern __at(0x0191) __sfr PMADR;
1387 extern __at(0x0191) __sfr PMADRL;
1388 extern __at(0x0192) __sfr PMADRH;
1389 extern __at(0x0193) __sfr PMDAT;
1390 extern __at(0x0193) __sfr PMDATL;
1391 extern __at(0x0194) __sfr PMDATH;
1393 //==============================================================================
1394 // PMCON1 Bits
1396 extern __at(0x0195) __sfr PMCON1;
1398 typedef struct
1400 unsigned RD : 1;
1401 unsigned WR : 1;
1402 unsigned WREN : 1;
1403 unsigned WRERR : 1;
1404 unsigned FREE : 1;
1405 unsigned LWLO : 1;
1406 unsigned CFGS : 1;
1407 unsigned : 1;
1408 } __PMCON1bits_t;
1410 extern __at(0x0195) volatile __PMCON1bits_t PMCON1bits;
1412 #define _RD 0x01
1413 #define _WR 0x02
1414 #define _WREN 0x04
1415 #define _WRERR 0x08
1416 #define _FREE 0x10
1417 #define _LWLO 0x20
1418 #define _CFGS 0x40
1420 //==============================================================================
1422 extern __at(0x0196) __sfr PMCON2;
1423 extern __at(0x0199) __sfr RCREG;
1424 extern __at(0x019A) __sfr TXREG;
1425 extern __at(0x019B) __sfr SPBRG;
1426 extern __at(0x019B) __sfr SPBRGL;
1427 extern __at(0x019C) __sfr SPBRGH;
1429 //==============================================================================
1430 // RCSTA Bits
1432 extern __at(0x019D) __sfr RCSTA;
1434 typedef struct
1436 unsigned RX9D : 1;
1437 unsigned OERR : 1;
1438 unsigned FERR : 1;
1439 unsigned ADDEN : 1;
1440 unsigned CREN : 1;
1441 unsigned SREN : 1;
1442 unsigned RX9 : 1;
1443 unsigned SPEN : 1;
1444 } __RCSTAbits_t;
1446 extern __at(0x019D) volatile __RCSTAbits_t RCSTAbits;
1448 #define _RX9D 0x01
1449 #define _OERR 0x02
1450 #define _FERR 0x04
1451 #define _ADDEN 0x08
1452 #define _CREN 0x10
1453 #define _SREN 0x20
1454 #define _RX9 0x40
1455 #define _SPEN 0x80
1457 //==============================================================================
1460 //==============================================================================
1461 // TXSTA Bits
1463 extern __at(0x019E) __sfr TXSTA;
1465 typedef struct
1467 unsigned TX9D : 1;
1468 unsigned TRMT : 1;
1469 unsigned BRGH : 1;
1470 unsigned SENDB : 1;
1471 unsigned SYNC : 1;
1472 unsigned TXEN : 1;
1473 unsigned TX9 : 1;
1474 unsigned CSRC : 1;
1475 } __TXSTAbits_t;
1477 extern __at(0x019E) volatile __TXSTAbits_t TXSTAbits;
1479 #define _TX9D 0x01
1480 #define _TRMT 0x02
1481 #define _BRGH 0x04
1482 #define _SENDB 0x08
1483 #define _SYNC 0x10
1484 #define _TXEN 0x20
1485 #define _TX9 0x40
1486 #define _CSRC 0x80
1488 //==============================================================================
1491 //==============================================================================
1492 // BAUDCON Bits
1494 extern __at(0x019F) __sfr BAUDCON;
1496 typedef struct
1498 unsigned ABDEN : 1;
1499 unsigned WUE : 1;
1500 unsigned : 1;
1501 unsigned BRG16 : 1;
1502 unsigned SCKP : 1;
1503 unsigned : 1;
1504 unsigned RCIDL : 1;
1505 unsigned ABDOVF : 1;
1506 } __BAUDCONbits_t;
1508 extern __at(0x019F) volatile __BAUDCONbits_t BAUDCONbits;
1510 #define _ABDEN 0x01
1511 #define _WUE 0x02
1512 #define _BRG16 0x08
1513 #define _SCKP 0x10
1514 #define _RCIDL 0x40
1515 #define _ABDOVF 0x80
1517 //==============================================================================
1520 //==============================================================================
1521 // WPUA Bits
1523 extern __at(0x020C) __sfr WPUA;
1525 typedef union
1527 struct
1529 unsigned WPUA0 : 1;
1530 unsigned WPUA1 : 1;
1531 unsigned WPUA2 : 1;
1532 unsigned WPUA3 : 1;
1533 unsigned WPUA4 : 1;
1534 unsigned WPUA5 : 1;
1535 unsigned : 1;
1536 unsigned : 1;
1539 struct
1541 unsigned WPUA : 6;
1542 unsigned : 2;
1544 } __WPUAbits_t;
1546 extern __at(0x020C) volatile __WPUAbits_t WPUAbits;
1548 #define _WPUA0 0x01
1549 #define _WPUA1 0x02
1550 #define _WPUA2 0x04
1551 #define _WPUA3 0x08
1552 #define _WPUA4 0x10
1553 #define _WPUA5 0x20
1555 //==============================================================================
1557 extern __at(0x0211) __sfr SSP1BUF;
1558 extern __at(0x0211) __sfr SSPBUF;
1559 extern __at(0x0212) __sfr SSP1ADD;
1560 extern __at(0x0212) __sfr SSPADD;
1561 extern __at(0x0213) __sfr SSP1MSK;
1562 extern __at(0x0213) __sfr SSPMSK;
1564 //==============================================================================
1565 // SSP1STAT Bits
1567 extern __at(0x0214) __sfr SSP1STAT;
1569 typedef struct
1571 unsigned BF : 1;
1572 unsigned UA : 1;
1573 unsigned R_NOT_W : 1;
1574 unsigned S : 1;
1575 unsigned P : 1;
1576 unsigned D_NOT_A : 1;
1577 unsigned CKE : 1;
1578 unsigned SMP : 1;
1579 } __SSP1STATbits_t;
1581 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits;
1583 #define _BF 0x01
1584 #define _UA 0x02
1585 #define _R_NOT_W 0x04
1586 #define _S 0x08
1587 #define _P 0x10
1588 #define _D_NOT_A 0x20
1589 #define _CKE 0x40
1590 #define _SMP 0x80
1592 //==============================================================================
1595 //==============================================================================
1596 // SSPSTAT Bits
1598 extern __at(0x0214) __sfr SSPSTAT;
1600 typedef struct
1602 unsigned BF : 1;
1603 unsigned UA : 1;
1604 unsigned R_NOT_W : 1;
1605 unsigned S : 1;
1606 unsigned P : 1;
1607 unsigned D_NOT_A : 1;
1608 unsigned CKE : 1;
1609 unsigned SMP : 1;
1610 } __SSPSTATbits_t;
1612 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits;
1614 #define _SSPSTAT_BF 0x01
1615 #define _SSPSTAT_UA 0x02
1616 #define _SSPSTAT_R_NOT_W 0x04
1617 #define _SSPSTAT_S 0x08
1618 #define _SSPSTAT_P 0x10
1619 #define _SSPSTAT_D_NOT_A 0x20
1620 #define _SSPSTAT_CKE 0x40
1621 #define _SSPSTAT_SMP 0x80
1623 //==============================================================================
1626 //==============================================================================
1627 // SSP1CON1 Bits
1629 extern __at(0x0215) __sfr SSP1CON1;
1631 typedef union
1633 struct
1635 unsigned SSPM0 : 1;
1636 unsigned SSPM1 : 1;
1637 unsigned SSPM2 : 1;
1638 unsigned SSPM3 : 1;
1639 unsigned CKP : 1;
1640 unsigned SSPEN : 1;
1641 unsigned SSPOV : 1;
1642 unsigned WCOL : 1;
1645 struct
1647 unsigned SSPM : 4;
1648 unsigned : 4;
1650 } __SSP1CON1bits_t;
1652 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits;
1654 #define _SSPM0 0x01
1655 #define _SSPM1 0x02
1656 #define _SSPM2 0x04
1657 #define _SSPM3 0x08
1658 #define _CKP 0x10
1659 #define _SSPEN 0x20
1660 #define _SSPOV 0x40
1661 #define _WCOL 0x80
1663 //==============================================================================
1666 //==============================================================================
1667 // SSPCON Bits
1669 extern __at(0x0215) __sfr SSPCON;
1671 typedef union
1673 struct
1675 unsigned SSPM0 : 1;
1676 unsigned SSPM1 : 1;
1677 unsigned SSPM2 : 1;
1678 unsigned SSPM3 : 1;
1679 unsigned CKP : 1;
1680 unsigned SSPEN : 1;
1681 unsigned SSPOV : 1;
1682 unsigned WCOL : 1;
1685 struct
1687 unsigned SSPM : 4;
1688 unsigned : 4;
1690 } __SSPCONbits_t;
1692 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits;
1694 #define _SSPCON_SSPM0 0x01
1695 #define _SSPCON_SSPM1 0x02
1696 #define _SSPCON_SSPM2 0x04
1697 #define _SSPCON_SSPM3 0x08
1698 #define _SSPCON_CKP 0x10
1699 #define _SSPCON_SSPEN 0x20
1700 #define _SSPCON_SSPOV 0x40
1701 #define _SSPCON_WCOL 0x80
1703 //==============================================================================
1706 //==============================================================================
1707 // SSPCON1 Bits
1709 extern __at(0x0215) __sfr SSPCON1;
1711 typedef union
1713 struct
1715 unsigned SSPM0 : 1;
1716 unsigned SSPM1 : 1;
1717 unsigned SSPM2 : 1;
1718 unsigned SSPM3 : 1;
1719 unsigned CKP : 1;
1720 unsigned SSPEN : 1;
1721 unsigned SSPOV : 1;
1722 unsigned WCOL : 1;
1725 struct
1727 unsigned SSPM : 4;
1728 unsigned : 4;
1730 } __SSPCON1bits_t;
1732 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits;
1734 #define _SSPCON1_SSPM0 0x01
1735 #define _SSPCON1_SSPM1 0x02
1736 #define _SSPCON1_SSPM2 0x04
1737 #define _SSPCON1_SSPM3 0x08
1738 #define _SSPCON1_CKP 0x10
1739 #define _SSPCON1_SSPEN 0x20
1740 #define _SSPCON1_SSPOV 0x40
1741 #define _SSPCON1_WCOL 0x80
1743 //==============================================================================
1746 //==============================================================================
1747 // SSP1CON2 Bits
1749 extern __at(0x0216) __sfr SSP1CON2;
1751 typedef struct
1753 unsigned SEN : 1;
1754 unsigned RSEN : 1;
1755 unsigned PEN : 1;
1756 unsigned RCEN : 1;
1757 unsigned ACKEN : 1;
1758 unsigned ACKDT : 1;
1759 unsigned ACKSTAT : 1;
1760 unsigned GCEN : 1;
1761 } __SSP1CON2bits_t;
1763 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits;
1765 #define _SEN 0x01
1766 #define _RSEN 0x02
1767 #define _PEN 0x04
1768 #define _RCEN 0x08
1769 #define _ACKEN 0x10
1770 #define _ACKDT 0x20
1771 #define _ACKSTAT 0x40
1772 #define _GCEN 0x80
1774 //==============================================================================
1777 //==============================================================================
1778 // SSPCON2 Bits
1780 extern __at(0x0216) __sfr SSPCON2;
1782 typedef struct
1784 unsigned SEN : 1;
1785 unsigned RSEN : 1;
1786 unsigned PEN : 1;
1787 unsigned RCEN : 1;
1788 unsigned ACKEN : 1;
1789 unsigned ACKDT : 1;
1790 unsigned ACKSTAT : 1;
1791 unsigned GCEN : 1;
1792 } __SSPCON2bits_t;
1794 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits;
1796 #define _SSPCON2_SEN 0x01
1797 #define _SSPCON2_RSEN 0x02
1798 #define _SSPCON2_PEN 0x04
1799 #define _SSPCON2_RCEN 0x08
1800 #define _SSPCON2_ACKEN 0x10
1801 #define _SSPCON2_ACKDT 0x20
1802 #define _SSPCON2_ACKSTAT 0x40
1803 #define _SSPCON2_GCEN 0x80
1805 //==============================================================================
1808 //==============================================================================
1809 // SSP1CON3 Bits
1811 extern __at(0x0217) __sfr SSP1CON3;
1813 typedef struct
1815 unsigned DHEN : 1;
1816 unsigned AHEN : 1;
1817 unsigned SBCDE : 1;
1818 unsigned SDAHT : 1;
1819 unsigned BOEN : 1;
1820 unsigned SCIE : 1;
1821 unsigned PCIE : 1;
1822 unsigned ACKTIM : 1;
1823 } __SSP1CON3bits_t;
1825 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits;
1827 #define _DHEN 0x01
1828 #define _AHEN 0x02
1829 #define _SBCDE 0x04
1830 #define _SDAHT 0x08
1831 #define _BOEN 0x10
1832 #define _SCIE 0x20
1833 #define _PCIE 0x40
1834 #define _ACKTIM 0x80
1836 //==============================================================================
1839 //==============================================================================
1840 // SSPCON3 Bits
1842 extern __at(0x0217) __sfr SSPCON3;
1844 typedef struct
1846 unsigned DHEN : 1;
1847 unsigned AHEN : 1;
1848 unsigned SBCDE : 1;
1849 unsigned SDAHT : 1;
1850 unsigned BOEN : 1;
1851 unsigned SCIE : 1;
1852 unsigned PCIE : 1;
1853 unsigned ACKTIM : 1;
1854 } __SSPCON3bits_t;
1856 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits;
1858 #define _SSPCON3_DHEN 0x01
1859 #define _SSPCON3_AHEN 0x02
1860 #define _SSPCON3_SBCDE 0x04
1861 #define _SSPCON3_SDAHT 0x08
1862 #define _SSPCON3_BOEN 0x10
1863 #define _SSPCON3_SCIE 0x20
1864 #define _SSPCON3_PCIE 0x40
1865 #define _SSPCON3_ACKTIM 0x80
1867 //==============================================================================
1870 //==============================================================================
1871 // IOCAP Bits
1873 extern __at(0x0391) __sfr IOCAP;
1875 typedef union
1877 struct
1879 unsigned IOCAP0 : 1;
1880 unsigned IOCAP1 : 1;
1881 unsigned IOCAP2 : 1;
1882 unsigned IOCAP3 : 1;
1883 unsigned IOCAP4 : 1;
1884 unsigned IOCAP5 : 1;
1885 unsigned : 1;
1886 unsigned : 1;
1889 struct
1891 unsigned IOCAP : 6;
1892 unsigned : 2;
1894 } __IOCAPbits_t;
1896 extern __at(0x0391) volatile __IOCAPbits_t IOCAPbits;
1898 #define _IOCAP0 0x01
1899 #define _IOCAP1 0x02
1900 #define _IOCAP2 0x04
1901 #define _IOCAP3 0x08
1902 #define _IOCAP4 0x10
1903 #define _IOCAP5 0x20
1905 //==============================================================================
1908 //==============================================================================
1909 // IOCAN Bits
1911 extern __at(0x0392) __sfr IOCAN;
1913 typedef union
1915 struct
1917 unsigned IOCAN0 : 1;
1918 unsigned IOCAN1 : 1;
1919 unsigned IOCAN2 : 1;
1920 unsigned IOCAN3 : 1;
1921 unsigned IOCAN4 : 1;
1922 unsigned IOCAN5 : 1;
1923 unsigned : 1;
1924 unsigned : 1;
1927 struct
1929 unsigned IOCAN : 6;
1930 unsigned : 2;
1932 } __IOCANbits_t;
1934 extern __at(0x0392) volatile __IOCANbits_t IOCANbits;
1936 #define _IOCAN0 0x01
1937 #define _IOCAN1 0x02
1938 #define _IOCAN2 0x04
1939 #define _IOCAN3 0x08
1940 #define _IOCAN4 0x10
1941 #define _IOCAN5 0x20
1943 //==============================================================================
1946 //==============================================================================
1947 // IOCAF Bits
1949 extern __at(0x0393) __sfr IOCAF;
1951 typedef union
1953 struct
1955 unsigned IOCAF0 : 1;
1956 unsigned IOCAF1 : 1;
1957 unsigned IOCAF2 : 1;
1958 unsigned IOCAF3 : 1;
1959 unsigned IOCAF4 : 1;
1960 unsigned IOCAF5 : 1;
1961 unsigned : 1;
1962 unsigned : 1;
1965 struct
1967 unsigned IOCAF : 6;
1968 unsigned : 2;
1970 } __IOCAFbits_t;
1972 extern __at(0x0393) volatile __IOCAFbits_t IOCAFbits;
1974 #define _IOCAF0 0x01
1975 #define _IOCAF1 0x02
1976 #define _IOCAF2 0x04
1977 #define _IOCAF3 0x08
1978 #define _IOCAF4 0x10
1979 #define _IOCAF5 0x20
1981 //==============================================================================
1984 //==============================================================================
1985 // PWM1DCL Bits
1987 extern __at(0x0611) __sfr PWM1DCL;
1989 typedef union
1991 struct
1993 unsigned : 1;
1994 unsigned : 1;
1995 unsigned : 1;
1996 unsigned : 1;
1997 unsigned : 1;
1998 unsigned : 1;
1999 unsigned PWM1DCL0 : 1;
2000 unsigned PWM1DCL1 : 1;
2003 struct
2005 unsigned : 6;
2006 unsigned PWM1DCL : 2;
2008 } __PWM1DCLbits_t;
2010 extern __at(0x0611) volatile __PWM1DCLbits_t PWM1DCLbits;
2012 #define _PWM1DCL0 0x40
2013 #define _PWM1DCL1 0x80
2015 //==============================================================================
2018 //==============================================================================
2019 // PWM1DCH Bits
2021 extern __at(0x0612) __sfr PWM1DCH;
2023 typedef struct
2025 unsigned PWM1DCH0 : 1;
2026 unsigned PWM1DCH1 : 1;
2027 unsigned PWM1DCH2 : 1;
2028 unsigned PWM1DCH3 : 1;
2029 unsigned PWM1DCH4 : 1;
2030 unsigned PWM1DCH5 : 1;
2031 unsigned PWM1DCH6 : 1;
2032 unsigned PWM1DCH7 : 1;
2033 } __PWM1DCHbits_t;
2035 extern __at(0x0612) volatile __PWM1DCHbits_t PWM1DCHbits;
2037 #define _PWM1DCH0 0x01
2038 #define _PWM1DCH1 0x02
2039 #define _PWM1DCH2 0x04
2040 #define _PWM1DCH3 0x08
2041 #define _PWM1DCH4 0x10
2042 #define _PWM1DCH5 0x20
2043 #define _PWM1DCH6 0x40
2044 #define _PWM1DCH7 0x80
2046 //==============================================================================
2049 //==============================================================================
2050 // PWM1CON Bits
2052 extern __at(0x0613) __sfr PWM1CON;
2054 typedef struct
2056 unsigned : 1;
2057 unsigned : 1;
2058 unsigned : 1;
2059 unsigned : 1;
2060 unsigned PWM1POL : 1;
2061 unsigned PWM1OUT : 1;
2062 unsigned PWM1OE : 1;
2063 unsigned PWM1EN : 1;
2064 } __PWM1CONbits_t;
2066 extern __at(0x0613) volatile __PWM1CONbits_t PWM1CONbits;
2068 #define _PWM1POL 0x10
2069 #define _PWM1OUT 0x20
2070 #define _PWM1OE 0x40
2071 #define _PWM1EN 0x80
2073 //==============================================================================
2076 //==============================================================================
2077 // PWM1CON0 Bits
2079 extern __at(0x0613) __sfr PWM1CON0;
2081 typedef struct
2083 unsigned : 1;
2084 unsigned : 1;
2085 unsigned : 1;
2086 unsigned : 1;
2087 unsigned PWM1POL : 1;
2088 unsigned PWM1OUT : 1;
2089 unsigned PWM1OE : 1;
2090 unsigned PWM1EN : 1;
2091 } __PWM1CON0bits_t;
2093 extern __at(0x0613) volatile __PWM1CON0bits_t PWM1CON0bits;
2095 #define _PWM1CON0_PWM1POL 0x10
2096 #define _PWM1CON0_PWM1OUT 0x20
2097 #define _PWM1CON0_PWM1OE 0x40
2098 #define _PWM1CON0_PWM1EN 0x80
2100 //==============================================================================
2103 //==============================================================================
2104 // PWM2DCL Bits
2106 extern __at(0x0614) __sfr PWM2DCL;
2108 typedef union
2110 struct
2112 unsigned : 1;
2113 unsigned : 1;
2114 unsigned : 1;
2115 unsigned : 1;
2116 unsigned : 1;
2117 unsigned : 1;
2118 unsigned PWM2DCL0 : 1;
2119 unsigned PWM2DCL1 : 1;
2122 struct
2124 unsigned : 6;
2125 unsigned PWM2DCL : 2;
2127 } __PWM2DCLbits_t;
2129 extern __at(0x0614) volatile __PWM2DCLbits_t PWM2DCLbits;
2131 #define _PWM2DCL0 0x40
2132 #define _PWM2DCL1 0x80
2134 //==============================================================================
2137 //==============================================================================
2138 // PWM2DCH Bits
2140 extern __at(0x0615) __sfr PWM2DCH;
2142 typedef struct
2144 unsigned PWM2DCH0 : 1;
2145 unsigned PWM2DCH1 : 1;
2146 unsigned PWM2DCH2 : 1;
2147 unsigned PWM2DCH3 : 1;
2148 unsigned PWM2DCH4 : 1;
2149 unsigned PWM2DCH5 : 1;
2150 unsigned PWM2DCH6 : 1;
2151 unsigned PWM2DCH7 : 1;
2152 } __PWM2DCHbits_t;
2154 extern __at(0x0615) volatile __PWM2DCHbits_t PWM2DCHbits;
2156 #define _PWM2DCH0 0x01
2157 #define _PWM2DCH1 0x02
2158 #define _PWM2DCH2 0x04
2159 #define _PWM2DCH3 0x08
2160 #define _PWM2DCH4 0x10
2161 #define _PWM2DCH5 0x20
2162 #define _PWM2DCH6 0x40
2163 #define _PWM2DCH7 0x80
2165 //==============================================================================
2168 //==============================================================================
2169 // PWM2CON Bits
2171 extern __at(0x0616) __sfr PWM2CON;
2173 typedef struct
2175 unsigned : 1;
2176 unsigned : 1;
2177 unsigned : 1;
2178 unsigned : 1;
2179 unsigned PWM2POL : 1;
2180 unsigned PWM2OUT : 1;
2181 unsigned PWM2OE : 1;
2182 unsigned PWM2EN : 1;
2183 } __PWM2CONbits_t;
2185 extern __at(0x0616) volatile __PWM2CONbits_t PWM2CONbits;
2187 #define _PWM2POL 0x10
2188 #define _PWM2OUT 0x20
2189 #define _PWM2OE 0x40
2190 #define _PWM2EN 0x80
2192 //==============================================================================
2195 //==============================================================================
2196 // PWM2CON0 Bits
2198 extern __at(0x0616) __sfr PWM2CON0;
2200 typedef struct
2202 unsigned : 1;
2203 unsigned : 1;
2204 unsigned : 1;
2205 unsigned : 1;
2206 unsigned PWM2POL : 1;
2207 unsigned PWM2OUT : 1;
2208 unsigned PWM2OE : 1;
2209 unsigned PWM2EN : 1;
2210 } __PWM2CON0bits_t;
2212 extern __at(0x0616) volatile __PWM2CON0bits_t PWM2CON0bits;
2214 #define _PWM2CON0_PWM2POL 0x10
2215 #define _PWM2CON0_PWM2OUT 0x20
2216 #define _PWM2CON0_PWM2OE 0x40
2217 #define _PWM2CON0_PWM2EN 0x80
2219 //==============================================================================
2222 //==============================================================================
2223 // AAD1CON0 Bits
2225 extern __at(0x0711) __sfr AAD1CON0;
2227 typedef union
2229 struct
2231 unsigned ADON : 1;
2232 unsigned GO : 1;
2233 unsigned CHS0 : 1;
2234 unsigned CHS1 : 1;
2235 unsigned CHS2 : 1;
2236 unsigned CHS3 : 1;
2237 unsigned CHS4 : 1;
2238 unsigned : 1;
2241 struct
2243 unsigned : 1;
2244 unsigned GO_NOT_DONE : 1;
2245 unsigned : 1;
2246 unsigned : 1;
2247 unsigned : 1;
2248 unsigned : 1;
2249 unsigned : 1;
2250 unsigned : 1;
2253 struct
2255 unsigned : 1;
2256 unsigned GO_NOT_DONE1 : 1;
2257 unsigned : 1;
2258 unsigned : 1;
2259 unsigned : 1;
2260 unsigned : 1;
2261 unsigned : 1;
2262 unsigned : 1;
2265 struct
2267 unsigned : 2;
2268 unsigned CHS : 5;
2269 unsigned : 1;
2271 } __AAD1CON0bits_t;
2273 extern __at(0x0711) volatile __AAD1CON0bits_t AAD1CON0bits;
2275 #define _ADON 0x01
2276 #define _GO 0x02
2277 #define _GO_NOT_DONE 0x02
2278 #define _GO_NOT_DONE1 0x02
2279 #define _CHS0 0x04
2280 #define _CHS1 0x08
2281 #define _CHS2 0x10
2282 #define _CHS3 0x20
2283 #define _CHS4 0x40
2285 //==============================================================================
2288 //==============================================================================
2289 // AADCON0 Bits
2291 extern __at(0x0711) __sfr AADCON0;
2293 typedef union
2295 struct
2297 unsigned ADON : 1;
2298 unsigned GO : 1;
2299 unsigned CHS0 : 1;
2300 unsigned CHS1 : 1;
2301 unsigned CHS2 : 1;
2302 unsigned CHS3 : 1;
2303 unsigned CHS4 : 1;
2304 unsigned : 1;
2307 struct
2309 unsigned : 1;
2310 unsigned GO_NOT_DONE : 1;
2311 unsigned : 1;
2312 unsigned : 1;
2313 unsigned : 1;
2314 unsigned : 1;
2315 unsigned : 1;
2316 unsigned : 1;
2319 struct
2321 unsigned : 1;
2322 unsigned GO_NOT_DONE1 : 1;
2323 unsigned : 1;
2324 unsigned : 1;
2325 unsigned : 1;
2326 unsigned : 1;
2327 unsigned : 1;
2328 unsigned : 1;
2331 struct
2333 unsigned : 2;
2334 unsigned CHS : 5;
2335 unsigned : 1;
2337 } __AADCON0bits_t;
2339 extern __at(0x0711) volatile __AADCON0bits_t AADCON0bits;
2341 #define _AADCON0_ADON 0x01
2342 #define _AADCON0_GO 0x02
2343 #define _AADCON0_GO_NOT_DONE 0x02
2344 #define _AADCON0_GO_NOT_DONE1 0x02
2345 #define _AADCON0_CHS0 0x04
2346 #define _AADCON0_CHS1 0x08
2347 #define _AADCON0_CHS2 0x10
2348 #define _AADCON0_CHS3 0x20
2349 #define _AADCON0_CHS4 0x40
2351 //==============================================================================
2354 //==============================================================================
2355 // AD1CON0 Bits
2357 extern __at(0x0711) __sfr AD1CON0;
2359 typedef union
2361 struct
2363 unsigned ADON : 1;
2364 unsigned GO : 1;
2365 unsigned CHS0 : 1;
2366 unsigned CHS1 : 1;
2367 unsigned CHS2 : 1;
2368 unsigned CHS3 : 1;
2369 unsigned CHS4 : 1;
2370 unsigned : 1;
2373 struct
2375 unsigned : 1;
2376 unsigned GO_NOT_DONE : 1;
2377 unsigned : 1;
2378 unsigned : 1;
2379 unsigned : 1;
2380 unsigned : 1;
2381 unsigned : 1;
2382 unsigned : 1;
2385 struct
2387 unsigned : 1;
2388 unsigned GO_NOT_DONE1 : 1;
2389 unsigned : 1;
2390 unsigned : 1;
2391 unsigned : 1;
2392 unsigned : 1;
2393 unsigned : 1;
2394 unsigned : 1;
2397 struct
2399 unsigned : 2;
2400 unsigned CHS : 5;
2401 unsigned : 1;
2403 } __AD1CON0bits_t;
2405 extern __at(0x0711) volatile __AD1CON0bits_t AD1CON0bits;
2407 #define _AD1CON0_ADON 0x01
2408 #define _AD1CON0_GO 0x02
2409 #define _AD1CON0_GO_NOT_DONE 0x02
2410 #define _AD1CON0_GO_NOT_DONE1 0x02
2411 #define _AD1CON0_CHS0 0x04
2412 #define _AD1CON0_CHS1 0x08
2413 #define _AD1CON0_CHS2 0x10
2414 #define _AD1CON0_CHS3 0x20
2415 #define _AD1CON0_CHS4 0x40
2417 //==============================================================================
2420 //==============================================================================
2421 // AADCON1 Bits
2423 extern __at(0x0712) __sfr AADCON1;
2425 typedef union
2427 struct
2429 unsigned ADPREF0 : 1;
2430 unsigned ADPREF1 : 1;
2431 unsigned GO_NOT_DONE_ALL : 1;
2432 unsigned : 1;
2433 unsigned ADCS0 : 1;
2434 unsigned ADCS1 : 1;
2435 unsigned ADCS2 : 1;
2436 unsigned ADFM : 1;
2439 struct
2441 unsigned : 1;
2442 unsigned : 1;
2443 unsigned GO_ALL : 1;
2444 unsigned : 1;
2445 unsigned : 1;
2446 unsigned : 1;
2447 unsigned : 1;
2448 unsigned : 1;
2451 struct
2453 unsigned ADPREF : 2;
2454 unsigned : 6;
2457 struct
2459 unsigned : 4;
2460 unsigned ADCS : 3;
2461 unsigned : 1;
2463 } __AADCON1bits_t;
2465 extern __at(0x0712) volatile __AADCON1bits_t AADCON1bits;
2467 #define _ADPREF0 0x01
2468 #define _ADPREF1 0x02
2469 #define _GO_NOT_DONE_ALL 0x04
2470 #define _GO_ALL 0x04
2471 #define _ADCS0 0x10
2472 #define _ADCS1 0x20
2473 #define _ADCS2 0x40
2474 #define _ADFM 0x80
2476 //==============================================================================
2479 //==============================================================================
2480 // ADCOMCON Bits
2482 extern __at(0x0712) __sfr ADCOMCON;
2484 typedef union
2486 struct
2488 unsigned ADPREF0 : 1;
2489 unsigned ADPREF1 : 1;
2490 unsigned GO_NOT_DONE_ALL : 1;
2491 unsigned : 1;
2492 unsigned ADCS0 : 1;
2493 unsigned ADCS1 : 1;
2494 unsigned ADCS2 : 1;
2495 unsigned ADFM : 1;
2498 struct
2500 unsigned : 1;
2501 unsigned : 1;
2502 unsigned GO_ALL : 1;
2503 unsigned : 1;
2504 unsigned : 1;
2505 unsigned : 1;
2506 unsigned : 1;
2507 unsigned : 1;
2510 struct
2512 unsigned ADPREF : 2;
2513 unsigned : 6;
2516 struct
2518 unsigned : 4;
2519 unsigned ADCS : 3;
2520 unsigned : 1;
2522 } __ADCOMCONbits_t;
2524 extern __at(0x0712) volatile __ADCOMCONbits_t ADCOMCONbits;
2526 #define _ADCOMCON_ADPREF0 0x01
2527 #define _ADCOMCON_ADPREF1 0x02
2528 #define _ADCOMCON_GO_NOT_DONE_ALL 0x04
2529 #define _ADCOMCON_GO_ALL 0x04
2530 #define _ADCOMCON_ADCS0 0x10
2531 #define _ADCOMCON_ADCS1 0x20
2532 #define _ADCOMCON_ADCS2 0x40
2533 #define _ADCOMCON_ADFM 0x80
2535 //==============================================================================
2538 //==============================================================================
2539 // AAD1CON2 Bits
2541 extern __at(0x0713) __sfr AAD1CON2;
2543 typedef union
2545 struct
2547 unsigned : 1;
2548 unsigned : 1;
2549 unsigned : 1;
2550 unsigned : 1;
2551 unsigned TRIGSEL0 : 1;
2552 unsigned TRIGSEL1 : 1;
2553 unsigned TRIGSEL2 : 1;
2554 unsigned : 1;
2557 struct
2559 unsigned : 4;
2560 unsigned TRIGSEL : 3;
2561 unsigned : 1;
2563 } __AAD1CON2bits_t;
2565 extern __at(0x0713) volatile __AAD1CON2bits_t AAD1CON2bits;
2567 #define _TRIGSEL0 0x10
2568 #define _TRIGSEL1 0x20
2569 #define _TRIGSEL2 0x40
2571 //==============================================================================
2574 //==============================================================================
2575 // AADCON2 Bits
2577 extern __at(0x0713) __sfr AADCON2;
2579 typedef union
2581 struct
2583 unsigned : 1;
2584 unsigned : 1;
2585 unsigned : 1;
2586 unsigned : 1;
2587 unsigned TRIGSEL0 : 1;
2588 unsigned TRIGSEL1 : 1;
2589 unsigned TRIGSEL2 : 1;
2590 unsigned : 1;
2593 struct
2595 unsigned : 4;
2596 unsigned TRIGSEL : 3;
2597 unsigned : 1;
2599 } __AADCON2bits_t;
2601 extern __at(0x0713) volatile __AADCON2bits_t AADCON2bits;
2603 #define _AADCON2_TRIGSEL0 0x10
2604 #define _AADCON2_TRIGSEL1 0x20
2605 #define _AADCON2_TRIGSEL2 0x40
2607 //==============================================================================
2610 //==============================================================================
2611 // AD1CON2 Bits
2613 extern __at(0x0713) __sfr AD1CON2;
2615 typedef union
2617 struct
2619 unsigned : 1;
2620 unsigned : 1;
2621 unsigned : 1;
2622 unsigned : 1;
2623 unsigned TRIGSEL0 : 1;
2624 unsigned TRIGSEL1 : 1;
2625 unsigned TRIGSEL2 : 1;
2626 unsigned : 1;
2629 struct
2631 unsigned : 4;
2632 unsigned TRIGSEL : 3;
2633 unsigned : 1;
2635 } __AD1CON2bits_t;
2637 extern __at(0x0713) volatile __AD1CON2bits_t AD1CON2bits;
2639 #define _AD1CON2_TRIGSEL0 0x10
2640 #define _AD1CON2_TRIGSEL1 0x20
2641 #define _AD1CON2_TRIGSEL2 0x40
2643 //==============================================================================
2646 //==============================================================================
2647 // AAD1CON3 Bits
2649 extern __at(0x0714) __sfr AAD1CON3;
2651 typedef union
2653 struct
2655 unsigned AD1DSEN : 1;
2656 unsigned AD1IPEN : 1;
2657 unsigned : 1;
2658 unsigned : 1;
2659 unsigned : 1;
2660 unsigned : 1;
2661 unsigned AD1IPPOL : 1;
2662 unsigned AD1EPPOL : 1;
2665 struct
2667 unsigned ADDSEN : 1;
2668 unsigned ADIPEN : 1;
2669 unsigned : 1;
2670 unsigned : 1;
2671 unsigned : 1;
2672 unsigned : 1;
2673 unsigned ADIPPOL : 1;
2674 unsigned ADEPPOL : 1;
2676 } __AAD1CON3bits_t;
2678 extern __at(0x0714) volatile __AAD1CON3bits_t AAD1CON3bits;
2680 #define _AD1DSEN 0x01
2681 #define _ADDSEN 0x01
2682 #define _AD1IPEN 0x02
2683 #define _ADIPEN 0x02
2684 #define _AD1IPPOL 0x40
2685 #define _ADIPPOL 0x40
2686 #define _AD1EPPOL 0x80
2687 #define _ADEPPOL 0x80
2689 //==============================================================================
2692 //==============================================================================
2693 // AADCON3 Bits
2695 extern __at(0x0714) __sfr AADCON3;
2697 typedef union
2699 struct
2701 unsigned AD1DSEN : 1;
2702 unsigned AD1IPEN : 1;
2703 unsigned : 1;
2704 unsigned : 1;
2705 unsigned : 1;
2706 unsigned : 1;
2707 unsigned AD1IPPOL : 1;
2708 unsigned AD1EPPOL : 1;
2711 struct
2713 unsigned ADDSEN : 1;
2714 unsigned ADIPEN : 1;
2715 unsigned : 1;
2716 unsigned : 1;
2717 unsigned : 1;
2718 unsigned : 1;
2719 unsigned ADIPPOL : 1;
2720 unsigned ADEPPOL : 1;
2722 } __AADCON3bits_t;
2724 extern __at(0x0714) volatile __AADCON3bits_t AADCON3bits;
2726 #define _AADCON3_AD1DSEN 0x01
2727 #define _AADCON3_ADDSEN 0x01
2728 #define _AADCON3_AD1IPEN 0x02
2729 #define _AADCON3_ADIPEN 0x02
2730 #define _AADCON3_AD1IPPOL 0x40
2731 #define _AADCON3_ADIPPOL 0x40
2732 #define _AADCON3_AD1EPPOL 0x80
2733 #define _AADCON3_ADEPPOL 0x80
2735 //==============================================================================
2738 //==============================================================================
2739 // AD1CON3 Bits
2741 extern __at(0x0714) __sfr AD1CON3;
2743 typedef union
2745 struct
2747 unsigned AD1DSEN : 1;
2748 unsigned AD1IPEN : 1;
2749 unsigned : 1;
2750 unsigned : 1;
2751 unsigned : 1;
2752 unsigned : 1;
2753 unsigned AD1IPPOL : 1;
2754 unsigned AD1EPPOL : 1;
2757 struct
2759 unsigned ADDSEN : 1;
2760 unsigned ADIPEN : 1;
2761 unsigned : 1;
2762 unsigned : 1;
2763 unsigned : 1;
2764 unsigned : 1;
2765 unsigned ADIPPOL : 1;
2766 unsigned ADEPPOL : 1;
2768 } __AD1CON3bits_t;
2770 extern __at(0x0714) volatile __AD1CON3bits_t AD1CON3bits;
2772 #define _AD1CON3_AD1DSEN 0x01
2773 #define _AD1CON3_ADDSEN 0x01
2774 #define _AD1CON3_AD1IPEN 0x02
2775 #define _AD1CON3_ADIPEN 0x02
2776 #define _AD1CON3_AD1IPPOL 0x40
2777 #define _AD1CON3_ADIPPOL 0x40
2778 #define _AD1CON3_AD1EPPOL 0x80
2779 #define _AD1CON3_ADEPPOL 0x80
2781 //==============================================================================
2784 //==============================================================================
2785 // AADSTAT Bits
2787 extern __at(0x0715) __sfr AADSTAT;
2789 typedef union
2791 struct
2793 unsigned AD1STG0 : 1;
2794 unsigned AD1STG1 : 1;
2795 unsigned AD1CONV : 1;
2796 unsigned : 1;
2797 unsigned AD2STG0 : 1;
2798 unsigned AD2STG1 : 1;
2799 unsigned AD2CONV : 1;
2800 unsigned : 1;
2803 struct
2805 unsigned : 1;
2806 unsigned : 1;
2807 unsigned ADCONV : 1;
2808 unsigned : 1;
2809 unsigned : 1;
2810 unsigned : 1;
2811 unsigned : 1;
2812 unsigned : 1;
2815 struct
2817 unsigned AD1STG : 2;
2818 unsigned : 6;
2821 struct
2823 unsigned : 4;
2824 unsigned AD2STG : 2;
2825 unsigned : 2;
2827 } __AADSTATbits_t;
2829 extern __at(0x0715) volatile __AADSTATbits_t AADSTATbits;
2831 #define _AD1STG0 0x01
2832 #define _AD1STG1 0x02
2833 #define _AD1CONV 0x04
2834 #define _ADCONV 0x04
2835 #define _AD2STG0 0x10
2836 #define _AD2STG1 0x20
2837 #define _AD2CONV 0x40
2839 //==============================================================================
2842 //==============================================================================
2843 // ADSTAT Bits
2845 extern __at(0x0715) __sfr ADSTAT;
2847 typedef union
2849 struct
2851 unsigned AD1STG0 : 1;
2852 unsigned AD1STG1 : 1;
2853 unsigned AD1CONV : 1;
2854 unsigned : 1;
2855 unsigned AD2STG0 : 1;
2856 unsigned AD2STG1 : 1;
2857 unsigned AD2CONV : 1;
2858 unsigned : 1;
2861 struct
2863 unsigned : 1;
2864 unsigned : 1;
2865 unsigned ADCONV : 1;
2866 unsigned : 1;
2867 unsigned : 1;
2868 unsigned : 1;
2869 unsigned : 1;
2870 unsigned : 1;
2873 struct
2875 unsigned AD1STG : 2;
2876 unsigned : 6;
2879 struct
2881 unsigned : 4;
2882 unsigned AD2STG : 2;
2883 unsigned : 2;
2885 } __ADSTATbits_t;
2887 extern __at(0x0715) volatile __ADSTATbits_t ADSTATbits;
2889 #define _ADSTAT_AD1STG0 0x01
2890 #define _ADSTAT_AD1STG1 0x02
2891 #define _ADSTAT_AD1CONV 0x04
2892 #define _ADSTAT_ADCONV 0x04
2893 #define _ADSTAT_AD2STG0 0x10
2894 #define _ADSTAT_AD2STG1 0x20
2895 #define _ADSTAT_AD2CONV 0x40
2897 //==============================================================================
2900 //==============================================================================
2901 // AAD1PRE Bits
2903 extern __at(0x0716) __sfr AAD1PRE;
2905 typedef union
2907 struct
2909 unsigned ADPRE0 : 1;
2910 unsigned ADPRE1 : 1;
2911 unsigned ADPRE2 : 1;
2912 unsigned ADPRE3 : 1;
2913 unsigned ADPRE4 : 1;
2914 unsigned ADPRE5 : 1;
2915 unsigned ADPRE6 : 1;
2916 unsigned : 1;
2919 struct
2921 unsigned ADPRE : 7;
2922 unsigned : 1;
2924 } __AAD1PREbits_t;
2926 extern __at(0x0716) volatile __AAD1PREbits_t AAD1PREbits;
2928 #define _ADPRE0 0x01
2929 #define _ADPRE1 0x02
2930 #define _ADPRE2 0x04
2931 #define _ADPRE3 0x08
2932 #define _ADPRE4 0x10
2933 #define _ADPRE5 0x20
2934 #define _ADPRE6 0x40
2936 //==============================================================================
2939 //==============================================================================
2940 // AADPRE Bits
2942 extern __at(0x0716) __sfr AADPRE;
2944 typedef union
2946 struct
2948 unsigned ADPRE0 : 1;
2949 unsigned ADPRE1 : 1;
2950 unsigned ADPRE2 : 1;
2951 unsigned ADPRE3 : 1;
2952 unsigned ADPRE4 : 1;
2953 unsigned ADPRE5 : 1;
2954 unsigned ADPRE6 : 1;
2955 unsigned : 1;
2958 struct
2960 unsigned ADPRE : 7;
2961 unsigned : 1;
2963 } __AADPREbits_t;
2965 extern __at(0x0716) volatile __AADPREbits_t AADPREbits;
2967 #define _AADPRE_ADPRE0 0x01
2968 #define _AADPRE_ADPRE1 0x02
2969 #define _AADPRE_ADPRE2 0x04
2970 #define _AADPRE_ADPRE3 0x08
2971 #define _AADPRE_ADPRE4 0x10
2972 #define _AADPRE_ADPRE5 0x20
2973 #define _AADPRE_ADPRE6 0x40
2975 //==============================================================================
2978 //==============================================================================
2979 // AD1PRE Bits
2981 extern __at(0x0716) __sfr AD1PRE;
2983 typedef union
2985 struct
2987 unsigned ADPRE0 : 1;
2988 unsigned ADPRE1 : 1;
2989 unsigned ADPRE2 : 1;
2990 unsigned ADPRE3 : 1;
2991 unsigned ADPRE4 : 1;
2992 unsigned ADPRE5 : 1;
2993 unsigned ADPRE6 : 1;
2994 unsigned : 1;
2997 struct
2999 unsigned ADPRE : 7;
3000 unsigned : 1;
3002 } __AD1PREbits_t;
3004 extern __at(0x0716) volatile __AD1PREbits_t AD1PREbits;
3006 #define _AD1PRE_ADPRE0 0x01
3007 #define _AD1PRE_ADPRE1 0x02
3008 #define _AD1PRE_ADPRE2 0x04
3009 #define _AD1PRE_ADPRE3 0x08
3010 #define _AD1PRE_ADPRE4 0x10
3011 #define _AD1PRE_ADPRE5 0x20
3012 #define _AD1PRE_ADPRE6 0x40
3014 //==============================================================================
3017 //==============================================================================
3018 // AD1PRECON Bits
3020 extern __at(0x0716) __sfr AD1PRECON;
3022 typedef union
3024 struct
3026 unsigned ADPRE0 : 1;
3027 unsigned ADPRE1 : 1;
3028 unsigned ADPRE2 : 1;
3029 unsigned ADPRE3 : 1;
3030 unsigned ADPRE4 : 1;
3031 unsigned ADPRE5 : 1;
3032 unsigned ADPRE6 : 1;
3033 unsigned : 1;
3036 struct
3038 unsigned ADPRE : 7;
3039 unsigned : 1;
3041 } __AD1PRECONbits_t;
3043 extern __at(0x0716) volatile __AD1PRECONbits_t AD1PRECONbits;
3045 #define _AD1PRECON_ADPRE0 0x01
3046 #define _AD1PRECON_ADPRE1 0x02
3047 #define _AD1PRECON_ADPRE2 0x04
3048 #define _AD1PRECON_ADPRE3 0x08
3049 #define _AD1PRECON_ADPRE4 0x10
3050 #define _AD1PRECON_ADPRE5 0x20
3051 #define _AD1PRECON_ADPRE6 0x40
3053 //==============================================================================
3056 //==============================================================================
3057 // AAD1ACQ Bits
3059 extern __at(0x0717) __sfr AAD1ACQ;
3061 typedef union
3063 struct
3065 unsigned ADACQ0 : 1;
3066 unsigned ADACQ1 : 1;
3067 unsigned ADACQ2 : 1;
3068 unsigned ADACQ3 : 1;
3069 unsigned ADACQ4 : 1;
3070 unsigned ADACQ5 : 1;
3071 unsigned ADACQ6 : 1;
3072 unsigned : 1;
3075 struct
3077 unsigned ADACQ : 7;
3078 unsigned : 1;
3080 } __AAD1ACQbits_t;
3082 extern __at(0x0717) volatile __AAD1ACQbits_t AAD1ACQbits;
3084 #define _ADACQ0 0x01
3085 #define _ADACQ1 0x02
3086 #define _ADACQ2 0x04
3087 #define _ADACQ3 0x08
3088 #define _ADACQ4 0x10
3089 #define _ADACQ5 0x20
3090 #define _ADACQ6 0x40
3092 //==============================================================================
3095 //==============================================================================
3096 // AADACQ Bits
3098 extern __at(0x0717) __sfr AADACQ;
3100 typedef union
3102 struct
3104 unsigned ADACQ0 : 1;
3105 unsigned ADACQ1 : 1;
3106 unsigned ADACQ2 : 1;
3107 unsigned ADACQ3 : 1;
3108 unsigned ADACQ4 : 1;
3109 unsigned ADACQ5 : 1;
3110 unsigned ADACQ6 : 1;
3111 unsigned : 1;
3114 struct
3116 unsigned ADACQ : 7;
3117 unsigned : 1;
3119 } __AADACQbits_t;
3121 extern __at(0x0717) volatile __AADACQbits_t AADACQbits;
3123 #define _AADACQ_ADACQ0 0x01
3124 #define _AADACQ_ADACQ1 0x02
3125 #define _AADACQ_ADACQ2 0x04
3126 #define _AADACQ_ADACQ3 0x08
3127 #define _AADACQ_ADACQ4 0x10
3128 #define _AADACQ_ADACQ5 0x20
3129 #define _AADACQ_ADACQ6 0x40
3131 //==============================================================================
3134 //==============================================================================
3135 // AD1ACQ Bits
3137 extern __at(0x0717) __sfr AD1ACQ;
3139 typedef union
3141 struct
3143 unsigned ADACQ0 : 1;
3144 unsigned ADACQ1 : 1;
3145 unsigned ADACQ2 : 1;
3146 unsigned ADACQ3 : 1;
3147 unsigned ADACQ4 : 1;
3148 unsigned ADACQ5 : 1;
3149 unsigned ADACQ6 : 1;
3150 unsigned : 1;
3153 struct
3155 unsigned ADACQ : 7;
3156 unsigned : 1;
3158 } __AD1ACQbits_t;
3160 extern __at(0x0717) volatile __AD1ACQbits_t AD1ACQbits;
3162 #define _AD1ACQ_ADACQ0 0x01
3163 #define _AD1ACQ_ADACQ1 0x02
3164 #define _AD1ACQ_ADACQ2 0x04
3165 #define _AD1ACQ_ADACQ3 0x08
3166 #define _AD1ACQ_ADACQ4 0x10
3167 #define _AD1ACQ_ADACQ5 0x20
3168 #define _AD1ACQ_ADACQ6 0x40
3170 //==============================================================================
3173 //==============================================================================
3174 // AD1ACQCON Bits
3176 extern __at(0x0717) __sfr AD1ACQCON;
3178 typedef union
3180 struct
3182 unsigned ADACQ0 : 1;
3183 unsigned ADACQ1 : 1;
3184 unsigned ADACQ2 : 1;
3185 unsigned ADACQ3 : 1;
3186 unsigned ADACQ4 : 1;
3187 unsigned ADACQ5 : 1;
3188 unsigned ADACQ6 : 1;
3189 unsigned : 1;
3192 struct
3194 unsigned ADACQ : 7;
3195 unsigned : 1;
3197 } __AD1ACQCONbits_t;
3199 extern __at(0x0717) volatile __AD1ACQCONbits_t AD1ACQCONbits;
3201 #define _AD1ACQCON_ADACQ0 0x01
3202 #define _AD1ACQCON_ADACQ1 0x02
3203 #define _AD1ACQCON_ADACQ2 0x04
3204 #define _AD1ACQCON_ADACQ3 0x08
3205 #define _AD1ACQCON_ADACQ4 0x10
3206 #define _AD1ACQCON_ADACQ5 0x20
3207 #define _AD1ACQCON_ADACQ6 0x40
3209 //==============================================================================
3212 //==============================================================================
3213 // AAD1GRD Bits
3215 extern __at(0x0718) __sfr AAD1GRD;
3217 typedef union
3219 struct
3221 unsigned : 1;
3222 unsigned : 1;
3223 unsigned : 1;
3224 unsigned : 1;
3225 unsigned : 1;
3226 unsigned GRD1POL : 1;
3227 unsigned GRD1AOE : 1;
3228 unsigned GRD1BOE : 1;
3231 struct
3233 unsigned : 1;
3234 unsigned : 1;
3235 unsigned : 1;
3236 unsigned : 1;
3237 unsigned : 1;
3238 unsigned GRDPOL : 1;
3239 unsigned GRDAOE : 1;
3240 unsigned GRDBOE : 1;
3242 } __AAD1GRDbits_t;
3244 extern __at(0x0718) volatile __AAD1GRDbits_t AAD1GRDbits;
3246 #define _GRD1POL 0x20
3247 #define _GRDPOL 0x20
3248 #define _GRD1AOE 0x40
3249 #define _GRDAOE 0x40
3250 #define _GRD1BOE 0x80
3251 #define _GRDBOE 0x80
3253 //==============================================================================
3256 //==============================================================================
3257 // AADGRD Bits
3259 extern __at(0x0718) __sfr AADGRD;
3261 typedef union
3263 struct
3265 unsigned : 1;
3266 unsigned : 1;
3267 unsigned : 1;
3268 unsigned : 1;
3269 unsigned : 1;
3270 unsigned GRD1POL : 1;
3271 unsigned GRD1AOE : 1;
3272 unsigned GRD1BOE : 1;
3275 struct
3277 unsigned : 1;
3278 unsigned : 1;
3279 unsigned : 1;
3280 unsigned : 1;
3281 unsigned : 1;
3282 unsigned GRDPOL : 1;
3283 unsigned GRDAOE : 1;
3284 unsigned GRDBOE : 1;
3286 } __AADGRDbits_t;
3288 extern __at(0x0718) volatile __AADGRDbits_t AADGRDbits;
3290 #define _AADGRD_GRD1POL 0x20
3291 #define _AADGRD_GRDPOL 0x20
3292 #define _AADGRD_GRD1AOE 0x40
3293 #define _AADGRD_GRDAOE 0x40
3294 #define _AADGRD_GRD1BOE 0x80
3295 #define _AADGRD_GRDBOE 0x80
3297 //==============================================================================
3300 //==============================================================================
3301 // AD1GRD Bits
3303 extern __at(0x0718) __sfr AD1GRD;
3305 typedef union
3307 struct
3309 unsigned : 1;
3310 unsigned : 1;
3311 unsigned : 1;
3312 unsigned : 1;
3313 unsigned : 1;
3314 unsigned GRD1POL : 1;
3315 unsigned GRD1AOE : 1;
3316 unsigned GRD1BOE : 1;
3319 struct
3321 unsigned : 1;
3322 unsigned : 1;
3323 unsigned : 1;
3324 unsigned : 1;
3325 unsigned : 1;
3326 unsigned GRDPOL : 1;
3327 unsigned GRDAOE : 1;
3328 unsigned GRDBOE : 1;
3330 } __AD1GRDbits_t;
3332 extern __at(0x0718) volatile __AD1GRDbits_t AD1GRDbits;
3334 #define _AD1GRD_GRD1POL 0x20
3335 #define _AD1GRD_GRDPOL 0x20
3336 #define _AD1GRD_GRD1AOE 0x40
3337 #define _AD1GRD_GRDAOE 0x40
3338 #define _AD1GRD_GRD1BOE 0x80
3339 #define _AD1GRD_GRDBOE 0x80
3341 //==============================================================================
3344 //==============================================================================
3345 // AAD1CAP Bits
3347 extern __at(0x0719) __sfr AAD1CAP;
3349 typedef union
3351 struct
3353 unsigned ADDCAP0 : 1;
3354 unsigned ADDCAP1 : 1;
3355 unsigned ADDCAP2 : 1;
3356 unsigned ADDCAP3 : 1;
3357 unsigned : 1;
3358 unsigned : 1;
3359 unsigned : 1;
3360 unsigned : 1;
3363 struct
3365 unsigned ADDCAP : 4;
3366 unsigned : 4;
3368 } __AAD1CAPbits_t;
3370 extern __at(0x0719) volatile __AAD1CAPbits_t AAD1CAPbits;
3372 #define _ADDCAP0 0x01
3373 #define _ADDCAP1 0x02
3374 #define _ADDCAP2 0x04
3375 #define _ADDCAP3 0x08
3377 //==============================================================================
3380 //==============================================================================
3381 // AAD1CAPCON Bits
3383 extern __at(0x0719) __sfr AAD1CAPCON;
3385 typedef union
3387 struct
3389 unsigned ADDCAP0 : 1;
3390 unsigned ADDCAP1 : 1;
3391 unsigned ADDCAP2 : 1;
3392 unsigned ADDCAP3 : 1;
3393 unsigned : 1;
3394 unsigned : 1;
3395 unsigned : 1;
3396 unsigned : 1;
3399 struct
3401 unsigned ADDCAP : 4;
3402 unsigned : 4;
3404 } __AAD1CAPCONbits_t;
3406 extern __at(0x0719) volatile __AAD1CAPCONbits_t AAD1CAPCONbits;
3408 #define _AAD1CAPCON_ADDCAP0 0x01
3409 #define _AAD1CAPCON_ADDCAP1 0x02
3410 #define _AAD1CAPCON_ADDCAP2 0x04
3411 #define _AAD1CAPCON_ADDCAP3 0x08
3413 //==============================================================================
3416 //==============================================================================
3417 // AADCAP Bits
3419 extern __at(0x0719) __sfr AADCAP;
3421 typedef union
3423 struct
3425 unsigned ADDCAP0 : 1;
3426 unsigned ADDCAP1 : 1;
3427 unsigned ADDCAP2 : 1;
3428 unsigned ADDCAP3 : 1;
3429 unsigned : 1;
3430 unsigned : 1;
3431 unsigned : 1;
3432 unsigned : 1;
3435 struct
3437 unsigned ADDCAP : 4;
3438 unsigned : 4;
3440 } __AADCAPbits_t;
3442 extern __at(0x0719) volatile __AADCAPbits_t AADCAPbits;
3444 #define _AADCAP_ADDCAP0 0x01
3445 #define _AADCAP_ADDCAP1 0x02
3446 #define _AADCAP_ADDCAP2 0x04
3447 #define _AADCAP_ADDCAP3 0x08
3449 //==============================================================================
3452 //==============================================================================
3453 // AD1CAPCON Bits
3455 extern __at(0x0719) __sfr AD1CAPCON;
3457 typedef union
3459 struct
3461 unsigned ADDCAP0 : 1;
3462 unsigned ADDCAP1 : 1;
3463 unsigned ADDCAP2 : 1;
3464 unsigned ADDCAP3 : 1;
3465 unsigned : 1;
3466 unsigned : 1;
3467 unsigned : 1;
3468 unsigned : 1;
3471 struct
3473 unsigned ADDCAP : 4;
3474 unsigned : 4;
3476 } __AD1CAPCONbits_t;
3478 extern __at(0x0719) volatile __AD1CAPCONbits_t AD1CAPCONbits;
3480 #define _AD1CAPCON_ADDCAP0 0x01
3481 #define _AD1CAPCON_ADDCAP1 0x02
3482 #define _AD1CAPCON_ADDCAP2 0x04
3483 #define _AD1CAPCON_ADDCAP3 0x08
3485 //==============================================================================
3487 extern __at(0x071A) __sfr AAD1RES0;
3488 extern __at(0x071A) __sfr AAD1RES0L;
3489 extern __at(0x071A) __sfr AD1RES0;
3490 extern __at(0x071A) __sfr AD1RES0L;
3491 extern __at(0x071A) __sfr ADRES0;
3492 extern __at(0x071B) __sfr AAD1RES0H;
3493 extern __at(0x071B) __sfr AD1RES0H;
3494 extern __at(0x071C) __sfr AAD1RES1;
3495 extern __at(0x071C) __sfr AAD1RES1L;
3496 extern __at(0x071C) __sfr AD1RES1;
3497 extern __at(0x071C) __sfr AD1RES1L;
3498 extern __at(0x071C) __sfr ADRES1;
3499 extern __at(0x071D) __sfr AAD1RES1H;
3500 extern __at(0x071D) __sfr AD1RES1H;
3502 //==============================================================================
3503 // AAD1CH Bits
3505 extern __at(0x071E) __sfr AAD1CH;
3507 typedef struct
3509 unsigned CH10 : 1;
3510 unsigned CH11 : 1;
3511 unsigned CH12 : 1;
3512 unsigned CH13 : 1;
3513 unsigned : 1;
3514 unsigned : 1;
3515 unsigned : 1;
3516 unsigned : 1;
3517 } __AAD1CHbits_t;
3519 extern __at(0x071E) volatile __AAD1CHbits_t AAD1CHbits;
3521 #define _CH10 0x01
3522 #define _CH11 0x02
3523 #define _CH12 0x04
3524 #define _CH13 0x08
3526 //==============================================================================
3529 //==============================================================================
3530 // AD1CH Bits
3532 extern __at(0x071E) __sfr AD1CH;
3534 typedef struct
3536 unsigned CH10 : 1;
3537 unsigned CH11 : 1;
3538 unsigned CH12 : 1;
3539 unsigned CH13 : 1;
3540 unsigned : 1;
3541 unsigned : 1;
3542 unsigned : 1;
3543 unsigned : 1;
3544 } __AD1CHbits_t;
3546 extern __at(0x071E) volatile __AD1CHbits_t AD1CHbits;
3548 #define _AD1CH_CH10 0x01
3549 #define _AD1CH_CH11 0x02
3550 #define _AD1CH_CH12 0x04
3551 #define _AD1CH_CH13 0x08
3553 //==============================================================================
3556 //==============================================================================
3557 // AAD2CON0 Bits
3559 extern __at(0x0791) __sfr AAD2CON0;
3561 typedef union
3563 struct
3565 unsigned ADON : 1;
3566 unsigned GO : 1;
3567 unsigned CHS0 : 1;
3568 unsigned CHS1 : 1;
3569 unsigned CHS2 : 1;
3570 unsigned CHS3 : 1;
3571 unsigned CHS4 : 1;
3572 unsigned : 1;
3575 struct
3577 unsigned : 1;
3578 unsigned GO_NOT_DONE : 1;
3579 unsigned : 1;
3580 unsigned : 1;
3581 unsigned : 1;
3582 unsigned : 1;
3583 unsigned : 1;
3584 unsigned : 1;
3587 struct
3589 unsigned : 1;
3590 unsigned GO_NOT_DONE2 : 1;
3591 unsigned : 1;
3592 unsigned : 1;
3593 unsigned : 1;
3594 unsigned : 1;
3595 unsigned : 1;
3596 unsigned : 1;
3599 struct
3601 unsigned : 2;
3602 unsigned CHS : 5;
3603 unsigned : 1;
3605 } __AAD2CON0bits_t;
3607 extern __at(0x0791) volatile __AAD2CON0bits_t AAD2CON0bits;
3609 #define _AAD2CON0_ADON 0x01
3610 #define _AAD2CON0_GO 0x02
3611 #define _AAD2CON0_GO_NOT_DONE 0x02
3612 #define _AAD2CON0_GO_NOT_DONE2 0x02
3613 #define _AAD2CON0_CHS0 0x04
3614 #define _AAD2CON0_CHS1 0x08
3615 #define _AAD2CON0_CHS2 0x10
3616 #define _AAD2CON0_CHS3 0x20
3617 #define _AAD2CON0_CHS4 0x40
3619 //==============================================================================
3622 //==============================================================================
3623 // AD2CON0 Bits
3625 extern __at(0x0791) __sfr AD2CON0;
3627 typedef union
3629 struct
3631 unsigned ADON : 1;
3632 unsigned GO : 1;
3633 unsigned CHS0 : 1;
3634 unsigned CHS1 : 1;
3635 unsigned CHS2 : 1;
3636 unsigned CHS3 : 1;
3637 unsigned CHS4 : 1;
3638 unsigned : 1;
3641 struct
3643 unsigned : 1;
3644 unsigned GO_NOT_DONE : 1;
3645 unsigned : 1;
3646 unsigned : 1;
3647 unsigned : 1;
3648 unsigned : 1;
3649 unsigned : 1;
3650 unsigned : 1;
3653 struct
3655 unsigned : 1;
3656 unsigned GO_NOT_DONE2 : 1;
3657 unsigned : 1;
3658 unsigned : 1;
3659 unsigned : 1;
3660 unsigned : 1;
3661 unsigned : 1;
3662 unsigned : 1;
3665 struct
3667 unsigned : 2;
3668 unsigned CHS : 5;
3669 unsigned : 1;
3671 } __AD2CON0bits_t;
3673 extern __at(0x0791) volatile __AD2CON0bits_t AD2CON0bits;
3675 #define _AD2CON0_ADON 0x01
3676 #define _AD2CON0_GO 0x02
3677 #define _AD2CON0_GO_NOT_DONE 0x02
3678 #define _AD2CON0_GO_NOT_DONE2 0x02
3679 #define _AD2CON0_CHS0 0x04
3680 #define _AD2CON0_CHS1 0x08
3681 #define _AD2CON0_CHS2 0x10
3682 #define _AD2CON0_CHS3 0x20
3683 #define _AD2CON0_CHS4 0x40
3685 //==============================================================================
3688 //==============================================================================
3689 // AAD2CON2 Bits
3691 extern __at(0x0793) __sfr AAD2CON2;
3693 typedef union
3695 struct
3697 unsigned : 1;
3698 unsigned : 1;
3699 unsigned : 1;
3700 unsigned : 1;
3701 unsigned TRIGSEL0 : 1;
3702 unsigned TRIGSEL1 : 1;
3703 unsigned TRIGSEL2 : 1;
3704 unsigned : 1;
3707 struct
3709 unsigned : 4;
3710 unsigned TRIGSEL : 3;
3711 unsigned : 1;
3713 } __AAD2CON2bits_t;
3715 extern __at(0x0793) volatile __AAD2CON2bits_t AAD2CON2bits;
3717 #define _AAD2CON2_TRIGSEL0 0x10
3718 #define _AAD2CON2_TRIGSEL1 0x20
3719 #define _AAD2CON2_TRIGSEL2 0x40
3721 //==============================================================================
3724 //==============================================================================
3725 // AD2CON2 Bits
3727 extern __at(0x0793) __sfr AD2CON2;
3729 typedef union
3731 struct
3733 unsigned : 1;
3734 unsigned : 1;
3735 unsigned : 1;
3736 unsigned : 1;
3737 unsigned TRIGSEL0 : 1;
3738 unsigned TRIGSEL1 : 1;
3739 unsigned TRIGSEL2 : 1;
3740 unsigned : 1;
3743 struct
3745 unsigned : 4;
3746 unsigned TRIGSEL : 3;
3747 unsigned : 1;
3749 } __AD2CON2bits_t;
3751 extern __at(0x0793) volatile __AD2CON2bits_t AD2CON2bits;
3753 #define _AD2CON2_TRIGSEL0 0x10
3754 #define _AD2CON2_TRIGSEL1 0x20
3755 #define _AD2CON2_TRIGSEL2 0x40
3757 //==============================================================================
3760 //==============================================================================
3761 // AAD2CON3 Bits
3763 extern __at(0x0794) __sfr AAD2CON3;
3765 typedef union
3767 struct
3769 unsigned AD2DSEN : 1;
3770 unsigned AD2IPEN : 1;
3771 unsigned : 1;
3772 unsigned : 1;
3773 unsigned : 1;
3774 unsigned : 1;
3775 unsigned AD2IPPOL : 1;
3776 unsigned AD2EPPOL : 1;
3779 struct
3781 unsigned ADDSEN : 1;
3782 unsigned ADIPEN : 1;
3783 unsigned : 1;
3784 unsigned : 1;
3785 unsigned : 1;
3786 unsigned : 1;
3787 unsigned ADIPPOL : 1;
3788 unsigned ADEPPOL : 1;
3790 } __AAD2CON3bits_t;
3792 extern __at(0x0794) volatile __AAD2CON3bits_t AAD2CON3bits;
3794 #define _AAD2CON3_AD2DSEN 0x01
3795 #define _AAD2CON3_ADDSEN 0x01
3796 #define _AAD2CON3_AD2IPEN 0x02
3797 #define _AAD2CON3_ADIPEN 0x02
3798 #define _AAD2CON3_AD2IPPOL 0x40
3799 #define _AAD2CON3_ADIPPOL 0x40
3800 #define _AAD2CON3_AD2EPPOL 0x80
3801 #define _AAD2CON3_ADEPPOL 0x80
3803 //==============================================================================
3806 //==============================================================================
3807 // AD2CON3 Bits
3809 extern __at(0x0794) __sfr AD2CON3;
3811 typedef union
3813 struct
3815 unsigned AD2DSEN : 1;
3816 unsigned AD2IPEN : 1;
3817 unsigned : 1;
3818 unsigned : 1;
3819 unsigned : 1;
3820 unsigned : 1;
3821 unsigned AD2IPPOL : 1;
3822 unsigned AD2EPPOL : 1;
3825 struct
3827 unsigned ADDSEN : 1;
3828 unsigned ADIPEN : 1;
3829 unsigned : 1;
3830 unsigned : 1;
3831 unsigned : 1;
3832 unsigned : 1;
3833 unsigned ADIPPOL : 1;
3834 unsigned ADEPPOL : 1;
3836 } __AD2CON3bits_t;
3838 extern __at(0x0794) volatile __AD2CON3bits_t AD2CON3bits;
3840 #define _AD2CON3_AD2DSEN 0x01
3841 #define _AD2CON3_ADDSEN 0x01
3842 #define _AD2CON3_AD2IPEN 0x02
3843 #define _AD2CON3_ADIPEN 0x02
3844 #define _AD2CON3_AD2IPPOL 0x40
3845 #define _AD2CON3_ADIPPOL 0x40
3846 #define _AD2CON3_AD2EPPOL 0x80
3847 #define _AD2CON3_ADEPPOL 0x80
3849 //==============================================================================
3852 //==============================================================================
3853 // AAD2PRE Bits
3855 extern __at(0x0796) __sfr AAD2PRE;
3857 typedef union
3859 struct
3861 unsigned ADPRE0 : 1;
3862 unsigned ADPRE1 : 1;
3863 unsigned ADPRE2 : 1;
3864 unsigned ADPRE3 : 1;
3865 unsigned ADPRE4 : 1;
3866 unsigned ADPRE5 : 1;
3867 unsigned ADPRE6 : 1;
3868 unsigned : 1;
3871 struct
3873 unsigned ADPRE : 7;
3874 unsigned : 1;
3876 } __AAD2PREbits_t;
3878 extern __at(0x0796) volatile __AAD2PREbits_t AAD2PREbits;
3880 #define _AAD2PRE_ADPRE0 0x01
3881 #define _AAD2PRE_ADPRE1 0x02
3882 #define _AAD2PRE_ADPRE2 0x04
3883 #define _AAD2PRE_ADPRE3 0x08
3884 #define _AAD2PRE_ADPRE4 0x10
3885 #define _AAD2PRE_ADPRE5 0x20
3886 #define _AAD2PRE_ADPRE6 0x40
3888 //==============================================================================
3891 //==============================================================================
3892 // AD2PRE Bits
3894 extern __at(0x0796) __sfr AD2PRE;
3896 typedef union
3898 struct
3900 unsigned ADPRE0 : 1;
3901 unsigned ADPRE1 : 1;
3902 unsigned ADPRE2 : 1;
3903 unsigned ADPRE3 : 1;
3904 unsigned ADPRE4 : 1;
3905 unsigned ADPRE5 : 1;
3906 unsigned ADPRE6 : 1;
3907 unsigned : 1;
3910 struct
3912 unsigned ADPRE : 7;
3913 unsigned : 1;
3915 } __AD2PREbits_t;
3917 extern __at(0x0796) volatile __AD2PREbits_t AD2PREbits;
3919 #define _AD2PRE_ADPRE0 0x01
3920 #define _AD2PRE_ADPRE1 0x02
3921 #define _AD2PRE_ADPRE2 0x04
3922 #define _AD2PRE_ADPRE3 0x08
3923 #define _AD2PRE_ADPRE4 0x10
3924 #define _AD2PRE_ADPRE5 0x20
3925 #define _AD2PRE_ADPRE6 0x40
3927 //==============================================================================
3930 //==============================================================================
3931 // AD2PRECON Bits
3933 extern __at(0x0796) __sfr AD2PRECON;
3935 typedef union
3937 struct
3939 unsigned ADPRE0 : 1;
3940 unsigned ADPRE1 : 1;
3941 unsigned ADPRE2 : 1;
3942 unsigned ADPRE3 : 1;
3943 unsigned ADPRE4 : 1;
3944 unsigned ADPRE5 : 1;
3945 unsigned ADPRE6 : 1;
3946 unsigned : 1;
3949 struct
3951 unsigned ADPRE : 7;
3952 unsigned : 1;
3954 } __AD2PRECONbits_t;
3956 extern __at(0x0796) volatile __AD2PRECONbits_t AD2PRECONbits;
3958 #define _AD2PRECON_ADPRE0 0x01
3959 #define _AD2PRECON_ADPRE1 0x02
3960 #define _AD2PRECON_ADPRE2 0x04
3961 #define _AD2PRECON_ADPRE3 0x08
3962 #define _AD2PRECON_ADPRE4 0x10
3963 #define _AD2PRECON_ADPRE5 0x20
3964 #define _AD2PRECON_ADPRE6 0x40
3966 //==============================================================================
3969 //==============================================================================
3970 // AAD2ACQ Bits
3972 extern __at(0x0797) __sfr AAD2ACQ;
3974 typedef union
3976 struct
3978 unsigned ADACQ0 : 1;
3979 unsigned ADACQ1 : 1;
3980 unsigned ADACQ2 : 1;
3981 unsigned ADACQ3 : 1;
3982 unsigned ADACQ4 : 1;
3983 unsigned ADACQ5 : 1;
3984 unsigned ADACQ6 : 1;
3985 unsigned : 1;
3988 struct
3990 unsigned ADACQ : 7;
3991 unsigned : 1;
3993 } __AAD2ACQbits_t;
3995 extern __at(0x0797) volatile __AAD2ACQbits_t AAD2ACQbits;
3997 #define _AAD2ACQ_ADACQ0 0x01
3998 #define _AAD2ACQ_ADACQ1 0x02
3999 #define _AAD2ACQ_ADACQ2 0x04
4000 #define _AAD2ACQ_ADACQ3 0x08
4001 #define _AAD2ACQ_ADACQ4 0x10
4002 #define _AAD2ACQ_ADACQ5 0x20
4003 #define _AAD2ACQ_ADACQ6 0x40
4005 //==============================================================================
4008 //==============================================================================
4009 // AD2ACQ Bits
4011 extern __at(0x0797) __sfr AD2ACQ;
4013 typedef union
4015 struct
4017 unsigned ADACQ0 : 1;
4018 unsigned ADACQ1 : 1;
4019 unsigned ADACQ2 : 1;
4020 unsigned ADACQ3 : 1;
4021 unsigned ADACQ4 : 1;
4022 unsigned ADACQ5 : 1;
4023 unsigned ADACQ6 : 1;
4024 unsigned : 1;
4027 struct
4029 unsigned ADACQ : 7;
4030 unsigned : 1;
4032 } __AD2ACQbits_t;
4034 extern __at(0x0797) volatile __AD2ACQbits_t AD2ACQbits;
4036 #define _AD2ACQ_ADACQ0 0x01
4037 #define _AD2ACQ_ADACQ1 0x02
4038 #define _AD2ACQ_ADACQ2 0x04
4039 #define _AD2ACQ_ADACQ3 0x08
4040 #define _AD2ACQ_ADACQ4 0x10
4041 #define _AD2ACQ_ADACQ5 0x20
4042 #define _AD2ACQ_ADACQ6 0x40
4044 //==============================================================================
4047 //==============================================================================
4048 // AD2ACQCON Bits
4050 extern __at(0x0797) __sfr AD2ACQCON;
4052 typedef union
4054 struct
4056 unsigned ADACQ0 : 1;
4057 unsigned ADACQ1 : 1;
4058 unsigned ADACQ2 : 1;
4059 unsigned ADACQ3 : 1;
4060 unsigned ADACQ4 : 1;
4061 unsigned ADACQ5 : 1;
4062 unsigned ADACQ6 : 1;
4063 unsigned : 1;
4066 struct
4068 unsigned ADACQ : 7;
4069 unsigned : 1;
4071 } __AD2ACQCONbits_t;
4073 extern __at(0x0797) volatile __AD2ACQCONbits_t AD2ACQCONbits;
4075 #define _AD2ACQCON_ADACQ0 0x01
4076 #define _AD2ACQCON_ADACQ1 0x02
4077 #define _AD2ACQCON_ADACQ2 0x04
4078 #define _AD2ACQCON_ADACQ3 0x08
4079 #define _AD2ACQCON_ADACQ4 0x10
4080 #define _AD2ACQCON_ADACQ5 0x20
4081 #define _AD2ACQCON_ADACQ6 0x40
4083 //==============================================================================
4086 //==============================================================================
4087 // AAD2GRD Bits
4089 extern __at(0x0798) __sfr AAD2GRD;
4091 typedef union
4093 struct
4095 unsigned : 1;
4096 unsigned : 1;
4097 unsigned : 1;
4098 unsigned : 1;
4099 unsigned : 1;
4100 unsigned GRD2POL : 1;
4101 unsigned GRD2AOE : 1;
4102 unsigned GRD2BOE : 1;
4105 struct
4107 unsigned : 1;
4108 unsigned : 1;
4109 unsigned : 1;
4110 unsigned : 1;
4111 unsigned : 1;
4112 unsigned GRDPOL : 1;
4113 unsigned GRDAOE : 1;
4114 unsigned GRDBOE : 1;
4116 } __AAD2GRDbits_t;
4118 extern __at(0x0798) volatile __AAD2GRDbits_t AAD2GRDbits;
4120 #define _AAD2GRD_GRD2POL 0x20
4121 #define _AAD2GRD_GRDPOL 0x20
4122 #define _AAD2GRD_GRD2AOE 0x40
4123 #define _AAD2GRD_GRDAOE 0x40
4124 #define _AAD2GRD_GRD2BOE 0x80
4125 #define _AAD2GRD_GRDBOE 0x80
4127 //==============================================================================
4130 //==============================================================================
4131 // AD2GRD Bits
4133 extern __at(0x0798) __sfr AD2GRD;
4135 typedef union
4137 struct
4139 unsigned : 1;
4140 unsigned : 1;
4141 unsigned : 1;
4142 unsigned : 1;
4143 unsigned : 1;
4144 unsigned GRD2POL : 1;
4145 unsigned GRD2AOE : 1;
4146 unsigned GRD2BOE : 1;
4149 struct
4151 unsigned : 1;
4152 unsigned : 1;
4153 unsigned : 1;
4154 unsigned : 1;
4155 unsigned : 1;
4156 unsigned GRDPOL : 1;
4157 unsigned GRDAOE : 1;
4158 unsigned GRDBOE : 1;
4160 } __AD2GRDbits_t;
4162 extern __at(0x0798) volatile __AD2GRDbits_t AD2GRDbits;
4164 #define _AD2GRD_GRD2POL 0x20
4165 #define _AD2GRD_GRDPOL 0x20
4166 #define _AD2GRD_GRD2AOE 0x40
4167 #define _AD2GRD_GRDAOE 0x40
4168 #define _AD2GRD_GRD2BOE 0x80
4169 #define _AD2GRD_GRDBOE 0x80
4171 //==============================================================================
4174 //==============================================================================
4175 // AAD2CAP Bits
4177 extern __at(0x0799) __sfr AAD2CAP;
4179 typedef union
4181 struct
4183 unsigned ADDCAP0 : 1;
4184 unsigned ADDCAP1 : 1;
4185 unsigned ADDCAP2 : 1;
4186 unsigned ADDCAP3 : 1;
4187 unsigned : 1;
4188 unsigned : 1;
4189 unsigned : 1;
4190 unsigned : 1;
4193 struct
4195 unsigned ADDCAP : 4;
4196 unsigned : 4;
4198 } __AAD2CAPbits_t;
4200 extern __at(0x0799) volatile __AAD2CAPbits_t AAD2CAPbits;
4202 #define _AAD2CAP_ADDCAP0 0x01
4203 #define _AAD2CAP_ADDCAP1 0x02
4204 #define _AAD2CAP_ADDCAP2 0x04
4205 #define _AAD2CAP_ADDCAP3 0x08
4207 //==============================================================================
4210 //==============================================================================
4211 // AAD2CAPCON Bits
4213 extern __at(0x0799) __sfr AAD2CAPCON;
4215 typedef union
4217 struct
4219 unsigned ADDCAP0 : 1;
4220 unsigned ADDCAP1 : 1;
4221 unsigned ADDCAP2 : 1;
4222 unsigned ADDCAP3 : 1;
4223 unsigned : 1;
4224 unsigned : 1;
4225 unsigned : 1;
4226 unsigned : 1;
4229 struct
4231 unsigned ADDCAP : 4;
4232 unsigned : 4;
4234 } __AAD2CAPCONbits_t;
4236 extern __at(0x0799) volatile __AAD2CAPCONbits_t AAD2CAPCONbits;
4238 #define _AAD2CAPCON_ADDCAP0 0x01
4239 #define _AAD2CAPCON_ADDCAP1 0x02
4240 #define _AAD2CAPCON_ADDCAP2 0x04
4241 #define _AAD2CAPCON_ADDCAP3 0x08
4243 //==============================================================================
4246 //==============================================================================
4247 // AD2CAPCON Bits
4249 extern __at(0x0799) __sfr AD2CAPCON;
4251 typedef union
4253 struct
4255 unsigned ADDCAP0 : 1;
4256 unsigned ADDCAP1 : 1;
4257 unsigned ADDCAP2 : 1;
4258 unsigned ADDCAP3 : 1;
4259 unsigned : 1;
4260 unsigned : 1;
4261 unsigned : 1;
4262 unsigned : 1;
4265 struct
4267 unsigned ADDCAP : 4;
4268 unsigned : 4;
4270 } __AD2CAPCONbits_t;
4272 extern __at(0x0799) volatile __AD2CAPCONbits_t AD2CAPCONbits;
4274 #define _AD2CAPCON_ADDCAP0 0x01
4275 #define _AD2CAPCON_ADDCAP1 0x02
4276 #define _AD2CAPCON_ADDCAP2 0x04
4277 #define _AD2CAPCON_ADDCAP3 0x08
4279 //==============================================================================
4281 extern __at(0x079A) __sfr AAD2RES0;
4282 extern __at(0x079A) __sfr AAD2RES0L;
4283 extern __at(0x079A) __sfr AD2RES0;
4284 extern __at(0x079A) __sfr AD2RES0L;
4285 extern __at(0x079B) __sfr AAD2RES0H;
4286 extern __at(0x079B) __sfr AD2RES0H;
4287 extern __at(0x079C) __sfr AAD2RES1;
4288 extern __at(0x079C) __sfr AAD2RES1L;
4289 extern __at(0x079C) __sfr AD2RES1;
4290 extern __at(0x079C) __sfr AD2RES1L;
4291 extern __at(0x079D) __sfr AAD2RES1H;
4292 extern __at(0x079D) __sfr AD2RES1H;
4294 //==============================================================================
4295 // AAD2CH Bits
4297 extern __at(0x079E) __sfr AAD2CH;
4299 typedef struct
4301 unsigned CH20 : 1;
4302 unsigned CH21 : 1;
4303 unsigned CH22 : 1;
4304 unsigned CH23 : 1;
4305 unsigned : 1;
4306 unsigned : 1;
4307 unsigned : 1;
4308 unsigned : 1;
4309 } __AAD2CHbits_t;
4311 extern __at(0x079E) volatile __AAD2CHbits_t AAD2CHbits;
4313 #define _CH20 0x01
4314 #define _CH21 0x02
4315 #define _CH22 0x04
4316 #define _CH23 0x08
4318 //==============================================================================
4321 //==============================================================================
4322 // AD2CH Bits
4324 extern __at(0x079E) __sfr AD2CH;
4326 typedef struct
4328 unsigned CH20 : 1;
4329 unsigned CH21 : 1;
4330 unsigned CH22 : 1;
4331 unsigned CH23 : 1;
4332 unsigned : 1;
4333 unsigned : 1;
4334 unsigned : 1;
4335 unsigned : 1;
4336 } __AD2CHbits_t;
4338 extern __at(0x079E) volatile __AD2CHbits_t AD2CHbits;
4340 #define _AD2CH_CH20 0x01
4341 #define _AD2CH_CH21 0x02
4342 #define _AD2CH_CH22 0x04
4343 #define _AD2CH_CH23 0x08
4345 //==============================================================================
4348 //==============================================================================
4349 // ICDIO Bits
4351 extern __at(0x0F8C) __sfr ICDIO;
4353 typedef struct
4355 unsigned : 1;
4356 unsigned : 1;
4357 unsigned TRIS_ICDCLK : 1;
4358 unsigned TRIS_ICDDAT : 1;
4359 unsigned LAT_ICDCLK : 1;
4360 unsigned LAT_ICDDAT : 1;
4361 unsigned PORT_ICDCLK : 1;
4362 unsigned PORT_ICDDAT : 1;
4363 } __ICDIObits_t;
4365 extern __at(0x0F8C) volatile __ICDIObits_t ICDIObits;
4367 #define _TRIS_ICDCLK 0x04
4368 #define _TRIS_ICDDAT 0x08
4369 #define _LAT_ICDCLK 0x10
4370 #define _LAT_ICDDAT 0x20
4371 #define _PORT_ICDCLK 0x40
4372 #define _PORT_ICDDAT 0x80
4374 //==============================================================================
4377 //==============================================================================
4378 // ICDCON0 Bits
4380 extern __at(0x0F8D) __sfr ICDCON0;
4382 typedef struct
4384 unsigned RSTVEC : 1;
4385 unsigned : 1;
4386 unsigned : 1;
4387 unsigned DBGINEX : 1;
4388 unsigned : 1;
4389 unsigned SSTEP : 1;
4390 unsigned FREEZ : 1;
4391 unsigned INBUG : 1;
4392 } __ICDCON0bits_t;
4394 extern __at(0x0F8D) volatile __ICDCON0bits_t ICDCON0bits;
4396 #define _RSTVEC 0x01
4397 #define _DBGINEX 0x08
4398 #define _SSTEP 0x20
4399 #define _FREEZ 0x40
4400 #define _INBUG 0x80
4402 //==============================================================================
4405 //==============================================================================
4406 // ICDSTAT Bits
4408 extern __at(0x0F91) __sfr ICDSTAT;
4410 typedef struct
4412 unsigned : 1;
4413 unsigned USRHLTF : 1;
4414 unsigned : 1;
4415 unsigned : 1;
4416 unsigned : 1;
4417 unsigned : 1;
4418 unsigned TRP0HLTF : 1;
4419 unsigned TRP1HLTF : 1;
4420 } __ICDSTATbits_t;
4422 extern __at(0x0F91) volatile __ICDSTATbits_t ICDSTATbits;
4424 #define _USRHLTF 0x02
4425 #define _TRP0HLTF 0x40
4426 #define _TRP1HLTF 0x80
4428 //==============================================================================
4431 //==============================================================================
4432 // ICDINSTL Bits
4434 extern __at(0x0F96) __sfr ICDINSTL;
4436 typedef struct
4438 unsigned DBGIN0 : 1;
4439 unsigned DBGIN1 : 1;
4440 unsigned DBGIN2 : 1;
4441 unsigned DBGIN3 : 1;
4442 unsigned DBGIN4 : 1;
4443 unsigned DBGIN5 : 1;
4444 unsigned DBGIN6 : 1;
4445 unsigned DBGIN7 : 1;
4446 } __ICDINSTLbits_t;
4448 extern __at(0x0F96) volatile __ICDINSTLbits_t ICDINSTLbits;
4450 #define _DBGIN0 0x01
4451 #define _DBGIN1 0x02
4452 #define _DBGIN2 0x04
4453 #define _DBGIN3 0x08
4454 #define _DBGIN4 0x10
4455 #define _DBGIN5 0x20
4456 #define _DBGIN6 0x40
4457 #define _DBGIN7 0x80
4459 //==============================================================================
4462 //==============================================================================
4463 // ICDINSTH Bits
4465 extern __at(0x0F97) __sfr ICDINSTH;
4467 typedef struct
4469 unsigned DBGIN8 : 1;
4470 unsigned DBGIN9 : 1;
4471 unsigned DBGIN10 : 1;
4472 unsigned DBGIN11 : 1;
4473 unsigned DBGIN12 : 1;
4474 unsigned DBGIN13 : 1;
4475 unsigned : 1;
4476 unsigned : 1;
4477 } __ICDINSTHbits_t;
4479 extern __at(0x0F97) volatile __ICDINSTHbits_t ICDINSTHbits;
4481 #define _DBGIN8 0x01
4482 #define _DBGIN9 0x02
4483 #define _DBGIN10 0x04
4484 #define _DBGIN11 0x08
4485 #define _DBGIN12 0x10
4486 #define _DBGIN13 0x20
4488 //==============================================================================
4491 //==============================================================================
4492 // ICDBK0CON Bits
4494 extern __at(0x0F9C) __sfr ICDBK0CON;
4496 typedef struct
4498 unsigned BKHLT : 1;
4499 unsigned : 1;
4500 unsigned : 1;
4501 unsigned : 1;
4502 unsigned : 1;
4503 unsigned : 1;
4504 unsigned : 1;
4505 unsigned BKEN : 1;
4506 } __ICDBK0CONbits_t;
4508 extern __at(0x0F9C) volatile __ICDBK0CONbits_t ICDBK0CONbits;
4510 #define _BKHLT 0x01
4511 #define _BKEN 0x80
4513 //==============================================================================
4516 //==============================================================================
4517 // ICDBK0L Bits
4519 extern __at(0x0F9D) __sfr ICDBK0L;
4521 typedef struct
4523 unsigned BKA0 : 1;
4524 unsigned BKA1 : 1;
4525 unsigned BKA2 : 1;
4526 unsigned BKA3 : 1;
4527 unsigned BKA4 : 1;
4528 unsigned BKA5 : 1;
4529 unsigned BKA6 : 1;
4530 unsigned BKA7 : 1;
4531 } __ICDBK0Lbits_t;
4533 extern __at(0x0F9D) volatile __ICDBK0Lbits_t ICDBK0Lbits;
4535 #define _BKA0 0x01
4536 #define _BKA1 0x02
4537 #define _BKA2 0x04
4538 #define _BKA3 0x08
4539 #define _BKA4 0x10
4540 #define _BKA5 0x20
4541 #define _BKA6 0x40
4542 #define _BKA7 0x80
4544 //==============================================================================
4547 //==============================================================================
4548 // ICDBK0H Bits
4550 extern __at(0x0F9E) __sfr ICDBK0H;
4552 typedef struct
4554 unsigned BKA8 : 1;
4555 unsigned BKA9 : 1;
4556 unsigned BKA10 : 1;
4557 unsigned BKA11 : 1;
4558 unsigned BKA12 : 1;
4559 unsigned BKA13 : 1;
4560 unsigned BKA14 : 1;
4561 unsigned : 1;
4562 } __ICDBK0Hbits_t;
4564 extern __at(0x0F9E) volatile __ICDBK0Hbits_t ICDBK0Hbits;
4566 #define _BKA8 0x01
4567 #define _BKA9 0x02
4568 #define _BKA10 0x04
4569 #define _BKA11 0x08
4570 #define _BKA12 0x10
4571 #define _BKA13 0x20
4572 #define _BKA14 0x40
4574 //==============================================================================
4576 extern __at(0x0FE3) __sfr BSRICDSHAD;
4578 //==============================================================================
4579 // STATUS_SHAD Bits
4581 extern __at(0x0FE4) __sfr STATUS_SHAD;
4583 typedef struct
4585 unsigned C_SHAD : 1;
4586 unsigned DC_SHAD : 1;
4587 unsigned Z_SHAD : 1;
4588 unsigned : 1;
4589 unsigned : 1;
4590 unsigned : 1;
4591 unsigned : 1;
4592 unsigned : 1;
4593 } __STATUS_SHADbits_t;
4595 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits;
4597 #define _C_SHAD 0x01
4598 #define _DC_SHAD 0x02
4599 #define _Z_SHAD 0x04
4601 //==============================================================================
4603 extern __at(0x0FE5) __sfr WREG_SHAD;
4604 extern __at(0x0FE6) __sfr BSR_SHAD;
4605 extern __at(0x0FE7) __sfr PCLATH_SHAD;
4606 extern __at(0x0FE8) __sfr FSR0L_SHAD;
4607 extern __at(0x0FE9) __sfr FSR0H_SHAD;
4608 extern __at(0x0FEA) __sfr FSR1L_SHAD;
4609 extern __at(0x0FEB) __sfr FSR1H_SHAD;
4610 extern __at(0x0FED) __sfr STKPTR;
4611 extern __at(0x0FEE) __sfr TOSL;
4612 extern __at(0x0FEF) __sfr TOSH;
4614 //==============================================================================
4616 // Configuration Bits
4618 //==============================================================================
4620 #define _CONFIG1 0x8007
4621 #define _CONFIG2 0x8008
4623 //----------------------------- CONFIG1 Options -------------------------------
4625 #define _FOSC_INTOSC 0x3FFC // INTOSC oscillator: I/O function on CLKIN pin.
4626 #define _FOSC_ECL 0x3FFD // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pins.
4627 #define _FOSC_ECM 0x3FFE // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pins.
4628 #define _FOSC_ECH 0x3FFF // ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pins.
4629 #define _WDTE_OFF 0x3FE7 // WDT disabled. SWDTEN bit is ignored.
4630 #define _WDTE_SWDTEN 0x3FEF // WDT controlled by the SWDTEN bit in the WDTCON register.
4631 #define _WDTE_NSLEEP 0x3FF7 // WDT enabled while running and disabled in Sleep. SWDTEN bit is ignored.
4632 #define _WDTE_ON 0x3FFF // WDT enabled. SWDTEN bit is ignored.
4633 #define _PWRTE_ON 0x3FDF // PWRT enabled.
4634 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
4635 #define _MCLRE_OFF 0x3FBF // MCLR/VPP pin function is digital input.
4636 #define _MCLRE_ON 0x3FFF // MCLR/VPP pin function is MCLR.
4637 #define _CP_ON 0x3F7F // Program memory code protection is enabled.
4638 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
4639 #define _BOREN_OFF 0x39FF // Brown-out Reset disabled. SBOREN bit is ignored.
4640 #define _BOREN_SBODEN 0x3BFF // Brown-out Reset controlled by the SBOREN bit in the BORCON register.
4641 #define _BOREN_NSLEEP 0x3DFF // Brown-out Reset enabled while running and disabled in Sleep. SBOREN bit is ignored.
4642 #define _BOREN_ON 0x3FFF // Brown-out Reset enabled.
4643 #define _CLKOUTEN_ON 0x37FF // CLKOUT function is enabled on the CLKOUT pin.
4644 #define _CLKOUTEN_OFF 0x3FFF // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin.
4646 //----------------------------- CONFIG2 Options -------------------------------
4648 #define _WRT_ALL 0x3FFC // 000h to FFFh write protected, no addresses may be modified by PMCON control.
4649 #define _WRT_HALF 0x3FFD // 000h to 7FFh write protected, 800h to FFFh may be modified by PMCON control.
4650 #define _WRT_BOOT 0x3FFE // 000h to 1FFh write protected, 200h to FFFh may be modified by PMCON control.
4651 #define _WRT_OFF 0x3FFF // Write protection off.
4652 #define _STVREN_OFF 0x3DFF // Stack Overflow or Underflow will not cause a Reset.
4653 #define _STVREN_ON 0x3FFF // Stack Overflow or Underflow will cause a Reset.
4654 #define _BORV_HI 0x3BFF // Brown-out Reset Voltage (Vbor), 2.7V trip point selected.
4655 #define _BORV_LO 0x3FFF // Brown-out Reset Voltage (Vbor), 1.9V trip point selected.
4656 #define _LPBOR_ON 0x37FF // Low-Power BOR is enabled.
4657 #define _LPBOR_OFF 0x3FFF // Low-Power BOR is disabled.
4658 #define _DEBUG_ON 0x2FFF // In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger.
4659 #define _DEBUG_OFF 0x3FFF // In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins.
4660 #define _LVP_OFF 0x1FFF // High-voltage on MCLR/VPP must be used for programming.
4661 #define _LVP_ON 0x3FFF // Low-voltage programming enabled.
4663 //==============================================================================
4665 #define _DEVID1 0x8006
4667 #define _IDLOC0 0x8000
4668 #define _IDLOC1 0x8001
4669 #define _IDLOC2 0x8002
4670 #define _IDLOC3 0x8003
4672 //==============================================================================
4674 #ifndef NO_BIT_DEFINES
4676 #define ADACQ0 AAD1ACQbits.ADACQ0 // bit 0
4677 #define ADACQ1 AAD1ACQbits.ADACQ1 // bit 1
4678 #define ADACQ2 AAD1ACQbits.ADACQ2 // bit 2
4679 #define ADACQ3 AAD1ACQbits.ADACQ3 // bit 3
4680 #define ADACQ4 AAD1ACQbits.ADACQ4 // bit 4
4681 #define ADACQ5 AAD1ACQbits.ADACQ5 // bit 5
4682 #define ADACQ6 AAD1ACQbits.ADACQ6 // bit 6
4684 #define ADDCAP0 AAD1CAPbits.ADDCAP0 // bit 0
4685 #define ADDCAP1 AAD1CAPbits.ADDCAP1 // bit 1
4686 #define ADDCAP2 AAD1CAPbits.ADDCAP2 // bit 2
4687 #define ADDCAP3 AAD1CAPbits.ADDCAP3 // bit 3
4689 #define CH10 AAD1CHbits.CH10 // bit 0
4690 #define CH11 AAD1CHbits.CH11 // bit 1
4691 #define CH12 AAD1CHbits.CH12 // bit 2
4692 #define CH13 AAD1CHbits.CH13 // bit 3
4694 #define ADON AAD1CON0bits.ADON // bit 0
4695 #define GO AAD1CON0bits.GO // bit 1, shadows bit in AAD1CON0bits
4696 #define GO_NOT_DONE AAD1CON0bits.GO_NOT_DONE // bit 1, shadows bit in AAD1CON0bits
4697 #define GO_NOT_DONE1 AAD1CON0bits.GO_NOT_DONE1 // bit 1, shadows bit in AAD1CON0bits
4698 #define CHS0 AAD1CON0bits.CHS0 // bit 2
4699 #define CHS1 AAD1CON0bits.CHS1 // bit 3
4700 #define CHS2 AAD1CON0bits.CHS2 // bit 4
4701 #define CHS3 AAD1CON0bits.CHS3 // bit 5
4702 #define CHS4 AAD1CON0bits.CHS4 // bit 6
4704 #define TRIGSEL0 AAD1CON2bits.TRIGSEL0 // bit 4
4705 #define TRIGSEL1 AAD1CON2bits.TRIGSEL1 // bit 5
4706 #define TRIGSEL2 AAD1CON2bits.TRIGSEL2 // bit 6
4708 #define AD1DSEN AAD1CON3bits.AD1DSEN // bit 0, shadows bit in AAD1CON3bits
4709 #define ADDSEN AAD1CON3bits.ADDSEN // bit 0, shadows bit in AAD1CON3bits
4710 #define AD1IPEN AAD1CON3bits.AD1IPEN // bit 1, shadows bit in AAD1CON3bits
4711 #define ADIPEN AAD1CON3bits.ADIPEN // bit 1, shadows bit in AAD1CON3bits
4712 #define AD1IPPOL AAD1CON3bits.AD1IPPOL // bit 6, shadows bit in AAD1CON3bits
4713 #define ADIPPOL AAD1CON3bits.ADIPPOL // bit 6, shadows bit in AAD1CON3bits
4714 #define AD1EPPOL AAD1CON3bits.AD1EPPOL // bit 7, shadows bit in AAD1CON3bits
4715 #define ADEPPOL AAD1CON3bits.ADEPPOL // bit 7, shadows bit in AAD1CON3bits
4717 #define GRD1POL AAD1GRDbits.GRD1POL // bit 5, shadows bit in AAD1GRDbits
4718 #define GRDPOL AAD1GRDbits.GRDPOL // bit 5, shadows bit in AAD1GRDbits
4719 #define GRD1AOE AAD1GRDbits.GRD1AOE // bit 6, shadows bit in AAD1GRDbits
4720 #define GRDAOE AAD1GRDbits.GRDAOE // bit 6, shadows bit in AAD1GRDbits
4721 #define GRD1BOE AAD1GRDbits.GRD1BOE // bit 7, shadows bit in AAD1GRDbits
4722 #define GRDBOE AAD1GRDbits.GRDBOE // bit 7, shadows bit in AAD1GRDbits
4724 #define ADPRE0 AAD1PREbits.ADPRE0 // bit 0
4725 #define ADPRE1 AAD1PREbits.ADPRE1 // bit 1
4726 #define ADPRE2 AAD1PREbits.ADPRE2 // bit 2
4727 #define ADPRE3 AAD1PREbits.ADPRE3 // bit 3
4728 #define ADPRE4 AAD1PREbits.ADPRE4 // bit 4
4729 #define ADPRE5 AAD1PREbits.ADPRE5 // bit 5
4730 #define ADPRE6 AAD1PREbits.ADPRE6 // bit 6
4732 #define CH20 AAD2CHbits.CH20 // bit 0
4733 #define CH21 AAD2CHbits.CH21 // bit 1
4734 #define CH22 AAD2CHbits.CH22 // bit 2
4735 #define CH23 AAD2CHbits.CH23 // bit 3
4737 #define ADPREF0 AADCON1bits.ADPREF0 // bit 0
4738 #define ADPREF1 AADCON1bits.ADPREF1 // bit 1
4739 #define GO_NOT_DONE_ALL AADCON1bits.GO_NOT_DONE_ALL // bit 2, shadows bit in AADCON1bits
4740 #define GO_ALL AADCON1bits.GO_ALL // bit 2, shadows bit in AADCON1bits
4741 #define ADCS0 AADCON1bits.ADCS0 // bit 4
4742 #define ADCS1 AADCON1bits.ADCS1 // bit 5
4743 #define ADCS2 AADCON1bits.ADCS2 // bit 6
4744 #define ADFM AADCON1bits.ADFM // bit 7
4746 #define AD1STG0 AADSTATbits.AD1STG0 // bit 0
4747 #define AD1STG1 AADSTATbits.AD1STG1 // bit 1
4748 #define AD1CONV AADSTATbits.AD1CONV // bit 2, shadows bit in AADSTATbits
4749 #define ADCONV AADSTATbits.ADCONV // bit 2, shadows bit in AADSTATbits
4750 #define AD2STG0 AADSTATbits.AD2STG0 // bit 4
4751 #define AD2STG1 AADSTATbits.AD2STG1 // bit 5
4752 #define AD2CONV AADSTATbits.AD2CONV // bit 6
4754 #define ANSA0 ANSELAbits.ANSA0 // bit 0
4755 #define ANSA1 ANSELAbits.ANSA1 // bit 1
4756 #define ANSA2 ANSELAbits.ANSA2 // bit 2
4757 #define ANSA4 ANSELAbits.ANSA4 // bit 4
4758 #define ANSA5 ANSELAbits.ANSA5 // bit 5
4760 #define ANSC0 ANSELCbits.ANSC0 // bit 0
4761 #define ANSC1 ANSELCbits.ANSC1 // bit 1
4762 #define ANSC2 ANSELCbits.ANSC2 // bit 2
4763 #define ANSC3 ANSELCbits.ANSC3 // bit 3
4764 #define ANSC4 ANSELCbits.ANSC4 // bit 4
4765 #define ANSC5 ANSELCbits.ANSC5 // bit 5
4767 #define GRDASEL APFCONbits.GRDASEL // bit 0
4768 #define GRDBSEL APFCONbits.GRDBSEL // bit 1
4769 #define TXCKSEL APFCONbits.TXCKSEL // bit 2
4770 #define SDSEL APFCONbits.SDSEL // bit 4
4771 #define SSSEL APFCONbits.SSSEL // bit 5
4772 #define SDOSEL APFCONbits.SDOSEL // bit 6
4773 #define RXDTSEL APFCONbits.RXDTSEL // bit 7
4775 #define ABDEN BAUDCONbits.ABDEN // bit 0
4776 #define WUE BAUDCONbits.WUE // bit 1
4777 #define BRG16 BAUDCONbits.BRG16 // bit 3
4778 #define SCKP BAUDCONbits.SCKP // bit 4
4779 #define RCIDL BAUDCONbits.RCIDL // bit 6
4780 #define ABDOVF BAUDCONbits.ABDOVF // bit 7
4782 #define BORRDY BORCONbits.BORRDY // bit 0
4783 #define BORFS BORCONbits.BORFS // bit 6
4784 #define SBOREN BORCONbits.SBOREN // bit 7
4786 #define BSR0 BSRbits.BSR0 // bit 0
4787 #define BSR1 BSRbits.BSR1 // bit 1
4788 #define BSR2 BSRbits.BSR2 // bit 2
4789 #define BSR3 BSRbits.BSR3 // bit 3
4790 #define BSR4 BSRbits.BSR4 // bit 4
4792 #define ADFVR0 FVRCONbits.ADFVR0 // bit 0
4793 #define ADFVR1 FVRCONbits.ADFVR1 // bit 1
4794 #define CDAFVR0 FVRCONbits.CDAFVR0 // bit 2
4795 #define CDAFVR1 FVRCONbits.CDAFVR1 // bit 3
4796 #define TSRNG FVRCONbits.TSRNG // bit 4
4797 #define TSEN FVRCONbits.TSEN // bit 5
4798 #define FVRRDY FVRCONbits.FVRRDY // bit 6
4799 #define FVREN FVRCONbits.FVREN // bit 7
4801 #define BKHLT ICDBK0CONbits.BKHLT // bit 0
4802 #define BKEN ICDBK0CONbits.BKEN // bit 7
4804 #define BKA8 ICDBK0Hbits.BKA8 // bit 0
4805 #define BKA9 ICDBK0Hbits.BKA9 // bit 1
4806 #define BKA10 ICDBK0Hbits.BKA10 // bit 2
4807 #define BKA11 ICDBK0Hbits.BKA11 // bit 3
4808 #define BKA12 ICDBK0Hbits.BKA12 // bit 4
4809 #define BKA13 ICDBK0Hbits.BKA13 // bit 5
4810 #define BKA14 ICDBK0Hbits.BKA14 // bit 6
4812 #define BKA0 ICDBK0Lbits.BKA0 // bit 0
4813 #define BKA1 ICDBK0Lbits.BKA1 // bit 1
4814 #define BKA2 ICDBK0Lbits.BKA2 // bit 2
4815 #define BKA3 ICDBK0Lbits.BKA3 // bit 3
4816 #define BKA4 ICDBK0Lbits.BKA4 // bit 4
4817 #define BKA5 ICDBK0Lbits.BKA5 // bit 5
4818 #define BKA6 ICDBK0Lbits.BKA6 // bit 6
4819 #define BKA7 ICDBK0Lbits.BKA7 // bit 7
4821 #define RSTVEC ICDCON0bits.RSTVEC // bit 0
4822 #define DBGINEX ICDCON0bits.DBGINEX // bit 3
4823 #define SSTEP ICDCON0bits.SSTEP // bit 5
4824 #define FREEZ ICDCON0bits.FREEZ // bit 6
4825 #define INBUG ICDCON0bits.INBUG // bit 7
4827 #define DBGIN8 ICDINSTHbits.DBGIN8 // bit 0
4828 #define DBGIN9 ICDINSTHbits.DBGIN9 // bit 1
4829 #define DBGIN10 ICDINSTHbits.DBGIN10 // bit 2
4830 #define DBGIN11 ICDINSTHbits.DBGIN11 // bit 3
4831 #define DBGIN12 ICDINSTHbits.DBGIN12 // bit 4
4832 #define DBGIN13 ICDINSTHbits.DBGIN13 // bit 5
4834 #define DBGIN0 ICDINSTLbits.DBGIN0 // bit 0
4835 #define DBGIN1 ICDINSTLbits.DBGIN1 // bit 1
4836 #define DBGIN2 ICDINSTLbits.DBGIN2 // bit 2
4837 #define DBGIN3 ICDINSTLbits.DBGIN3 // bit 3
4838 #define DBGIN4 ICDINSTLbits.DBGIN4 // bit 4
4839 #define DBGIN5 ICDINSTLbits.DBGIN5 // bit 5
4840 #define DBGIN6 ICDINSTLbits.DBGIN6 // bit 6
4841 #define DBGIN7 ICDINSTLbits.DBGIN7 // bit 7
4843 #define TRIS_ICDCLK ICDIObits.TRIS_ICDCLK // bit 2
4844 #define TRIS_ICDDAT ICDIObits.TRIS_ICDDAT // bit 3
4845 #define LAT_ICDCLK ICDIObits.LAT_ICDCLK // bit 4
4846 #define LAT_ICDDAT ICDIObits.LAT_ICDDAT // bit 5
4847 #define PORT_ICDCLK ICDIObits.PORT_ICDCLK // bit 6
4848 #define PORT_ICDDAT ICDIObits.PORT_ICDDAT // bit 7
4850 #define USRHLTF ICDSTATbits.USRHLTF // bit 1
4851 #define TRP0HLTF ICDSTATbits.TRP0HLTF // bit 6
4852 #define TRP1HLTF ICDSTATbits.TRP1HLTF // bit 7
4854 #define IOCIF INTCONbits.IOCIF // bit 0
4855 #define INTF INTCONbits.INTF // bit 1
4856 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
4857 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
4858 #define IOCIE INTCONbits.IOCIE // bit 3
4859 #define INTE INTCONbits.INTE // bit 4
4860 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
4861 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
4862 #define PEIE INTCONbits.PEIE // bit 6
4863 #define GIE INTCONbits.GIE // bit 7
4865 #define IOCAF0 IOCAFbits.IOCAF0 // bit 0
4866 #define IOCAF1 IOCAFbits.IOCAF1 // bit 1
4867 #define IOCAF2 IOCAFbits.IOCAF2 // bit 2
4868 #define IOCAF3 IOCAFbits.IOCAF3 // bit 3
4869 #define IOCAF4 IOCAFbits.IOCAF4 // bit 4
4870 #define IOCAF5 IOCAFbits.IOCAF5 // bit 5
4872 #define IOCAN0 IOCANbits.IOCAN0 // bit 0
4873 #define IOCAN1 IOCANbits.IOCAN1 // bit 1
4874 #define IOCAN2 IOCANbits.IOCAN2 // bit 2
4875 #define IOCAN3 IOCANbits.IOCAN3 // bit 3
4876 #define IOCAN4 IOCANbits.IOCAN4 // bit 4
4877 #define IOCAN5 IOCANbits.IOCAN5 // bit 5
4879 #define IOCAP0 IOCAPbits.IOCAP0 // bit 0
4880 #define IOCAP1 IOCAPbits.IOCAP1 // bit 1
4881 #define IOCAP2 IOCAPbits.IOCAP2 // bit 2
4882 #define IOCAP3 IOCAPbits.IOCAP3 // bit 3
4883 #define IOCAP4 IOCAPbits.IOCAP4 // bit 4
4884 #define IOCAP5 IOCAPbits.IOCAP5 // bit 5
4886 #define LATA0 LATAbits.LATA0 // bit 0
4887 #define LATA1 LATAbits.LATA1 // bit 1
4888 #define LATA2 LATAbits.LATA2 // bit 2
4889 #define LATA4 LATAbits.LATA4 // bit 4
4890 #define LATA5 LATAbits.LATA5 // bit 5
4892 #define LATC0 LATCbits.LATC0 // bit 0
4893 #define LATC1 LATCbits.LATC1 // bit 1
4894 #define LATC2 LATCbits.LATC2 // bit 2
4895 #define LATC3 LATCbits.LATC3 // bit 3
4896 #define LATC4 LATCbits.LATC4 // bit 4
4897 #define LATC5 LATCbits.LATC5 // bit 5
4899 #define PS0 OPTION_REGbits.PS0 // bit 0
4900 #define PS1 OPTION_REGbits.PS1 // bit 1
4901 #define PS2 OPTION_REGbits.PS2 // bit 2
4902 #define PSA OPTION_REGbits.PSA // bit 3
4903 #define TMR0SE OPTION_REGbits.TMR0SE // bit 4, shadows bit in OPTION_REGbits
4904 #define T0SE OPTION_REGbits.T0SE // bit 4, shadows bit in OPTION_REGbits
4905 #define TMR0CS OPTION_REGbits.TMR0CS // bit 5, shadows bit in OPTION_REGbits
4906 #define T0CS OPTION_REGbits.T0CS // bit 5, shadows bit in OPTION_REGbits
4907 #define INTEDG OPTION_REGbits.INTEDG // bit 6
4908 #define NOT_WPUEN OPTION_REGbits.NOT_WPUEN // bit 7
4910 #define SCS0 OSCCONbits.SCS0 // bit 0
4911 #define SCS1 OSCCONbits.SCS1 // bit 1
4912 #define IRCF0 OSCCONbits.IRCF0 // bit 3
4913 #define IRCF1 OSCCONbits.IRCF1 // bit 4
4914 #define IRCF2 OSCCONbits.IRCF2 // bit 5
4915 #define IRCF3 OSCCONbits.IRCF3 // bit 6
4916 #define SPLLEN OSCCONbits.SPLLEN // bit 7
4918 #define HFIOFS OSCSTATbits.HFIOFS // bit 0
4919 #define LFIOFR OSCSTATbits.LFIOFR // bit 1
4920 #define HFIOFR OSCSTATbits.HFIOFR // bit 4
4921 #define PLLSR OSCSTATbits.PLLSR // bit 6
4923 #define NOT_BOR PCONbits.NOT_BOR // bit 0
4924 #define NOT_POR PCONbits.NOT_POR // bit 1
4925 #define NOT_RI PCONbits.NOT_RI // bit 2
4926 #define NOT_RMCLR PCONbits.NOT_RMCLR // bit 3
4927 #define NOT_RWDT PCONbits.NOT_RWDT // bit 4
4928 #define STKUNF PCONbits.STKUNF // bit 6
4929 #define STKOVF PCONbits.STKOVF // bit 7
4931 #define TMR1IE PIE1bits.TMR1IE // bit 0
4932 #define TMR2IE PIE1bits.TMR2IE // bit 1
4933 #define SSP1IE PIE1bits.SSP1IE // bit 3
4934 #define TXIE PIE1bits.TXIE // bit 4
4935 #define RCIE PIE1bits.RCIE // bit 5
4936 #define ADIE PIE1bits.ADIE // bit 6, shadows bit in PIE1bits
4937 #define AD1IE PIE1bits.AD1IE // bit 6, shadows bit in PIE1bits
4938 #define TMR1GIE PIE1bits.TMR1GIE // bit 7
4940 #define BCL1IE PIE2bits.BCL1IE // bit 3
4941 #define AD2IE PIE2bits.AD2IE // bit 6
4943 #define TMR1IF PIR1bits.TMR1IF // bit 0
4944 #define TMR2IF PIR1bits.TMR2IF // bit 1
4945 #define SSP1IF PIR1bits.SSP1IF // bit 3
4946 #define TXIF PIR1bits.TXIF // bit 4
4947 #define RCIF PIR1bits.RCIF // bit 5
4948 #define ADIF PIR1bits.ADIF // bit 6, shadows bit in PIR1bits
4949 #define AD1IF PIR1bits.AD1IF // bit 6, shadows bit in PIR1bits
4950 #define TMR1GIF PIR1bits.TMR1GIF // bit 7
4952 #define BCL1IF PIR2bits.BCL1IF // bit 3
4953 #define AD2IF PIR2bits.AD2IF // bit 6
4955 #define RD PMCON1bits.RD // bit 0
4956 #define WR PMCON1bits.WR // bit 1
4957 #define WREN PMCON1bits.WREN // bit 2
4958 #define WRERR PMCON1bits.WRERR // bit 3
4959 #define FREE PMCON1bits.FREE // bit 4
4960 #define LWLO PMCON1bits.LWLO // bit 5
4961 #define CFGS PMCON1bits.CFGS // bit 6
4963 #define RA0 PORTAbits.RA0 // bit 0
4964 #define RA1 PORTAbits.RA1 // bit 1
4965 #define RA2 PORTAbits.RA2 // bit 2
4966 #define RA3 PORTAbits.RA3 // bit 3
4967 #define RA4 PORTAbits.RA4 // bit 4
4968 #define RA5 PORTAbits.RA5 // bit 5
4970 #define RC0 PORTCbits.RC0 // bit 0
4971 #define RC1 PORTCbits.RC1 // bit 1
4972 #define RC2 PORTCbits.RC2 // bit 2
4973 #define RC3 PORTCbits.RC3 // bit 3
4974 #define RC4 PORTCbits.RC4 // bit 4
4975 #define RC5 PORTCbits.RC5 // bit 5
4977 #define PWM1POL PWM1CONbits.PWM1POL // bit 4
4978 #define PWM1OUT PWM1CONbits.PWM1OUT // bit 5
4979 #define PWM1OE PWM1CONbits.PWM1OE // bit 6
4980 #define PWM1EN PWM1CONbits.PWM1EN // bit 7
4982 #define PWM1DCH0 PWM1DCHbits.PWM1DCH0 // bit 0
4983 #define PWM1DCH1 PWM1DCHbits.PWM1DCH1 // bit 1
4984 #define PWM1DCH2 PWM1DCHbits.PWM1DCH2 // bit 2
4985 #define PWM1DCH3 PWM1DCHbits.PWM1DCH3 // bit 3
4986 #define PWM1DCH4 PWM1DCHbits.PWM1DCH4 // bit 4
4987 #define PWM1DCH5 PWM1DCHbits.PWM1DCH5 // bit 5
4988 #define PWM1DCH6 PWM1DCHbits.PWM1DCH6 // bit 6
4989 #define PWM1DCH7 PWM1DCHbits.PWM1DCH7 // bit 7
4991 #define PWM1DCL0 PWM1DCLbits.PWM1DCL0 // bit 6
4992 #define PWM1DCL1 PWM1DCLbits.PWM1DCL1 // bit 7
4994 #define PWM2POL PWM2CONbits.PWM2POL // bit 4
4995 #define PWM2OUT PWM2CONbits.PWM2OUT // bit 5
4996 #define PWM2OE PWM2CONbits.PWM2OE // bit 6
4997 #define PWM2EN PWM2CONbits.PWM2EN // bit 7
4999 #define PWM2DCH0 PWM2DCHbits.PWM2DCH0 // bit 0
5000 #define PWM2DCH1 PWM2DCHbits.PWM2DCH1 // bit 1
5001 #define PWM2DCH2 PWM2DCHbits.PWM2DCH2 // bit 2
5002 #define PWM2DCH3 PWM2DCHbits.PWM2DCH3 // bit 3
5003 #define PWM2DCH4 PWM2DCHbits.PWM2DCH4 // bit 4
5004 #define PWM2DCH5 PWM2DCHbits.PWM2DCH5 // bit 5
5005 #define PWM2DCH6 PWM2DCHbits.PWM2DCH6 // bit 6
5006 #define PWM2DCH7 PWM2DCHbits.PWM2DCH7 // bit 7
5008 #define PWM2DCL0 PWM2DCLbits.PWM2DCL0 // bit 6
5009 #define PWM2DCL1 PWM2DCLbits.PWM2DCL1 // bit 7
5011 #define RX9D RCSTAbits.RX9D // bit 0
5012 #define OERR RCSTAbits.OERR // bit 1
5013 #define FERR RCSTAbits.FERR // bit 2
5014 #define ADDEN RCSTAbits.ADDEN // bit 3
5015 #define CREN RCSTAbits.CREN // bit 4
5016 #define SREN RCSTAbits.SREN // bit 5
5017 #define RX9 RCSTAbits.RX9 // bit 6
5018 #define SPEN RCSTAbits.SPEN // bit 7
5020 #define SSPM0 SSP1CON1bits.SSPM0 // bit 0
5021 #define SSPM1 SSP1CON1bits.SSPM1 // bit 1
5022 #define SSPM2 SSP1CON1bits.SSPM2 // bit 2
5023 #define SSPM3 SSP1CON1bits.SSPM3 // bit 3
5024 #define CKP SSP1CON1bits.CKP // bit 4
5025 #define SSPEN SSP1CON1bits.SSPEN // bit 5
5026 #define SSPOV SSP1CON1bits.SSPOV // bit 6
5027 #define WCOL SSP1CON1bits.WCOL // bit 7
5029 #define SEN SSP1CON2bits.SEN // bit 0
5030 #define RSEN SSP1CON2bits.RSEN // bit 1
5031 #define PEN SSP1CON2bits.PEN // bit 2
5032 #define RCEN SSP1CON2bits.RCEN // bit 3
5033 #define ACKEN SSP1CON2bits.ACKEN // bit 4
5034 #define ACKDT SSP1CON2bits.ACKDT // bit 5
5035 #define ACKSTAT SSP1CON2bits.ACKSTAT // bit 6
5036 #define GCEN SSP1CON2bits.GCEN // bit 7
5038 #define DHEN SSP1CON3bits.DHEN // bit 0
5039 #define AHEN SSP1CON3bits.AHEN // bit 1
5040 #define SBCDE SSP1CON3bits.SBCDE // bit 2
5041 #define SDAHT SSP1CON3bits.SDAHT // bit 3
5042 #define BOEN SSP1CON3bits.BOEN // bit 4
5043 #define SCIE SSP1CON3bits.SCIE // bit 5
5044 #define PCIE SSP1CON3bits.PCIE // bit 6
5045 #define ACKTIM SSP1CON3bits.ACKTIM // bit 7
5047 #define BF SSP1STATbits.BF // bit 0
5048 #define UA SSP1STATbits.UA // bit 1
5049 #define R_NOT_W SSP1STATbits.R_NOT_W // bit 2
5050 #define S SSP1STATbits.S // bit 3
5051 #define P SSP1STATbits.P // bit 4
5052 #define D_NOT_A SSP1STATbits.D_NOT_A // bit 5
5053 #define CKE SSP1STATbits.CKE // bit 6
5054 #define SMP SSP1STATbits.SMP // bit 7
5056 #define C STATUSbits.C // bit 0
5057 #define DC STATUSbits.DC // bit 1
5058 #define Z STATUSbits.Z // bit 2
5059 #define NOT_PD STATUSbits.NOT_PD // bit 3
5060 #define NOT_TO STATUSbits.NOT_TO // bit 4
5062 #define C_SHAD STATUS_SHADbits.C_SHAD // bit 0
5063 #define DC_SHAD STATUS_SHADbits.DC_SHAD // bit 1
5064 #define Z_SHAD STATUS_SHADbits.Z_SHAD // bit 2
5066 #define TMR1ON T1CONbits.TMR1ON // bit 0
5067 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2
5068 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
5069 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
5070 #define TMR1CS0 T1CONbits.TMR1CS0 // bit 6
5071 #define TMR1CS1 T1CONbits.TMR1CS1 // bit 7
5073 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
5074 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
5075 #define TMR2ON T2CONbits.TMR2ON // bit 2
5076 #define T2OUTPS0 T2CONbits.T2OUTPS0 // bit 3
5077 #define T2OUTPS1 T2CONbits.T2OUTPS1 // bit 4
5078 #define T2OUTPS2 T2CONbits.T2OUTPS2 // bit 5
5079 #define T2OUTPS3 T2CONbits.T2OUTPS3 // bit 6
5081 #define TRISA0 TRISAbits.TRISA0 // bit 0
5082 #define TRISA1 TRISAbits.TRISA1 // bit 1
5083 #define TRISA2 TRISAbits.TRISA2 // bit 2
5084 #define TRISA3 TRISAbits.TRISA3 // bit 3
5085 #define TRISA4 TRISAbits.TRISA4 // bit 4
5086 #define TRISA5 TRISAbits.TRISA5 // bit 5
5088 #define TRISC0 TRISCbits.TRISC0 // bit 0
5089 #define TRISC1 TRISCbits.TRISC1 // bit 1
5090 #define TRISC2 TRISCbits.TRISC2 // bit 2
5091 #define TRISC3 TRISCbits.TRISC3 // bit 3
5092 #define TRISC4 TRISCbits.TRISC4 // bit 4
5093 #define TRISC5 TRISCbits.TRISC5 // bit 5
5095 #define TX9D TXSTAbits.TX9D // bit 0
5096 #define TRMT TXSTAbits.TRMT // bit 1
5097 #define BRGH TXSTAbits.BRGH // bit 2
5098 #define SENDB TXSTAbits.SENDB // bit 3
5099 #define SYNC TXSTAbits.SYNC // bit 4
5100 #define TXEN TXSTAbits.TXEN // bit 5
5101 #define TX9 TXSTAbits.TX9 // bit 6
5102 #define CSRC TXSTAbits.CSRC // bit 7
5104 #define SWDTEN WDTCONbits.SWDTEN // bit 0
5105 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1
5106 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2
5107 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3
5108 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4
5109 #define WDTPS4 WDTCONbits.WDTPS4 // bit 5
5111 #define WPUA0 WPUAbits.WPUA0 // bit 0
5112 #define WPUA1 WPUAbits.WPUA1 // bit 1
5113 #define WPUA2 WPUAbits.WPUA2 // bit 2
5114 #define WPUA3 WPUAbits.WPUA3 // bit 3
5115 #define WPUA4 WPUAbits.WPUA4 // bit 4
5116 #define WPUA5 WPUAbits.WPUA5 // bit 5
5118 #endif // #ifndef NO_BIT_DEFINES
5120 #endif // #ifndef __PIC16LF1554_H__