struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16f1829.h
blobcdb5e720090a3e1a1fbf5a9661d0bea7fb34b9cb
1 /*
2 * This declarations of the PIC16F1829 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:20 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 __PIC16F1829_H__
26 #define __PIC16F1829_H__
28 //==============================================================================
30 // Register Addresses
32 //==============================================================================
34 #ifndef NO_ADDR_DEFINES
36 #define INDF0_ADDR 0x0000
37 #define INDF1_ADDR 0x0001
38 #define PCL_ADDR 0x0002
39 #define STATUS_ADDR 0x0003
40 #define FSR0_ADDR 0x0004
41 #define FSR0L_ADDR 0x0004
42 #define FSR0H_ADDR 0x0005
43 #define FSR1_ADDR 0x0006
44 #define FSR1L_ADDR 0x0006
45 #define FSR1H_ADDR 0x0007
46 #define BSR_ADDR 0x0008
47 #define WREG_ADDR 0x0009
48 #define PCLATH_ADDR 0x000A
49 #define INTCON_ADDR 0x000B
50 #define PORTA_ADDR 0x000C
51 #define PORTB_ADDR 0x000D
52 #define PORTC_ADDR 0x000E
53 #define PIR1_ADDR 0x0011
54 #define PIR2_ADDR 0x0012
55 #define PIR3_ADDR 0x0013
56 #define PIR4_ADDR 0x0014
57 #define TMR0_ADDR 0x0015
58 #define TMR1_ADDR 0x0016
59 #define TMR1L_ADDR 0x0016
60 #define TMR1H_ADDR 0x0017
61 #define T1CON_ADDR 0x0018
62 #define T1GCON_ADDR 0x0019
63 #define TMR2_ADDR 0x001A
64 #define PR2_ADDR 0x001B
65 #define T2CON_ADDR 0x001C
66 #define CPSCON0_ADDR 0x001E
67 #define CPSCON1_ADDR 0x001F
68 #define TRISA_ADDR 0x008C
69 #define TRISB_ADDR 0x008D
70 #define TRISC_ADDR 0x008E
71 #define PIE1_ADDR 0x0091
72 #define PIE2_ADDR 0x0092
73 #define PIE3_ADDR 0x0093
74 #define PIE4_ADDR 0x0094
75 #define OPTION_REG_ADDR 0x0095
76 #define PCON_ADDR 0x0096
77 #define WDTCON_ADDR 0x0097
78 #define OSCTUNE_ADDR 0x0098
79 #define OSCCON_ADDR 0x0099
80 #define OSCSTAT_ADDR 0x009A
81 #define ADRES_ADDR 0x009B
82 #define ADRESL_ADDR 0x009B
83 #define ADRESH_ADDR 0x009C
84 #define ADCON0_ADDR 0x009D
85 #define ADCON1_ADDR 0x009E
86 #define LATA_ADDR 0x010C
87 #define LATB_ADDR 0x010D
88 #define LATC_ADDR 0x010E
89 #define CM1CON0_ADDR 0x0111
90 #define CM1CON1_ADDR 0x0112
91 #define CM2CON0_ADDR 0x0113
92 #define CM2CON1_ADDR 0x0114
93 #define CMOUT_ADDR 0x0115
94 #define BORCON_ADDR 0x0116
95 #define FVRCON_ADDR 0x0117
96 #define DACCON0_ADDR 0x0118
97 #define DACCON1_ADDR 0x0119
98 #define SRCON0_ADDR 0x011A
99 #define SRCON1_ADDR 0x011B
100 #define APFCON0_ADDR 0x011D
101 #define APFCON1_ADDR 0x011E
102 #define ANSELA_ADDR 0x018C
103 #define ANSELB_ADDR 0x018D
104 #define ANSELC_ADDR 0x018E
105 #define EEADR_ADDR 0x0191
106 #define EEADRL_ADDR 0x0191
107 #define EEADRH_ADDR 0x0192
108 #define EEDAT_ADDR 0x0193
109 #define EEDATL_ADDR 0x0193
110 #define EEDATH_ADDR 0x0194
111 #define EECON1_ADDR 0x0195
112 #define EECON2_ADDR 0x0196
113 #define RCREG_ADDR 0x0199
114 #define TXREG_ADDR 0x019A
115 #define SPBRG_ADDR 0x019B
116 #define SPBRGL_ADDR 0x019B
117 #define SPBRGH_ADDR 0x019C
118 #define RCSTA_ADDR 0x019D
119 #define TXSTA_ADDR 0x019E
120 #define BAUDCON_ADDR 0x019F
121 #define WPUA_ADDR 0x020C
122 #define WPUB_ADDR 0x020D
123 #define WPUC_ADDR 0x020E
124 #define SSP1BUF_ADDR 0x0211
125 #define SSPBUF_ADDR 0x0211
126 #define SSP1ADD_ADDR 0x0212
127 #define SSPADD_ADDR 0x0212
128 #define SSP1MSK_ADDR 0x0213
129 #define SSPMSK_ADDR 0x0213
130 #define SSP1STAT_ADDR 0x0214
131 #define SSPSTAT_ADDR 0x0214
132 #define SSP1CON1_ADDR 0x0215
133 #define SSPCON_ADDR 0x0215
134 #define SSPCON1_ADDR 0x0215
135 #define SSP1CON2_ADDR 0x0216
136 #define SSPCON2_ADDR 0x0216
137 #define SSP1CON3_ADDR 0x0217
138 #define SSPCON3_ADDR 0x0217
139 #define SSP2BUF_ADDR 0x0219
140 #define SSP2ADD_ADDR 0x021A
141 #define SSP2MSK_ADDR 0x021B
142 #define SSP2STAT_ADDR 0x021C
143 #define SSP2CON1_ADDR 0x021D
144 #define SSP2CON2_ADDR 0x021E
145 #define SSP2CON3_ADDR 0x021F
146 #define CCPR1_ADDR 0x0291
147 #define CCPR1L_ADDR 0x0291
148 #define CCPR1H_ADDR 0x0292
149 #define CCP1CON_ADDR 0x0293
150 #define PWM1CON_ADDR 0x0294
151 #define CCP1AS_ADDR 0x0295
152 #define ECCP1AS_ADDR 0x0295
153 #define PSTR1CON_ADDR 0x0296
154 #define CCPR2_ADDR 0x0298
155 #define CCPR2L_ADDR 0x0298
156 #define CCPR2H_ADDR 0x0299
157 #define CCP2CON_ADDR 0x029A
158 #define PWM2CON_ADDR 0x029B
159 #define CCP2AS_ADDR 0x029C
160 #define PSTR2CON_ADDR 0x029D
161 #define CCPTMRS_ADDR 0x029E
162 #define CCPR3_ADDR 0x0311
163 #define CCPR3L_ADDR 0x0311
164 #define CCPR3H_ADDR 0x0312
165 #define CCP3CON_ADDR 0x0313
166 #define CCPR4_ADDR 0x0318
167 #define CCPR4L_ADDR 0x0318
168 #define CCPR4H_ADDR 0x0319
169 #define CCP4CON_ADDR 0x031A
170 #define INLVLA_ADDR 0x038C
171 #define INLVLB_ADDR 0x038D
172 #define INLVLC_ADDR 0x038E
173 #define IOCAP_ADDR 0x0391
174 #define IOCAN_ADDR 0x0392
175 #define IOCAF_ADDR 0x0393
176 #define IOCBP_ADDR 0x0394
177 #define IOCBN_ADDR 0x0395
178 #define IOCBF_ADDR 0x0396
179 #define CLKRCON_ADDR 0x039A
180 #define MDCON_ADDR 0x039C
181 #define MDSRC_ADDR 0x039D
182 #define MDCARL_ADDR 0x039E
183 #define MDCARH_ADDR 0x039F
184 #define TMR4_ADDR 0x0415
185 #define PR4_ADDR 0x0416
186 #define T4CON_ADDR 0x0417
187 #define TMR6_ADDR 0x041C
188 #define PR6_ADDR 0x041D
189 #define T6CON_ADDR 0x041E
190 #define STATUS_SHAD_ADDR 0x0FE4
191 #define WREG_SHAD_ADDR 0x0FE5
192 #define BSR_SHAD_ADDR 0x0FE6
193 #define PCLATH_SHAD_ADDR 0x0FE7
194 #define FSR0L_SHAD_ADDR 0x0FE8
195 #define FSR0H_SHAD_ADDR 0x0FE9
196 #define FSR1L_SHAD_ADDR 0x0FEA
197 #define FSR1H_SHAD_ADDR 0x0FEB
198 #define STKPTR_ADDR 0x0FED
199 #define TOSL_ADDR 0x0FEE
200 #define TOSH_ADDR 0x0FEF
202 #endif // #ifndef NO_ADDR_DEFINES
204 //==============================================================================
206 // Register Definitions
208 //==============================================================================
210 extern __at(0x0000) __sfr INDF0;
211 extern __at(0x0001) __sfr INDF1;
212 extern __at(0x0002) __sfr PCL;
214 //==============================================================================
215 // STATUS Bits
217 extern __at(0x0003) __sfr STATUS;
219 typedef struct
221 unsigned C : 1;
222 unsigned DC : 1;
223 unsigned Z : 1;
224 unsigned NOT_PD : 1;
225 unsigned NOT_TO : 1;
226 unsigned : 1;
227 unsigned : 1;
228 unsigned : 1;
229 } __STATUSbits_t;
231 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
233 #define _C 0x01
234 #define _DC 0x02
235 #define _Z 0x04
236 #define _NOT_PD 0x08
237 #define _NOT_TO 0x10
239 //==============================================================================
241 extern __at(0x0004) __sfr FSR0;
242 extern __at(0x0004) __sfr FSR0L;
243 extern __at(0x0005) __sfr FSR0H;
244 extern __at(0x0006) __sfr FSR1;
245 extern __at(0x0006) __sfr FSR1L;
246 extern __at(0x0007) __sfr FSR1H;
248 //==============================================================================
249 // BSR Bits
251 extern __at(0x0008) __sfr BSR;
253 typedef union
255 struct
257 unsigned BSR0 : 1;
258 unsigned BSR1 : 1;
259 unsigned BSR2 : 1;
260 unsigned BSR3 : 1;
261 unsigned BSR4 : 1;
262 unsigned : 1;
263 unsigned : 1;
264 unsigned : 1;
267 struct
269 unsigned BSR : 5;
270 unsigned : 3;
272 } __BSRbits_t;
274 extern __at(0x0008) volatile __BSRbits_t BSRbits;
276 #define _BSR0 0x01
277 #define _BSR1 0x02
278 #define _BSR2 0x04
279 #define _BSR3 0x08
280 #define _BSR4 0x10
282 //==============================================================================
284 extern __at(0x0009) __sfr WREG;
285 extern __at(0x000A) __sfr PCLATH;
287 //==============================================================================
288 // INTCON Bits
290 extern __at(0x000B) __sfr INTCON;
292 typedef union
294 struct
296 unsigned IOCIF : 1;
297 unsigned INTF : 1;
298 unsigned TMR0IF : 1;
299 unsigned IOCIE : 1;
300 unsigned INTE : 1;
301 unsigned TMR0IE : 1;
302 unsigned PEIE : 1;
303 unsigned GIE : 1;
306 struct
308 unsigned : 1;
309 unsigned : 1;
310 unsigned T0IF : 1;
311 unsigned : 1;
312 unsigned : 1;
313 unsigned T0IE : 1;
314 unsigned : 1;
315 unsigned : 1;
317 } __INTCONbits_t;
319 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
321 #define _IOCIF 0x01
322 #define _INTF 0x02
323 #define _TMR0IF 0x04
324 #define _T0IF 0x04
325 #define _IOCIE 0x08
326 #define _INTE 0x10
327 #define _TMR0IE 0x20
328 #define _T0IE 0x20
329 #define _PEIE 0x40
330 #define _GIE 0x80
332 //==============================================================================
335 //==============================================================================
336 // PORTA Bits
338 extern __at(0x000C) __sfr PORTA;
340 typedef union
342 struct
344 unsigned RA0 : 1;
345 unsigned RA1 : 1;
346 unsigned RA2 : 1;
347 unsigned RA3 : 1;
348 unsigned RA4 : 1;
349 unsigned RA5 : 1;
350 unsigned : 1;
351 unsigned : 1;
354 struct
356 unsigned RA : 6;
357 unsigned : 2;
359 } __PORTAbits_t;
361 extern __at(0x000C) volatile __PORTAbits_t PORTAbits;
363 #define _RA0 0x01
364 #define _RA1 0x02
365 #define _RA2 0x04
366 #define _RA3 0x08
367 #define _RA4 0x10
368 #define _RA5 0x20
370 //==============================================================================
373 //==============================================================================
374 // PORTB Bits
376 extern __at(0x000D) __sfr PORTB;
378 typedef struct
380 unsigned : 1;
381 unsigned : 1;
382 unsigned : 1;
383 unsigned : 1;
384 unsigned RB4 : 1;
385 unsigned RB5 : 1;
386 unsigned RB6 : 1;
387 unsigned RB7 : 1;
388 } __PORTBbits_t;
390 extern __at(0x000D) volatile __PORTBbits_t PORTBbits;
392 #define _RB4 0x10
393 #define _RB5 0x20
394 #define _RB6 0x40
395 #define _RB7 0x80
397 //==============================================================================
400 //==============================================================================
401 // PORTC Bits
403 extern __at(0x000E) __sfr PORTC;
405 typedef struct
407 unsigned RC0 : 1;
408 unsigned RC1 : 1;
409 unsigned RC2 : 1;
410 unsigned RC3 : 1;
411 unsigned RC4 : 1;
412 unsigned RC5 : 1;
413 unsigned RC6 : 1;
414 unsigned RC7 : 1;
415 } __PORTCbits_t;
417 extern __at(0x000E) volatile __PORTCbits_t PORTCbits;
419 #define _RC0 0x01
420 #define _RC1 0x02
421 #define _RC2 0x04
422 #define _RC3 0x08
423 #define _RC4 0x10
424 #define _RC5 0x20
425 #define _RC6 0x40
426 #define _RC7 0x80
428 //==============================================================================
431 //==============================================================================
432 // PIR1 Bits
434 extern __at(0x0011) __sfr PIR1;
436 typedef struct
438 unsigned TMR1IF : 1;
439 unsigned TMR2IF : 1;
440 unsigned CCP1IF : 1;
441 unsigned SSP1IF : 1;
442 unsigned TXIF : 1;
443 unsigned RCIF : 1;
444 unsigned ADIF : 1;
445 unsigned TMR1GIF : 1;
446 } __PIR1bits_t;
448 extern __at(0x0011) volatile __PIR1bits_t PIR1bits;
450 #define _TMR1IF 0x01
451 #define _TMR2IF 0x02
452 #define _CCP1IF 0x04
453 #define _SSP1IF 0x08
454 #define _TXIF 0x10
455 #define _RCIF 0x20
456 #define _ADIF 0x40
457 #define _TMR1GIF 0x80
459 //==============================================================================
462 //==============================================================================
463 // PIR2 Bits
465 extern __at(0x0012) __sfr PIR2;
467 typedef struct
469 unsigned CCP2IF : 1;
470 unsigned : 1;
471 unsigned : 1;
472 unsigned BCL1IF : 1;
473 unsigned EEIF : 1;
474 unsigned C1IF : 1;
475 unsigned C2IF : 1;
476 unsigned OSFIF : 1;
477 } __PIR2bits_t;
479 extern __at(0x0012) volatile __PIR2bits_t PIR2bits;
481 #define _CCP2IF 0x01
482 #define _BCL1IF 0x08
483 #define _EEIF 0x10
484 #define _C1IF 0x20
485 #define _C2IF 0x40
486 #define _OSFIF 0x80
488 //==============================================================================
491 //==============================================================================
492 // PIR3 Bits
494 extern __at(0x0013) __sfr PIR3;
496 typedef struct
498 unsigned : 1;
499 unsigned TMR4IF : 1;
500 unsigned : 1;
501 unsigned TMR6IF : 1;
502 unsigned CCP3IF : 1;
503 unsigned CCP4IF : 1;
504 unsigned : 1;
505 unsigned : 1;
506 } __PIR3bits_t;
508 extern __at(0x0013) volatile __PIR3bits_t PIR3bits;
510 #define _TMR4IF 0x02
511 #define _TMR6IF 0x08
512 #define _CCP3IF 0x10
513 #define _CCP4IF 0x20
515 //==============================================================================
518 //==============================================================================
519 // PIR4 Bits
521 extern __at(0x0014) __sfr PIR4;
523 typedef struct
525 unsigned SSP2IF : 1;
526 unsigned BCL2IF : 1;
527 unsigned : 1;
528 unsigned : 1;
529 unsigned : 1;
530 unsigned : 1;
531 unsigned : 1;
532 unsigned : 1;
533 } __PIR4bits_t;
535 extern __at(0x0014) volatile __PIR4bits_t PIR4bits;
537 #define _SSP2IF 0x01
538 #define _BCL2IF 0x02
540 //==============================================================================
542 extern __at(0x0015) __sfr TMR0;
543 extern __at(0x0016) __sfr TMR1;
544 extern __at(0x0016) __sfr TMR1L;
545 extern __at(0x0017) __sfr TMR1H;
547 //==============================================================================
548 // T1CON Bits
550 extern __at(0x0018) __sfr T1CON;
552 typedef union
554 struct
556 unsigned TMR1ON : 1;
557 unsigned : 1;
558 unsigned NOT_T1SYNC : 1;
559 unsigned T1OSCEN : 1;
560 unsigned T1CKPS0 : 1;
561 unsigned T1CKPS1 : 1;
562 unsigned TMR1CS0 : 1;
563 unsigned TMR1CS1 : 1;
566 struct
568 unsigned : 4;
569 unsigned T1CKPS : 2;
570 unsigned : 2;
573 struct
575 unsigned : 6;
576 unsigned TMR1CS : 2;
578 } __T1CONbits_t;
580 extern __at(0x0018) volatile __T1CONbits_t T1CONbits;
582 #define _TMR1ON 0x01
583 #define _NOT_T1SYNC 0x04
584 #define _T1OSCEN 0x08
585 #define _T1CKPS0 0x10
586 #define _T1CKPS1 0x20
587 #define _TMR1CS0 0x40
588 #define _TMR1CS1 0x80
590 //==============================================================================
593 //==============================================================================
594 // T1GCON Bits
596 extern __at(0x0019) __sfr T1GCON;
598 typedef union
600 struct
602 unsigned T1GSS0 : 1;
603 unsigned T1GSS1 : 1;
604 unsigned T1GVAL : 1;
605 unsigned T1GGO : 1;
606 unsigned T1GSPM : 1;
607 unsigned T1GTM : 1;
608 unsigned T1GPOL : 1;
609 unsigned TMR1GE : 1;
612 struct
614 unsigned T1GSS : 2;
615 unsigned : 6;
617 } __T1GCONbits_t;
619 extern __at(0x0019) volatile __T1GCONbits_t T1GCONbits;
621 #define _T1GSS0 0x01
622 #define _T1GSS1 0x02
623 #define _T1GVAL 0x04
624 #define _T1GGO 0x08
625 #define _T1GSPM 0x10
626 #define _T1GTM 0x20
627 #define _T1GPOL 0x40
628 #define _TMR1GE 0x80
630 //==============================================================================
632 extern __at(0x001A) __sfr TMR2;
633 extern __at(0x001B) __sfr PR2;
635 //==============================================================================
636 // T2CON Bits
638 extern __at(0x001C) __sfr T2CON;
640 typedef union
642 struct
644 unsigned T2CKPS0 : 1;
645 unsigned T2CKPS1 : 1;
646 unsigned TMR2ON : 1;
647 unsigned T2OUTPS0 : 1;
648 unsigned T2OUTPS1 : 1;
649 unsigned T2OUTPS2 : 1;
650 unsigned T2OUTPS3 : 1;
651 unsigned : 1;
654 struct
656 unsigned T2CKPS : 2;
657 unsigned : 6;
660 struct
662 unsigned : 3;
663 unsigned T2OUTPS : 4;
664 unsigned : 1;
666 } __T2CONbits_t;
668 extern __at(0x001C) volatile __T2CONbits_t T2CONbits;
670 #define _T2CKPS0 0x01
671 #define _T2CKPS1 0x02
672 #define _TMR2ON 0x04
673 #define _T2OUTPS0 0x08
674 #define _T2OUTPS1 0x10
675 #define _T2OUTPS2 0x20
676 #define _T2OUTPS3 0x40
678 //==============================================================================
681 //==============================================================================
682 // CPSCON0 Bits
684 extern __at(0x001E) __sfr CPSCON0;
686 typedef union
688 struct
690 unsigned T0XCS : 1;
691 unsigned CPSOUT : 1;
692 unsigned CPSRNG0 : 1;
693 unsigned CPSRNG1 : 1;
694 unsigned : 1;
695 unsigned : 1;
696 unsigned CPSRM : 1;
697 unsigned CPSON : 1;
700 struct
702 unsigned : 2;
703 unsigned CPSRNG : 2;
704 unsigned : 4;
706 } __CPSCON0bits_t;
708 extern __at(0x001E) volatile __CPSCON0bits_t CPSCON0bits;
710 #define _T0XCS 0x01
711 #define _CPSOUT 0x02
712 #define _CPSRNG0 0x04
713 #define _CPSRNG1 0x08
714 #define _CPSRM 0x40
715 #define _CPSON 0x80
717 //==============================================================================
720 //==============================================================================
721 // CPSCON1 Bits
723 extern __at(0x001F) __sfr CPSCON1;
725 typedef union
727 struct
729 unsigned CPSCH0 : 1;
730 unsigned CPSCH1 : 1;
731 unsigned CPSCH2 : 1;
732 unsigned CPSCH3 : 1;
733 unsigned : 1;
734 unsigned : 1;
735 unsigned : 1;
736 unsigned : 1;
739 struct
741 unsigned CPSCH : 4;
742 unsigned : 4;
744 } __CPSCON1bits_t;
746 extern __at(0x001F) volatile __CPSCON1bits_t CPSCON1bits;
748 #define _CPSCH0 0x01
749 #define _CPSCH1 0x02
750 #define _CPSCH2 0x04
751 #define _CPSCH3 0x08
753 //==============================================================================
756 //==============================================================================
757 // TRISA Bits
759 extern __at(0x008C) __sfr TRISA;
761 typedef union
763 struct
765 unsigned TRISA0 : 1;
766 unsigned TRISA1 : 1;
767 unsigned TRISA2 : 1;
768 unsigned TRISA3 : 1;
769 unsigned TRISA4 : 1;
770 unsigned TRISA5 : 1;
771 unsigned : 1;
772 unsigned : 1;
775 struct
777 unsigned TRISA : 6;
778 unsigned : 2;
780 } __TRISAbits_t;
782 extern __at(0x008C) volatile __TRISAbits_t TRISAbits;
784 #define _TRISA0 0x01
785 #define _TRISA1 0x02
786 #define _TRISA2 0x04
787 #define _TRISA3 0x08
788 #define _TRISA4 0x10
789 #define _TRISA5 0x20
791 //==============================================================================
794 //==============================================================================
795 // TRISB Bits
797 extern __at(0x008D) __sfr TRISB;
799 typedef struct
801 unsigned : 1;
802 unsigned : 1;
803 unsigned : 1;
804 unsigned : 1;
805 unsigned TRISB4 : 1;
806 unsigned TRISB5 : 1;
807 unsigned TRISB6 : 1;
808 unsigned TRISB7 : 1;
809 } __TRISBbits_t;
811 extern __at(0x008D) volatile __TRISBbits_t TRISBbits;
813 #define _TRISB4 0x10
814 #define _TRISB5 0x20
815 #define _TRISB6 0x40
816 #define _TRISB7 0x80
818 //==============================================================================
821 //==============================================================================
822 // TRISC Bits
824 extern __at(0x008E) __sfr TRISC;
826 typedef struct
828 unsigned TRISC0 : 1;
829 unsigned TRISC1 : 1;
830 unsigned TRISC2 : 1;
831 unsigned TRISC3 : 1;
832 unsigned TRISC4 : 1;
833 unsigned TRISC5 : 1;
834 unsigned TRISC6 : 1;
835 unsigned TRISC7 : 1;
836 } __TRISCbits_t;
838 extern __at(0x008E) volatile __TRISCbits_t TRISCbits;
840 #define _TRISC0 0x01
841 #define _TRISC1 0x02
842 #define _TRISC2 0x04
843 #define _TRISC3 0x08
844 #define _TRISC4 0x10
845 #define _TRISC5 0x20
846 #define _TRISC6 0x40
847 #define _TRISC7 0x80
849 //==============================================================================
852 //==============================================================================
853 // PIE1 Bits
855 extern __at(0x0091) __sfr PIE1;
857 typedef struct
859 unsigned TMR1IE : 1;
860 unsigned TMR2IE : 1;
861 unsigned CCP1IE : 1;
862 unsigned SSP1IE : 1;
863 unsigned TXIE : 1;
864 unsigned RCIE : 1;
865 unsigned ADIE : 1;
866 unsigned TMR1GIE : 1;
867 } __PIE1bits_t;
869 extern __at(0x0091) volatile __PIE1bits_t PIE1bits;
871 #define _TMR1IE 0x01
872 #define _TMR2IE 0x02
873 #define _CCP1IE 0x04
874 #define _SSP1IE 0x08
875 #define _TXIE 0x10
876 #define _RCIE 0x20
877 #define _ADIE 0x40
878 #define _TMR1GIE 0x80
880 //==============================================================================
883 //==============================================================================
884 // PIE2 Bits
886 extern __at(0x0092) __sfr PIE2;
888 typedef struct
890 unsigned CCP2IE : 1;
891 unsigned : 1;
892 unsigned : 1;
893 unsigned BCL1IE : 1;
894 unsigned EEIE : 1;
895 unsigned C1IE : 1;
896 unsigned C2IE : 1;
897 unsigned OSFIE : 1;
898 } __PIE2bits_t;
900 extern __at(0x0092) volatile __PIE2bits_t PIE2bits;
902 #define _CCP2IE 0x01
903 #define _BCL1IE 0x08
904 #define _EEIE 0x10
905 #define _C1IE 0x20
906 #define _C2IE 0x40
907 #define _OSFIE 0x80
909 //==============================================================================
912 //==============================================================================
913 // PIE3 Bits
915 extern __at(0x0093) __sfr PIE3;
917 typedef struct
919 unsigned : 1;
920 unsigned TMR4IE : 1;
921 unsigned : 1;
922 unsigned TMR6IE : 1;
923 unsigned CCP3IE : 1;
924 unsigned CCP4IE : 1;
925 unsigned : 1;
926 unsigned : 1;
927 } __PIE3bits_t;
929 extern __at(0x0093) volatile __PIE3bits_t PIE3bits;
931 #define _TMR4IE 0x02
932 #define _TMR6IE 0x08
933 #define _CCP3IE 0x10
934 #define _CCP4IE 0x20
936 //==============================================================================
939 //==============================================================================
940 // PIE4 Bits
942 extern __at(0x0094) __sfr PIE4;
944 typedef struct
946 unsigned SSP2IE : 1;
947 unsigned BCL2IE : 1;
948 unsigned : 1;
949 unsigned : 1;
950 unsigned : 1;
951 unsigned : 1;
952 unsigned : 1;
953 unsigned : 1;
954 } __PIE4bits_t;
956 extern __at(0x0094) volatile __PIE4bits_t PIE4bits;
958 #define _SSP2IE 0x01
959 #define _BCL2IE 0x02
961 //==============================================================================
964 //==============================================================================
965 // OPTION_REG Bits
967 extern __at(0x0095) __sfr OPTION_REG;
969 typedef union
971 struct
973 unsigned PS0 : 1;
974 unsigned PS1 : 1;
975 unsigned PS2 : 1;
976 unsigned PSA : 1;
977 unsigned TMR0SE : 1;
978 unsigned TMR0CS : 1;
979 unsigned INTEDG : 1;
980 unsigned NOT_WPUEN : 1;
983 struct
985 unsigned : 1;
986 unsigned : 1;
987 unsigned : 1;
988 unsigned : 1;
989 unsigned T0SE : 1;
990 unsigned T0CS : 1;
991 unsigned : 1;
992 unsigned : 1;
995 struct
997 unsigned PS : 3;
998 unsigned : 5;
1000 } __OPTION_REGbits_t;
1002 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits;
1004 #define _PS0 0x01
1005 #define _PS1 0x02
1006 #define _PS2 0x04
1007 #define _PSA 0x08
1008 #define _TMR0SE 0x10
1009 #define _T0SE 0x10
1010 #define _TMR0CS 0x20
1011 #define _T0CS 0x20
1012 #define _INTEDG 0x40
1013 #define _NOT_WPUEN 0x80
1015 //==============================================================================
1018 //==============================================================================
1019 // PCON Bits
1021 extern __at(0x0096) __sfr PCON;
1023 typedef struct
1025 unsigned NOT_BOR : 1;
1026 unsigned NOT_POR : 1;
1027 unsigned NOT_RI : 1;
1028 unsigned NOT_RMCLR : 1;
1029 unsigned : 1;
1030 unsigned : 1;
1031 unsigned STKUNF : 1;
1032 unsigned STKOVF : 1;
1033 } __PCONbits_t;
1035 extern __at(0x0096) volatile __PCONbits_t PCONbits;
1037 #define _NOT_BOR 0x01
1038 #define _NOT_POR 0x02
1039 #define _NOT_RI 0x04
1040 #define _NOT_RMCLR 0x08
1041 #define _STKUNF 0x40
1042 #define _STKOVF 0x80
1044 //==============================================================================
1047 //==============================================================================
1048 // WDTCON Bits
1050 extern __at(0x0097) __sfr WDTCON;
1052 typedef union
1054 struct
1056 unsigned SWDTEN : 1;
1057 unsigned WDTPS0 : 1;
1058 unsigned WDTPS1 : 1;
1059 unsigned WDTPS2 : 1;
1060 unsigned WDTPS3 : 1;
1061 unsigned WDTPS4 : 1;
1062 unsigned : 1;
1063 unsigned : 1;
1066 struct
1068 unsigned : 1;
1069 unsigned WDTPS : 5;
1070 unsigned : 2;
1072 } __WDTCONbits_t;
1074 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
1076 #define _SWDTEN 0x01
1077 #define _WDTPS0 0x02
1078 #define _WDTPS1 0x04
1079 #define _WDTPS2 0x08
1080 #define _WDTPS3 0x10
1081 #define _WDTPS4 0x20
1083 //==============================================================================
1086 //==============================================================================
1087 // OSCTUNE Bits
1089 extern __at(0x0098) __sfr OSCTUNE;
1091 typedef union
1093 struct
1095 unsigned TUN0 : 1;
1096 unsigned TUN1 : 1;
1097 unsigned TUN2 : 1;
1098 unsigned TUN3 : 1;
1099 unsigned TUN4 : 1;
1100 unsigned TUN5 : 1;
1101 unsigned : 1;
1102 unsigned : 1;
1105 struct
1107 unsigned TUN : 6;
1108 unsigned : 2;
1110 } __OSCTUNEbits_t;
1112 extern __at(0x0098) volatile __OSCTUNEbits_t OSCTUNEbits;
1114 #define _TUN0 0x01
1115 #define _TUN1 0x02
1116 #define _TUN2 0x04
1117 #define _TUN3 0x08
1118 #define _TUN4 0x10
1119 #define _TUN5 0x20
1121 //==============================================================================
1124 //==============================================================================
1125 // OSCCON Bits
1127 extern __at(0x0099) __sfr OSCCON;
1129 typedef union
1131 struct
1133 unsigned SCS0 : 1;
1134 unsigned SCS1 : 1;
1135 unsigned : 1;
1136 unsigned IRCF0 : 1;
1137 unsigned IRCF1 : 1;
1138 unsigned IRCF2 : 1;
1139 unsigned IRCF3 : 1;
1140 unsigned SPLLEN : 1;
1143 struct
1145 unsigned SCS : 2;
1146 unsigned : 6;
1149 struct
1151 unsigned : 3;
1152 unsigned IRCF : 4;
1153 unsigned : 1;
1155 } __OSCCONbits_t;
1157 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits;
1159 #define _SCS0 0x01
1160 #define _SCS1 0x02
1161 #define _IRCF0 0x08
1162 #define _IRCF1 0x10
1163 #define _IRCF2 0x20
1164 #define _IRCF3 0x40
1165 #define _SPLLEN 0x80
1167 //==============================================================================
1170 //==============================================================================
1171 // OSCSTAT Bits
1173 extern __at(0x009A) __sfr OSCSTAT;
1175 typedef struct
1177 unsigned HFIOFS : 1;
1178 unsigned LFIOFR : 1;
1179 unsigned MFIOFR : 1;
1180 unsigned HFIOFL : 1;
1181 unsigned HFIOFR : 1;
1182 unsigned OSTS : 1;
1183 unsigned PLLR : 1;
1184 unsigned T1OSCR : 1;
1185 } __OSCSTATbits_t;
1187 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits;
1189 #define _HFIOFS 0x01
1190 #define _LFIOFR 0x02
1191 #define _MFIOFR 0x04
1192 #define _HFIOFL 0x08
1193 #define _HFIOFR 0x10
1194 #define _OSTS 0x20
1195 #define _PLLR 0x40
1196 #define _T1OSCR 0x80
1198 //==============================================================================
1200 extern __at(0x009B) __sfr ADRES;
1201 extern __at(0x009B) __sfr ADRESL;
1202 extern __at(0x009C) __sfr ADRESH;
1204 //==============================================================================
1205 // ADCON0 Bits
1207 extern __at(0x009D) __sfr ADCON0;
1209 typedef union
1211 struct
1213 unsigned ADON : 1;
1214 unsigned GO_NOT_DONE : 1;
1215 unsigned CHS0 : 1;
1216 unsigned CHS1 : 1;
1217 unsigned CHS2 : 1;
1218 unsigned CHS3 : 1;
1219 unsigned CHS4 : 1;
1220 unsigned : 1;
1223 struct
1225 unsigned : 1;
1226 unsigned ADGO : 1;
1227 unsigned : 1;
1228 unsigned : 1;
1229 unsigned : 1;
1230 unsigned : 1;
1231 unsigned : 1;
1232 unsigned : 1;
1235 struct
1237 unsigned : 1;
1238 unsigned GO : 1;
1239 unsigned : 1;
1240 unsigned : 1;
1241 unsigned : 1;
1242 unsigned : 1;
1243 unsigned : 1;
1244 unsigned : 1;
1247 struct
1249 unsigned : 2;
1250 unsigned CHS : 5;
1251 unsigned : 1;
1253 } __ADCON0bits_t;
1255 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits;
1257 #define _ADON 0x01
1258 #define _GO_NOT_DONE 0x02
1259 #define _ADGO 0x02
1260 #define _GO 0x02
1261 #define _CHS0 0x04
1262 #define _CHS1 0x08
1263 #define _CHS2 0x10
1264 #define _CHS3 0x20
1265 #define _CHS4 0x40
1267 //==============================================================================
1270 //==============================================================================
1271 // ADCON1 Bits
1273 extern __at(0x009E) __sfr ADCON1;
1275 typedef union
1277 struct
1279 unsigned ADPREF0 : 1;
1280 unsigned ADPREF1 : 1;
1281 unsigned ADNREF : 1;
1282 unsigned : 1;
1283 unsigned ADCS0 : 1;
1284 unsigned ADCS1 : 1;
1285 unsigned ADCS2 : 1;
1286 unsigned ADFM : 1;
1289 struct
1291 unsigned ADPREF : 2;
1292 unsigned : 6;
1295 struct
1297 unsigned : 4;
1298 unsigned ADCS : 3;
1299 unsigned : 1;
1301 } __ADCON1bits_t;
1303 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits;
1305 #define _ADPREF0 0x01
1306 #define _ADPREF1 0x02
1307 #define _ADNREF 0x04
1308 #define _ADCS0 0x10
1309 #define _ADCS1 0x20
1310 #define _ADCS2 0x40
1311 #define _ADFM 0x80
1313 //==============================================================================
1316 //==============================================================================
1317 // LATA Bits
1319 extern __at(0x010C) __sfr LATA;
1321 typedef struct
1323 unsigned LATA0 : 1;
1324 unsigned LATA1 : 1;
1325 unsigned LATA2 : 1;
1326 unsigned : 1;
1327 unsigned LATA4 : 1;
1328 unsigned LATA5 : 1;
1329 unsigned : 1;
1330 unsigned : 1;
1331 } __LATAbits_t;
1333 extern __at(0x010C) volatile __LATAbits_t LATAbits;
1335 #define _LATA0 0x01
1336 #define _LATA1 0x02
1337 #define _LATA2 0x04
1338 #define _LATA4 0x10
1339 #define _LATA5 0x20
1341 //==============================================================================
1344 //==============================================================================
1345 // LATB Bits
1347 extern __at(0x010D) __sfr LATB;
1349 typedef struct
1351 unsigned : 1;
1352 unsigned : 1;
1353 unsigned : 1;
1354 unsigned : 1;
1355 unsigned LATB4 : 1;
1356 unsigned LATB5 : 1;
1357 unsigned LATB6 : 1;
1358 unsigned LATB7 : 1;
1359 } __LATBbits_t;
1361 extern __at(0x010D) volatile __LATBbits_t LATBbits;
1363 #define _LATB4 0x10
1364 #define _LATB5 0x20
1365 #define _LATB6 0x40
1366 #define _LATB7 0x80
1368 //==============================================================================
1371 //==============================================================================
1372 // LATC Bits
1374 extern __at(0x010E) __sfr LATC;
1376 typedef struct
1378 unsigned LATC0 : 1;
1379 unsigned LATC1 : 1;
1380 unsigned LATC2 : 1;
1381 unsigned LATC3 : 1;
1382 unsigned LATC4 : 1;
1383 unsigned LATC5 : 1;
1384 unsigned LATC6 : 1;
1385 unsigned LATC7 : 1;
1386 } __LATCbits_t;
1388 extern __at(0x010E) volatile __LATCbits_t LATCbits;
1390 #define _LATC0 0x01
1391 #define _LATC1 0x02
1392 #define _LATC2 0x04
1393 #define _LATC3 0x08
1394 #define _LATC4 0x10
1395 #define _LATC5 0x20
1396 #define _LATC6 0x40
1397 #define _LATC7 0x80
1399 //==============================================================================
1402 //==============================================================================
1403 // CM1CON0 Bits
1405 extern __at(0x0111) __sfr CM1CON0;
1407 typedef struct
1409 unsigned C1SYNC : 1;
1410 unsigned C1HYS : 1;
1411 unsigned C1SP : 1;
1412 unsigned : 1;
1413 unsigned C1POL : 1;
1414 unsigned C1OE : 1;
1415 unsigned C1OUT : 1;
1416 unsigned C1ON : 1;
1417 } __CM1CON0bits_t;
1419 extern __at(0x0111) volatile __CM1CON0bits_t CM1CON0bits;
1421 #define _C1SYNC 0x01
1422 #define _C1HYS 0x02
1423 #define _C1SP 0x04
1424 #define _C1POL 0x10
1425 #define _C1OE 0x20
1426 #define _C1OUT 0x40
1427 #define _C1ON 0x80
1429 //==============================================================================
1432 //==============================================================================
1433 // CM1CON1 Bits
1435 extern __at(0x0112) __sfr CM1CON1;
1437 typedef union
1439 struct
1441 unsigned C1NCH0 : 1;
1442 unsigned C1NCH1 : 1;
1443 unsigned : 1;
1444 unsigned : 1;
1445 unsigned C1PCH0 : 1;
1446 unsigned C1PCH1 : 1;
1447 unsigned C1INTN : 1;
1448 unsigned C1INTP : 1;
1451 struct
1453 unsigned C1NCH : 2;
1454 unsigned : 6;
1457 struct
1459 unsigned : 4;
1460 unsigned C1PCH : 2;
1461 unsigned : 2;
1463 } __CM1CON1bits_t;
1465 extern __at(0x0112) volatile __CM1CON1bits_t CM1CON1bits;
1467 #define _C1NCH0 0x01
1468 #define _C1NCH1 0x02
1469 #define _C1PCH0 0x10
1470 #define _C1PCH1 0x20
1471 #define _C1INTN 0x40
1472 #define _C1INTP 0x80
1474 //==============================================================================
1477 //==============================================================================
1478 // CM2CON0 Bits
1480 extern __at(0x0113) __sfr CM2CON0;
1482 typedef struct
1484 unsigned C2SYNC : 1;
1485 unsigned C2HYS : 1;
1486 unsigned C2SP : 1;
1487 unsigned : 1;
1488 unsigned C2POL : 1;
1489 unsigned C2OE : 1;
1490 unsigned C2OUT : 1;
1491 unsigned C2ON : 1;
1492 } __CM2CON0bits_t;
1494 extern __at(0x0113) volatile __CM2CON0bits_t CM2CON0bits;
1496 #define _C2SYNC 0x01
1497 #define _C2HYS 0x02
1498 #define _C2SP 0x04
1499 #define _C2POL 0x10
1500 #define _C2OE 0x20
1501 #define _C2OUT 0x40
1502 #define _C2ON 0x80
1504 //==============================================================================
1507 //==============================================================================
1508 // CM2CON1 Bits
1510 extern __at(0x0114) __sfr CM2CON1;
1512 typedef union
1514 struct
1516 unsigned C2NCH0 : 1;
1517 unsigned C2NCH1 : 1;
1518 unsigned : 1;
1519 unsigned : 1;
1520 unsigned C2PCH0 : 1;
1521 unsigned C2PCH1 : 1;
1522 unsigned C2INTN : 1;
1523 unsigned C2INTP : 1;
1526 struct
1528 unsigned C2NCH : 2;
1529 unsigned : 6;
1532 struct
1534 unsigned : 4;
1535 unsigned C2PCH : 2;
1536 unsigned : 2;
1538 } __CM2CON1bits_t;
1540 extern __at(0x0114) volatile __CM2CON1bits_t CM2CON1bits;
1542 #define _C2NCH0 0x01
1543 #define _C2NCH1 0x02
1544 #define _C2PCH0 0x10
1545 #define _C2PCH1 0x20
1546 #define _C2INTN 0x40
1547 #define _C2INTP 0x80
1549 //==============================================================================
1552 //==============================================================================
1553 // CMOUT Bits
1555 extern __at(0x0115) __sfr CMOUT;
1557 typedef struct
1559 unsigned MC1OUT : 1;
1560 unsigned MC2OUT : 1;
1561 unsigned : 1;
1562 unsigned : 1;
1563 unsigned : 1;
1564 unsigned : 1;
1565 unsigned : 1;
1566 unsigned : 1;
1567 } __CMOUTbits_t;
1569 extern __at(0x0115) volatile __CMOUTbits_t CMOUTbits;
1571 #define _MC1OUT 0x01
1572 #define _MC2OUT 0x02
1574 //==============================================================================
1577 //==============================================================================
1578 // BORCON Bits
1580 extern __at(0x0116) __sfr BORCON;
1582 typedef struct
1584 unsigned BORRDY : 1;
1585 unsigned : 1;
1586 unsigned : 1;
1587 unsigned : 1;
1588 unsigned : 1;
1589 unsigned : 1;
1590 unsigned : 1;
1591 unsigned SBOREN : 1;
1592 } __BORCONbits_t;
1594 extern __at(0x0116) volatile __BORCONbits_t BORCONbits;
1596 #define _BORRDY 0x01
1597 #define _SBOREN 0x80
1599 //==============================================================================
1602 //==============================================================================
1603 // FVRCON Bits
1605 extern __at(0x0117) __sfr FVRCON;
1607 typedef union
1609 struct
1611 unsigned ADFVR0 : 1;
1612 unsigned ADFVR1 : 1;
1613 unsigned CDAFVR0 : 1;
1614 unsigned CDAFVR1 : 1;
1615 unsigned TSRNG : 1;
1616 unsigned TSEN : 1;
1617 unsigned FVRRDY : 1;
1618 unsigned FVREN : 1;
1621 struct
1623 unsigned ADFVR : 2;
1624 unsigned : 6;
1627 struct
1629 unsigned : 2;
1630 unsigned CDAFVR : 2;
1631 unsigned : 4;
1633 } __FVRCONbits_t;
1635 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits;
1637 #define _ADFVR0 0x01
1638 #define _ADFVR1 0x02
1639 #define _CDAFVR0 0x04
1640 #define _CDAFVR1 0x08
1641 #define _TSRNG 0x10
1642 #define _TSEN 0x20
1643 #define _FVRRDY 0x40
1644 #define _FVREN 0x80
1646 //==============================================================================
1649 //==============================================================================
1650 // DACCON0 Bits
1652 extern __at(0x0118) __sfr DACCON0;
1654 typedef union
1656 struct
1658 unsigned DACNSS : 1;
1659 unsigned : 1;
1660 unsigned DACPSS0 : 1;
1661 unsigned DACPSS1 : 1;
1662 unsigned : 1;
1663 unsigned DACOE : 1;
1664 unsigned DACLPS : 1;
1665 unsigned DACEN : 1;
1668 struct
1670 unsigned : 2;
1671 unsigned DACPSS : 2;
1672 unsigned : 4;
1674 } __DACCON0bits_t;
1676 extern __at(0x0118) volatile __DACCON0bits_t DACCON0bits;
1678 #define _DACNSS 0x01
1679 #define _DACPSS0 0x04
1680 #define _DACPSS1 0x08
1681 #define _DACOE 0x20
1682 #define _DACLPS 0x40
1683 #define _DACEN 0x80
1685 //==============================================================================
1688 //==============================================================================
1689 // DACCON1 Bits
1691 extern __at(0x0119) __sfr DACCON1;
1693 typedef union
1695 struct
1697 unsigned DACR0 : 1;
1698 unsigned DACR1 : 1;
1699 unsigned DACR2 : 1;
1700 unsigned DACR3 : 1;
1701 unsigned DACR4 : 1;
1702 unsigned : 1;
1703 unsigned : 1;
1704 unsigned : 1;
1707 struct
1709 unsigned DACR : 5;
1710 unsigned : 3;
1712 } __DACCON1bits_t;
1714 extern __at(0x0119) volatile __DACCON1bits_t DACCON1bits;
1716 #define _DACR0 0x01
1717 #define _DACR1 0x02
1718 #define _DACR2 0x04
1719 #define _DACR3 0x08
1720 #define _DACR4 0x10
1722 //==============================================================================
1725 //==============================================================================
1726 // SRCON0 Bits
1728 extern __at(0x011A) __sfr SRCON0;
1730 typedef union
1732 struct
1734 unsigned SRPR : 1;
1735 unsigned SRPS : 1;
1736 unsigned SRNQEN : 1;
1737 unsigned SRQEN : 1;
1738 unsigned SRCLK0 : 1;
1739 unsigned SRCLK1 : 1;
1740 unsigned SRCLK2 : 1;
1741 unsigned SRLEN : 1;
1744 struct
1746 unsigned : 4;
1747 unsigned SRCLK : 3;
1748 unsigned : 1;
1750 } __SRCON0bits_t;
1752 extern __at(0x011A) volatile __SRCON0bits_t SRCON0bits;
1754 #define _SRPR 0x01
1755 #define _SRPS 0x02
1756 #define _SRNQEN 0x04
1757 #define _SRQEN 0x08
1758 #define _SRCLK0 0x10
1759 #define _SRCLK1 0x20
1760 #define _SRCLK2 0x40
1761 #define _SRLEN 0x80
1763 //==============================================================================
1766 //==============================================================================
1767 // SRCON1 Bits
1769 extern __at(0x011B) __sfr SRCON1;
1771 typedef struct
1773 unsigned SRRC1E : 1;
1774 unsigned SRRC2E : 1;
1775 unsigned SRRCKE : 1;
1776 unsigned SRRPE : 1;
1777 unsigned SRSC1E : 1;
1778 unsigned SRSC2E : 1;
1779 unsigned SRSCKE : 1;
1780 unsigned SRSPE : 1;
1781 } __SRCON1bits_t;
1783 extern __at(0x011B) volatile __SRCON1bits_t SRCON1bits;
1785 #define _SRRC1E 0x01
1786 #define _SRRC2E 0x02
1787 #define _SRRCKE 0x04
1788 #define _SRRPE 0x08
1789 #define _SRSC1E 0x10
1790 #define _SRSC2E 0x20
1791 #define _SRSCKE 0x40
1792 #define _SRSPE 0x80
1794 //==============================================================================
1797 //==============================================================================
1798 // APFCON0 Bits
1800 extern __at(0x011D) __sfr APFCON0;
1802 typedef struct
1804 unsigned : 1;
1805 unsigned : 1;
1806 unsigned TXCKSEL : 1;
1807 unsigned T1GSEL : 1;
1808 unsigned : 1;
1809 unsigned : 1;
1810 unsigned : 1;
1811 unsigned RXDTSEL : 1;
1812 } __APFCON0bits_t;
1814 extern __at(0x011D) volatile __APFCON0bits_t APFCON0bits;
1816 #define _TXCKSEL 0x04
1817 #define _T1GSEL 0x08
1818 #define _RXDTSEL 0x80
1820 //==============================================================================
1823 //==============================================================================
1824 // APFCON1 Bits
1826 extern __at(0x011E) __sfr APFCON1;
1828 typedef struct
1830 unsigned CCP2SEL : 1;
1831 unsigned P2BSEL : 1;
1832 unsigned P1CSEL : 1;
1833 unsigned P1DSEL : 1;
1834 unsigned SS2SEL : 1;
1835 unsigned SDO2SEL : 1;
1836 unsigned : 1;
1837 unsigned : 1;
1838 } __APFCON1bits_t;
1840 extern __at(0x011E) volatile __APFCON1bits_t APFCON1bits;
1842 #define _CCP2SEL 0x01
1843 #define _P2BSEL 0x02
1844 #define _P1CSEL 0x04
1845 #define _P1DSEL 0x08
1846 #define _SS2SEL 0x10
1847 #define _SDO2SEL 0x20
1849 //==============================================================================
1852 //==============================================================================
1853 // ANSELA Bits
1855 extern __at(0x018C) __sfr ANSELA;
1857 typedef struct
1859 unsigned ANSA0 : 1;
1860 unsigned ANSA1 : 1;
1861 unsigned ANSA2 : 1;
1862 unsigned : 1;
1863 unsigned ANSA4 : 1;
1864 unsigned : 1;
1865 unsigned : 1;
1866 unsigned : 1;
1867 } __ANSELAbits_t;
1869 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits;
1871 #define _ANSA0 0x01
1872 #define _ANSA1 0x02
1873 #define _ANSA2 0x04
1874 #define _ANSA4 0x10
1876 //==============================================================================
1879 //==============================================================================
1880 // ANSELB Bits
1882 extern __at(0x018D) __sfr ANSELB;
1884 typedef struct
1886 unsigned : 1;
1887 unsigned : 1;
1888 unsigned : 1;
1889 unsigned : 1;
1890 unsigned ANSB4 : 1;
1891 unsigned ANSB5 : 1;
1892 unsigned : 1;
1893 unsigned : 1;
1894 } __ANSELBbits_t;
1896 extern __at(0x018D) volatile __ANSELBbits_t ANSELBbits;
1898 #define _ANSB4 0x10
1899 #define _ANSB5 0x20
1901 //==============================================================================
1904 //==============================================================================
1905 // ANSELC Bits
1907 extern __at(0x018E) __sfr ANSELC;
1909 typedef struct
1911 unsigned ANSC0 : 1;
1912 unsigned ANSC1 : 1;
1913 unsigned ANSC2 : 1;
1914 unsigned ANSC3 : 1;
1915 unsigned : 1;
1916 unsigned : 1;
1917 unsigned ANSC6 : 1;
1918 unsigned ANSC7 : 1;
1919 } __ANSELCbits_t;
1921 extern __at(0x018E) volatile __ANSELCbits_t ANSELCbits;
1923 #define _ANSC0 0x01
1924 #define _ANSC1 0x02
1925 #define _ANSC2 0x04
1926 #define _ANSC3 0x08
1927 #define _ANSC6 0x40
1928 #define _ANSC7 0x80
1930 //==============================================================================
1932 extern __at(0x0191) __sfr EEADR;
1933 extern __at(0x0191) __sfr EEADRL;
1934 extern __at(0x0192) __sfr EEADRH;
1935 extern __at(0x0193) __sfr EEDAT;
1936 extern __at(0x0193) __sfr EEDATL;
1937 extern __at(0x0194) __sfr EEDATH;
1939 //==============================================================================
1940 // EECON1 Bits
1942 extern __at(0x0195) __sfr EECON1;
1944 typedef struct
1946 unsigned RD : 1;
1947 unsigned WR : 1;
1948 unsigned WREN : 1;
1949 unsigned WRERR : 1;
1950 unsigned FREE : 1;
1951 unsigned LWLO : 1;
1952 unsigned CFGS : 1;
1953 unsigned EEPGD : 1;
1954 } __EECON1bits_t;
1956 extern __at(0x0195) volatile __EECON1bits_t EECON1bits;
1958 #define _RD 0x01
1959 #define _WR 0x02
1960 #define _WREN 0x04
1961 #define _WRERR 0x08
1962 #define _FREE 0x10
1963 #define _LWLO 0x20
1964 #define _CFGS 0x40
1965 #define _EEPGD 0x80
1967 //==============================================================================
1969 extern __at(0x0196) __sfr EECON2;
1970 extern __at(0x0199) __sfr RCREG;
1971 extern __at(0x019A) __sfr TXREG;
1972 extern __at(0x019B) __sfr SPBRG;
1973 extern __at(0x019B) __sfr SPBRGL;
1974 extern __at(0x019C) __sfr SPBRGH;
1976 //==============================================================================
1977 // RCSTA Bits
1979 extern __at(0x019D) __sfr RCSTA;
1981 typedef struct
1983 unsigned RX9D : 1;
1984 unsigned OERR : 1;
1985 unsigned FERR : 1;
1986 unsigned ADDEN : 1;
1987 unsigned CREN : 1;
1988 unsigned SREN : 1;
1989 unsigned RX9 : 1;
1990 unsigned SPEN : 1;
1991 } __RCSTAbits_t;
1993 extern __at(0x019D) volatile __RCSTAbits_t RCSTAbits;
1995 #define _RX9D 0x01
1996 #define _OERR 0x02
1997 #define _FERR 0x04
1998 #define _ADDEN 0x08
1999 #define _CREN 0x10
2000 #define _SREN 0x20
2001 #define _RX9 0x40
2002 #define _SPEN 0x80
2004 //==============================================================================
2007 //==============================================================================
2008 // TXSTA Bits
2010 extern __at(0x019E) __sfr TXSTA;
2012 typedef struct
2014 unsigned TX9D : 1;
2015 unsigned TRMT : 1;
2016 unsigned BRGH : 1;
2017 unsigned SENDB : 1;
2018 unsigned SYNC : 1;
2019 unsigned TXEN : 1;
2020 unsigned TX9 : 1;
2021 unsigned CSRC : 1;
2022 } __TXSTAbits_t;
2024 extern __at(0x019E) volatile __TXSTAbits_t TXSTAbits;
2026 #define _TX9D 0x01
2027 #define _TRMT 0x02
2028 #define _BRGH 0x04
2029 #define _SENDB 0x08
2030 #define _SYNC 0x10
2031 #define _TXEN 0x20
2032 #define _TX9 0x40
2033 #define _CSRC 0x80
2035 //==============================================================================
2038 //==============================================================================
2039 // BAUDCON Bits
2041 extern __at(0x019F) __sfr BAUDCON;
2043 typedef struct
2045 unsigned ABDEN : 1;
2046 unsigned WUE : 1;
2047 unsigned : 1;
2048 unsigned BRG16 : 1;
2049 unsigned SCKP : 1;
2050 unsigned : 1;
2051 unsigned RCIDL : 1;
2052 unsigned ABDOVF : 1;
2053 } __BAUDCONbits_t;
2055 extern __at(0x019F) volatile __BAUDCONbits_t BAUDCONbits;
2057 #define _ABDEN 0x01
2058 #define _WUE 0x02
2059 #define _BRG16 0x08
2060 #define _SCKP 0x10
2061 #define _RCIDL 0x40
2062 #define _ABDOVF 0x80
2064 //==============================================================================
2067 //==============================================================================
2068 // WPUA Bits
2070 extern __at(0x020C) __sfr WPUA;
2072 typedef union
2074 struct
2076 unsigned WPUA0 : 1;
2077 unsigned WPUA1 : 1;
2078 unsigned WPUA2 : 1;
2079 unsigned WPUA3 : 1;
2080 unsigned WPUA4 : 1;
2081 unsigned WPUA5 : 1;
2082 unsigned : 1;
2083 unsigned : 1;
2086 struct
2088 unsigned WPUA : 6;
2089 unsigned : 2;
2091 } __WPUAbits_t;
2093 extern __at(0x020C) volatile __WPUAbits_t WPUAbits;
2095 #define _WPUA0 0x01
2096 #define _WPUA1 0x02
2097 #define _WPUA2 0x04
2098 #define _WPUA3 0x08
2099 #define _WPUA4 0x10
2100 #define _WPUA5 0x20
2102 //==============================================================================
2105 //==============================================================================
2106 // WPUB Bits
2108 extern __at(0x020D) __sfr WPUB;
2110 typedef struct
2112 unsigned : 1;
2113 unsigned : 1;
2114 unsigned : 1;
2115 unsigned : 1;
2116 unsigned WPUB4 : 1;
2117 unsigned WPUB5 : 1;
2118 unsigned WPUB6 : 1;
2119 unsigned WPUB7 : 1;
2120 } __WPUBbits_t;
2122 extern __at(0x020D) volatile __WPUBbits_t WPUBbits;
2124 #define _WPUB4 0x10
2125 #define _WPUB5 0x20
2126 #define _WPUB6 0x40
2127 #define _WPUB7 0x80
2129 //==============================================================================
2132 //==============================================================================
2133 // WPUC Bits
2135 extern __at(0x020E) __sfr WPUC;
2137 typedef struct
2139 unsigned WPUC0 : 1;
2140 unsigned WPUC1 : 1;
2141 unsigned WPUC2 : 1;
2142 unsigned WPUC3 : 1;
2143 unsigned WPUC4 : 1;
2144 unsigned WPUC5 : 1;
2145 unsigned WPUC6 : 1;
2146 unsigned WPUC7 : 1;
2147 } __WPUCbits_t;
2149 extern __at(0x020E) volatile __WPUCbits_t WPUCbits;
2151 #define _WPUC0 0x01
2152 #define _WPUC1 0x02
2153 #define _WPUC2 0x04
2154 #define _WPUC3 0x08
2155 #define _WPUC4 0x10
2156 #define _WPUC5 0x20
2157 #define _WPUC6 0x40
2158 #define _WPUC7 0x80
2160 //==============================================================================
2162 extern __at(0x0211) __sfr SSP1BUF;
2163 extern __at(0x0211) __sfr SSPBUF;
2164 extern __at(0x0212) __sfr SSP1ADD;
2165 extern __at(0x0212) __sfr SSPADD;
2166 extern __at(0x0213) __sfr SSP1MSK;
2167 extern __at(0x0213) __sfr SSPMSK;
2169 //==============================================================================
2170 // SSP1STAT Bits
2172 extern __at(0x0214) __sfr SSP1STAT;
2174 typedef struct
2176 unsigned BF : 1;
2177 unsigned UA : 1;
2178 unsigned R_NOT_W : 1;
2179 unsigned S : 1;
2180 unsigned P : 1;
2181 unsigned D_NOT_A : 1;
2182 unsigned CKE : 1;
2183 unsigned SMP : 1;
2184 } __SSP1STATbits_t;
2186 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits;
2188 #define _BF 0x01
2189 #define _UA 0x02
2190 #define _R_NOT_W 0x04
2191 #define _S 0x08
2192 #define _P 0x10
2193 #define _D_NOT_A 0x20
2194 #define _CKE 0x40
2195 #define _SMP 0x80
2197 //==============================================================================
2200 //==============================================================================
2201 // SSPSTAT Bits
2203 extern __at(0x0214) __sfr SSPSTAT;
2205 typedef struct
2207 unsigned BF : 1;
2208 unsigned UA : 1;
2209 unsigned R_NOT_W : 1;
2210 unsigned S : 1;
2211 unsigned P : 1;
2212 unsigned D_NOT_A : 1;
2213 unsigned CKE : 1;
2214 unsigned SMP : 1;
2215 } __SSPSTATbits_t;
2217 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits;
2219 #define _SSPSTAT_BF 0x01
2220 #define _SSPSTAT_UA 0x02
2221 #define _SSPSTAT_R_NOT_W 0x04
2222 #define _SSPSTAT_S 0x08
2223 #define _SSPSTAT_P 0x10
2224 #define _SSPSTAT_D_NOT_A 0x20
2225 #define _SSPSTAT_CKE 0x40
2226 #define _SSPSTAT_SMP 0x80
2228 //==============================================================================
2231 //==============================================================================
2232 // SSP1CON1 Bits
2234 extern __at(0x0215) __sfr SSP1CON1;
2236 typedef union
2238 struct
2240 unsigned SSPM0 : 1;
2241 unsigned SSPM1 : 1;
2242 unsigned SSPM2 : 1;
2243 unsigned SSPM3 : 1;
2244 unsigned CKP : 1;
2245 unsigned SSPEN : 1;
2246 unsigned SSPOV : 1;
2247 unsigned WCOL : 1;
2250 struct
2252 unsigned SSPM : 4;
2253 unsigned : 4;
2255 } __SSP1CON1bits_t;
2257 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits;
2259 #define _SSPM0 0x01
2260 #define _SSPM1 0x02
2261 #define _SSPM2 0x04
2262 #define _SSPM3 0x08
2263 #define _CKP 0x10
2264 #define _SSPEN 0x20
2265 #define _SSPOV 0x40
2266 #define _WCOL 0x80
2268 //==============================================================================
2271 //==============================================================================
2272 // SSPCON Bits
2274 extern __at(0x0215) __sfr SSPCON;
2276 typedef union
2278 struct
2280 unsigned SSPM0 : 1;
2281 unsigned SSPM1 : 1;
2282 unsigned SSPM2 : 1;
2283 unsigned SSPM3 : 1;
2284 unsigned CKP : 1;
2285 unsigned SSPEN : 1;
2286 unsigned SSPOV : 1;
2287 unsigned WCOL : 1;
2290 struct
2292 unsigned SSPM : 4;
2293 unsigned : 4;
2295 } __SSPCONbits_t;
2297 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits;
2299 #define _SSPCON_SSPM0 0x01
2300 #define _SSPCON_SSPM1 0x02
2301 #define _SSPCON_SSPM2 0x04
2302 #define _SSPCON_SSPM3 0x08
2303 #define _SSPCON_CKP 0x10
2304 #define _SSPCON_SSPEN 0x20
2305 #define _SSPCON_SSPOV 0x40
2306 #define _SSPCON_WCOL 0x80
2308 //==============================================================================
2311 //==============================================================================
2312 // SSPCON1 Bits
2314 extern __at(0x0215) __sfr SSPCON1;
2316 typedef union
2318 struct
2320 unsigned SSPM0 : 1;
2321 unsigned SSPM1 : 1;
2322 unsigned SSPM2 : 1;
2323 unsigned SSPM3 : 1;
2324 unsigned CKP : 1;
2325 unsigned SSPEN : 1;
2326 unsigned SSPOV : 1;
2327 unsigned WCOL : 1;
2330 struct
2332 unsigned SSPM : 4;
2333 unsigned : 4;
2335 } __SSPCON1bits_t;
2337 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits;
2339 #define _SSPCON1_SSPM0 0x01
2340 #define _SSPCON1_SSPM1 0x02
2341 #define _SSPCON1_SSPM2 0x04
2342 #define _SSPCON1_SSPM3 0x08
2343 #define _SSPCON1_CKP 0x10
2344 #define _SSPCON1_SSPEN 0x20
2345 #define _SSPCON1_SSPOV 0x40
2346 #define _SSPCON1_WCOL 0x80
2348 //==============================================================================
2351 //==============================================================================
2352 // SSP1CON2 Bits
2354 extern __at(0x0216) __sfr SSP1CON2;
2356 typedef struct
2358 unsigned SEN : 1;
2359 unsigned RSEN : 1;
2360 unsigned PEN : 1;
2361 unsigned RCEN : 1;
2362 unsigned ACKEN : 1;
2363 unsigned ACKDT : 1;
2364 unsigned ACKSTAT : 1;
2365 unsigned GCEN : 1;
2366 } __SSP1CON2bits_t;
2368 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits;
2370 #define _SEN 0x01
2371 #define _RSEN 0x02
2372 #define _PEN 0x04
2373 #define _RCEN 0x08
2374 #define _ACKEN 0x10
2375 #define _ACKDT 0x20
2376 #define _ACKSTAT 0x40
2377 #define _GCEN 0x80
2379 //==============================================================================
2382 //==============================================================================
2383 // SSPCON2 Bits
2385 extern __at(0x0216) __sfr SSPCON2;
2387 typedef struct
2389 unsigned SEN : 1;
2390 unsigned RSEN : 1;
2391 unsigned PEN : 1;
2392 unsigned RCEN : 1;
2393 unsigned ACKEN : 1;
2394 unsigned ACKDT : 1;
2395 unsigned ACKSTAT : 1;
2396 unsigned GCEN : 1;
2397 } __SSPCON2bits_t;
2399 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits;
2401 #define _SSPCON2_SEN 0x01
2402 #define _SSPCON2_RSEN 0x02
2403 #define _SSPCON2_PEN 0x04
2404 #define _SSPCON2_RCEN 0x08
2405 #define _SSPCON2_ACKEN 0x10
2406 #define _SSPCON2_ACKDT 0x20
2407 #define _SSPCON2_ACKSTAT 0x40
2408 #define _SSPCON2_GCEN 0x80
2410 //==============================================================================
2413 //==============================================================================
2414 // SSP1CON3 Bits
2416 extern __at(0x0217) __sfr SSP1CON3;
2418 typedef struct
2420 unsigned DHEN : 1;
2421 unsigned AHEN : 1;
2422 unsigned SBCDE : 1;
2423 unsigned SDAHT : 1;
2424 unsigned BOEN : 1;
2425 unsigned SCIE : 1;
2426 unsigned PCIE : 1;
2427 unsigned ACKTIM : 1;
2428 } __SSP1CON3bits_t;
2430 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits;
2432 #define _DHEN 0x01
2433 #define _AHEN 0x02
2434 #define _SBCDE 0x04
2435 #define _SDAHT 0x08
2436 #define _BOEN 0x10
2437 #define _SCIE 0x20
2438 #define _PCIE 0x40
2439 #define _ACKTIM 0x80
2441 //==============================================================================
2444 //==============================================================================
2445 // SSPCON3 Bits
2447 extern __at(0x0217) __sfr SSPCON3;
2449 typedef struct
2451 unsigned DHEN : 1;
2452 unsigned AHEN : 1;
2453 unsigned SBCDE : 1;
2454 unsigned SDAHT : 1;
2455 unsigned BOEN : 1;
2456 unsigned SCIE : 1;
2457 unsigned PCIE : 1;
2458 unsigned ACKTIM : 1;
2459 } __SSPCON3bits_t;
2461 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits;
2463 #define _SSPCON3_DHEN 0x01
2464 #define _SSPCON3_AHEN 0x02
2465 #define _SSPCON3_SBCDE 0x04
2466 #define _SSPCON3_SDAHT 0x08
2467 #define _SSPCON3_BOEN 0x10
2468 #define _SSPCON3_SCIE 0x20
2469 #define _SSPCON3_PCIE 0x40
2470 #define _SSPCON3_ACKTIM 0x80
2472 //==============================================================================
2474 extern __at(0x0219) __sfr SSP2BUF;
2475 extern __at(0x021A) __sfr SSP2ADD;
2476 extern __at(0x021B) __sfr SSP2MSK;
2478 //==============================================================================
2479 // SSP2STAT Bits
2481 extern __at(0x021C) __sfr SSP2STAT;
2483 typedef struct
2485 unsigned BF : 1;
2486 unsigned UA : 1;
2487 unsigned R_NOT_W : 1;
2488 unsigned S : 1;
2489 unsigned P : 1;
2490 unsigned D_NOT_A : 1;
2491 unsigned CKE : 1;
2492 unsigned SMP : 1;
2493 } __SSP2STATbits_t;
2495 extern __at(0x021C) volatile __SSP2STATbits_t SSP2STATbits;
2497 #define _SSP2STAT_BF 0x01
2498 #define _SSP2STAT_UA 0x02
2499 #define _SSP2STAT_R_NOT_W 0x04
2500 #define _SSP2STAT_S 0x08
2501 #define _SSP2STAT_P 0x10
2502 #define _SSP2STAT_D_NOT_A 0x20
2503 #define _SSP2STAT_CKE 0x40
2504 #define _SSP2STAT_SMP 0x80
2506 //==============================================================================
2509 //==============================================================================
2510 // SSP2CON1 Bits
2512 extern __at(0x021D) __sfr SSP2CON1;
2514 typedef union
2516 struct
2518 unsigned SSPM0 : 1;
2519 unsigned SSPM1 : 1;
2520 unsigned SSPM2 : 1;
2521 unsigned SSPM3 : 1;
2522 unsigned CKP : 1;
2523 unsigned SSPEN : 1;
2524 unsigned SSPOV : 1;
2525 unsigned WCOL : 1;
2528 struct
2530 unsigned SSPM : 4;
2531 unsigned : 4;
2533 } __SSP2CON1bits_t;
2535 extern __at(0x021D) volatile __SSP2CON1bits_t SSP2CON1bits;
2537 #define _SSP2CON1_SSPM0 0x01
2538 #define _SSP2CON1_SSPM1 0x02
2539 #define _SSP2CON1_SSPM2 0x04
2540 #define _SSP2CON1_SSPM3 0x08
2541 #define _SSP2CON1_CKP 0x10
2542 #define _SSP2CON1_SSPEN 0x20
2543 #define _SSP2CON1_SSPOV 0x40
2544 #define _SSP2CON1_WCOL 0x80
2546 //==============================================================================
2549 //==============================================================================
2550 // SSP2CON2 Bits
2552 extern __at(0x021E) __sfr SSP2CON2;
2554 typedef struct
2556 unsigned SEN : 1;
2557 unsigned RSEN : 1;
2558 unsigned PEN : 1;
2559 unsigned RCEN : 1;
2560 unsigned ACKEN : 1;
2561 unsigned ACKDT : 1;
2562 unsigned ACKSTAT : 1;
2563 unsigned GCEN : 1;
2564 } __SSP2CON2bits_t;
2566 extern __at(0x021E) volatile __SSP2CON2bits_t SSP2CON2bits;
2568 #define _SSP2CON2_SEN 0x01
2569 #define _SSP2CON2_RSEN 0x02
2570 #define _SSP2CON2_PEN 0x04
2571 #define _SSP2CON2_RCEN 0x08
2572 #define _SSP2CON2_ACKEN 0x10
2573 #define _SSP2CON2_ACKDT 0x20
2574 #define _SSP2CON2_ACKSTAT 0x40
2575 #define _SSP2CON2_GCEN 0x80
2577 //==============================================================================
2580 //==============================================================================
2581 // SSP2CON3 Bits
2583 extern __at(0x021F) __sfr SSP2CON3;
2585 typedef struct
2587 unsigned DHEN : 1;
2588 unsigned AHEN : 1;
2589 unsigned SBCDE : 1;
2590 unsigned SDAHT : 1;
2591 unsigned BOEN : 1;
2592 unsigned SCIE : 1;
2593 unsigned PCIE : 1;
2594 unsigned ACKTIM : 1;
2595 } __SSP2CON3bits_t;
2597 extern __at(0x021F) volatile __SSP2CON3bits_t SSP2CON3bits;
2599 #define _SSP2CON3_DHEN 0x01
2600 #define _SSP2CON3_AHEN 0x02
2601 #define _SSP2CON3_SBCDE 0x04
2602 #define _SSP2CON3_SDAHT 0x08
2603 #define _SSP2CON3_BOEN 0x10
2604 #define _SSP2CON3_SCIE 0x20
2605 #define _SSP2CON3_PCIE 0x40
2606 #define _SSP2CON3_ACKTIM 0x80
2608 //==============================================================================
2610 extern __at(0x0291) __sfr CCPR1;
2611 extern __at(0x0291) __sfr CCPR1L;
2612 extern __at(0x0292) __sfr CCPR1H;
2614 //==============================================================================
2615 // CCP1CON Bits
2617 extern __at(0x0293) __sfr CCP1CON;
2619 typedef union
2621 struct
2623 unsigned CCP1M0 : 1;
2624 unsigned CCP1M1 : 1;
2625 unsigned CCP1M2 : 1;
2626 unsigned CCP1M3 : 1;
2627 unsigned DC1B0 : 1;
2628 unsigned DC1B1 : 1;
2629 unsigned P1M0 : 1;
2630 unsigned P1M1 : 1;
2633 struct
2635 unsigned CCP1M : 4;
2636 unsigned : 4;
2639 struct
2641 unsigned : 4;
2642 unsigned DC1B : 2;
2643 unsigned : 2;
2646 struct
2648 unsigned : 6;
2649 unsigned P1M : 2;
2651 } __CCP1CONbits_t;
2653 extern __at(0x0293) volatile __CCP1CONbits_t CCP1CONbits;
2655 #define _CCP1M0 0x01
2656 #define _CCP1M1 0x02
2657 #define _CCP1M2 0x04
2658 #define _CCP1M3 0x08
2659 #define _DC1B0 0x10
2660 #define _DC1B1 0x20
2661 #define _P1M0 0x40
2662 #define _P1M1 0x80
2664 //==============================================================================
2667 //==============================================================================
2668 // PWM1CON Bits
2670 extern __at(0x0294) __sfr PWM1CON;
2672 typedef union
2674 struct
2676 unsigned P1DC0 : 1;
2677 unsigned P1DC1 : 1;
2678 unsigned P1DC2 : 1;
2679 unsigned P1DC3 : 1;
2680 unsigned P1DC4 : 1;
2681 unsigned P1DC5 : 1;
2682 unsigned P1DC6 : 1;
2683 unsigned P1RSEN : 1;
2686 struct
2688 unsigned P1DC : 7;
2689 unsigned : 1;
2691 } __PWM1CONbits_t;
2693 extern __at(0x0294) volatile __PWM1CONbits_t PWM1CONbits;
2695 #define _P1DC0 0x01
2696 #define _P1DC1 0x02
2697 #define _P1DC2 0x04
2698 #define _P1DC3 0x08
2699 #define _P1DC4 0x10
2700 #define _P1DC5 0x20
2701 #define _P1DC6 0x40
2702 #define _P1RSEN 0x80
2704 //==============================================================================
2707 //==============================================================================
2708 // CCP1AS Bits
2710 extern __at(0x0295) __sfr CCP1AS;
2712 typedef union
2714 struct
2716 unsigned PSS1BD0 : 1;
2717 unsigned PSS1BD1 : 1;
2718 unsigned PSS1AC0 : 1;
2719 unsigned PSS1AC1 : 1;
2720 unsigned CCP1AS0 : 1;
2721 unsigned CCP1AS1 : 1;
2722 unsigned CCP1AS2 : 1;
2723 unsigned CCP1ASE : 1;
2726 struct
2728 unsigned PSS1BD : 2;
2729 unsigned : 6;
2732 struct
2734 unsigned : 2;
2735 unsigned PSS1AC : 2;
2736 unsigned : 4;
2739 struct
2741 unsigned : 4;
2742 unsigned CCP1AS : 3;
2743 unsigned : 1;
2745 } __CCP1ASbits_t;
2747 extern __at(0x0295) volatile __CCP1ASbits_t CCP1ASbits;
2749 #define _PSS1BD0 0x01
2750 #define _PSS1BD1 0x02
2751 #define _PSS1AC0 0x04
2752 #define _PSS1AC1 0x08
2753 #define _CCP1AS0 0x10
2754 #define _CCP1AS1 0x20
2755 #define _CCP1AS2 0x40
2756 #define _CCP1ASE 0x80
2758 //==============================================================================
2761 //==============================================================================
2762 // ECCP1AS Bits
2764 extern __at(0x0295) __sfr ECCP1AS;
2766 typedef union
2768 struct
2770 unsigned PSS1BD0 : 1;
2771 unsigned PSS1BD1 : 1;
2772 unsigned PSS1AC0 : 1;
2773 unsigned PSS1AC1 : 1;
2774 unsigned CCP1AS0 : 1;
2775 unsigned CCP1AS1 : 1;
2776 unsigned CCP1AS2 : 1;
2777 unsigned CCP1ASE : 1;
2780 struct
2782 unsigned PSS1BD : 2;
2783 unsigned : 6;
2786 struct
2788 unsigned : 2;
2789 unsigned PSS1AC : 2;
2790 unsigned : 4;
2793 struct
2795 unsigned : 4;
2796 unsigned CCP1AS : 3;
2797 unsigned : 1;
2799 } __ECCP1ASbits_t;
2801 extern __at(0x0295) volatile __ECCP1ASbits_t ECCP1ASbits;
2803 #define _ECCP1AS_PSS1BD0 0x01
2804 #define _ECCP1AS_PSS1BD1 0x02
2805 #define _ECCP1AS_PSS1AC0 0x04
2806 #define _ECCP1AS_PSS1AC1 0x08
2807 #define _ECCP1AS_CCP1AS0 0x10
2808 #define _ECCP1AS_CCP1AS1 0x20
2809 #define _ECCP1AS_CCP1AS2 0x40
2810 #define _ECCP1AS_CCP1ASE 0x80
2812 //==============================================================================
2815 //==============================================================================
2816 // PSTR1CON Bits
2818 extern __at(0x0296) __sfr PSTR1CON;
2820 typedef struct
2822 unsigned STR1A : 1;
2823 unsigned STR1B : 1;
2824 unsigned STR1C : 1;
2825 unsigned STR1D : 1;
2826 unsigned STR1SYNC : 1;
2827 unsigned : 1;
2828 unsigned : 1;
2829 unsigned : 1;
2830 } __PSTR1CONbits_t;
2832 extern __at(0x0296) volatile __PSTR1CONbits_t PSTR1CONbits;
2834 #define _STR1A 0x01
2835 #define _STR1B 0x02
2836 #define _STR1C 0x04
2837 #define _STR1D 0x08
2838 #define _STR1SYNC 0x10
2840 //==============================================================================
2842 extern __at(0x0298) __sfr CCPR2;
2843 extern __at(0x0298) __sfr CCPR2L;
2844 extern __at(0x0299) __sfr CCPR2H;
2846 //==============================================================================
2847 // CCP2CON Bits
2849 extern __at(0x029A) __sfr CCP2CON;
2851 typedef union
2853 struct
2855 unsigned CCP2M0 : 1;
2856 unsigned CCP2M1 : 1;
2857 unsigned CCP2M2 : 1;
2858 unsigned CCP2M3 : 1;
2859 unsigned DC2B0 : 1;
2860 unsigned DC2B1 : 1;
2861 unsigned P2M0 : 1;
2862 unsigned P2M1 : 1;
2865 struct
2867 unsigned CCP2M : 4;
2868 unsigned : 4;
2871 struct
2873 unsigned : 4;
2874 unsigned DC2B : 2;
2875 unsigned : 2;
2878 struct
2880 unsigned : 6;
2881 unsigned P2M : 2;
2883 } __CCP2CONbits_t;
2885 extern __at(0x029A) volatile __CCP2CONbits_t CCP2CONbits;
2887 #define _CCP2M0 0x01
2888 #define _CCP2M1 0x02
2889 #define _CCP2M2 0x04
2890 #define _CCP2M3 0x08
2891 #define _DC2B0 0x10
2892 #define _DC2B1 0x20
2893 #define _P2M0 0x40
2894 #define _P2M1 0x80
2896 //==============================================================================
2899 //==============================================================================
2900 // PWM2CON Bits
2902 extern __at(0x029B) __sfr PWM2CON;
2904 typedef union
2906 struct
2908 unsigned P2DC0 : 1;
2909 unsigned P2DC1 : 1;
2910 unsigned P2DC2 : 1;
2911 unsigned P2DC3 : 1;
2912 unsigned P2DC4 : 1;
2913 unsigned P2DC5 : 1;
2914 unsigned P2DC6 : 1;
2915 unsigned P2RSEN : 1;
2918 struct
2920 unsigned P2DC : 7;
2921 unsigned : 1;
2923 } __PWM2CONbits_t;
2925 extern __at(0x029B) volatile __PWM2CONbits_t PWM2CONbits;
2927 #define _P2DC0 0x01
2928 #define _P2DC1 0x02
2929 #define _P2DC2 0x04
2930 #define _P2DC3 0x08
2931 #define _P2DC4 0x10
2932 #define _P2DC5 0x20
2933 #define _P2DC6 0x40
2934 #define _P2RSEN 0x80
2936 //==============================================================================
2939 //==============================================================================
2940 // CCP2AS Bits
2942 extern __at(0x029C) __sfr CCP2AS;
2944 typedef union
2946 struct
2948 unsigned PSS2BD0 : 1;
2949 unsigned PSS2BD1 : 1;
2950 unsigned PSS2AC0 : 1;
2951 unsigned PSS2AC1 : 1;
2952 unsigned CCP2AS0 : 1;
2953 unsigned CCP2AS1 : 1;
2954 unsigned CCP2AS2 : 1;
2955 unsigned CCP2ASE : 1;
2958 struct
2960 unsigned PSS2BD : 2;
2961 unsigned : 6;
2964 struct
2966 unsigned : 2;
2967 unsigned PSS2AC : 2;
2968 unsigned : 4;
2971 struct
2973 unsigned : 4;
2974 unsigned CCP2AS : 3;
2975 unsigned : 1;
2977 } __CCP2ASbits_t;
2979 extern __at(0x029C) volatile __CCP2ASbits_t CCP2ASbits;
2981 #define _PSS2BD0 0x01
2982 #define _PSS2BD1 0x02
2983 #define _PSS2AC0 0x04
2984 #define _PSS2AC1 0x08
2985 #define _CCP2AS0 0x10
2986 #define _CCP2AS1 0x20
2987 #define _CCP2AS2 0x40
2988 #define _CCP2ASE 0x80
2990 //==============================================================================
2993 //==============================================================================
2994 // PSTR2CON Bits
2996 extern __at(0x029D) __sfr PSTR2CON;
2998 typedef struct
3000 unsigned STR2A : 1;
3001 unsigned STR2B : 1;
3002 unsigned STR2C : 1;
3003 unsigned STR2D : 1;
3004 unsigned STR2SYNC : 1;
3005 unsigned : 1;
3006 unsigned : 1;
3007 unsigned : 1;
3008 } __PSTR2CONbits_t;
3010 extern __at(0x029D) volatile __PSTR2CONbits_t PSTR2CONbits;
3012 #define _STR2A 0x01
3013 #define _STR2B 0x02
3014 #define _STR2C 0x04
3015 #define _STR2D 0x08
3016 #define _STR2SYNC 0x10
3018 //==============================================================================
3021 //==============================================================================
3022 // CCPTMRS Bits
3024 extern __at(0x029E) __sfr CCPTMRS;
3026 typedef union
3028 struct
3030 unsigned C1TSEL0 : 1;
3031 unsigned C1TSEL1 : 1;
3032 unsigned C2TSEL0 : 1;
3033 unsigned C2TSEL1 : 1;
3034 unsigned C3TSEL0 : 1;
3035 unsigned C3TSEL1 : 1;
3036 unsigned C4TSEL0 : 1;
3037 unsigned C4TSEL1 : 1;
3040 struct
3042 unsigned C1TSEL : 2;
3043 unsigned : 6;
3046 struct
3048 unsigned : 2;
3049 unsigned C2TSEL : 2;
3050 unsigned : 4;
3053 struct
3055 unsigned : 4;
3056 unsigned C3TSEL : 2;
3057 unsigned : 2;
3060 struct
3062 unsigned : 6;
3063 unsigned C4TSEL : 2;
3065 } __CCPTMRSbits_t;
3067 extern __at(0x029E) volatile __CCPTMRSbits_t CCPTMRSbits;
3069 #define _C1TSEL0 0x01
3070 #define _C1TSEL1 0x02
3071 #define _C2TSEL0 0x04
3072 #define _C2TSEL1 0x08
3073 #define _C3TSEL0 0x10
3074 #define _C3TSEL1 0x20
3075 #define _C4TSEL0 0x40
3076 #define _C4TSEL1 0x80
3078 //==============================================================================
3080 extern __at(0x0311) __sfr CCPR3;
3081 extern __at(0x0311) __sfr CCPR3L;
3082 extern __at(0x0312) __sfr CCPR3H;
3084 //==============================================================================
3085 // CCP3CON Bits
3087 extern __at(0x0313) __sfr CCP3CON;
3089 typedef union
3091 struct
3093 unsigned CCP3M0 : 1;
3094 unsigned CCP3M1 : 1;
3095 unsigned CCP3M2 : 1;
3096 unsigned CCP3M3 : 1;
3097 unsigned DC3B0 : 1;
3098 unsigned DC3B1 : 1;
3099 unsigned : 1;
3100 unsigned : 1;
3103 struct
3105 unsigned CCP3M : 4;
3106 unsigned : 4;
3109 struct
3111 unsigned : 4;
3112 unsigned DC3B : 2;
3113 unsigned : 2;
3115 } __CCP3CONbits_t;
3117 extern __at(0x0313) volatile __CCP3CONbits_t CCP3CONbits;
3119 #define _CCP3M0 0x01
3120 #define _CCP3M1 0x02
3121 #define _CCP3M2 0x04
3122 #define _CCP3M3 0x08
3123 #define _DC3B0 0x10
3124 #define _DC3B1 0x20
3126 //==============================================================================
3128 extern __at(0x0318) __sfr CCPR4;
3129 extern __at(0x0318) __sfr CCPR4L;
3130 extern __at(0x0319) __sfr CCPR4H;
3132 //==============================================================================
3133 // CCP4CON Bits
3135 extern __at(0x031A) __sfr CCP4CON;
3137 typedef union
3139 struct
3141 unsigned CCP4M0 : 1;
3142 unsigned CCP4M1 : 1;
3143 unsigned CCP4M2 : 1;
3144 unsigned CCP4M3 : 1;
3145 unsigned DC4B0 : 1;
3146 unsigned DC4B1 : 1;
3147 unsigned : 1;
3148 unsigned : 1;
3151 struct
3153 unsigned CCP4M : 4;
3154 unsigned : 4;
3157 struct
3159 unsigned : 4;
3160 unsigned DC4B : 2;
3161 unsigned : 2;
3163 } __CCP4CONbits_t;
3165 extern __at(0x031A) volatile __CCP4CONbits_t CCP4CONbits;
3167 #define _CCP4M0 0x01
3168 #define _CCP4M1 0x02
3169 #define _CCP4M2 0x04
3170 #define _CCP4M3 0x08
3171 #define _DC4B0 0x10
3172 #define _DC4B1 0x20
3174 //==============================================================================
3177 //==============================================================================
3178 // INLVLA Bits
3180 extern __at(0x038C) __sfr INLVLA;
3182 typedef union
3184 struct
3186 unsigned INLVLA0 : 1;
3187 unsigned INLVLA1 : 1;
3188 unsigned INLVLA2 : 1;
3189 unsigned INLVLA3 : 1;
3190 unsigned INLVLA4 : 1;
3191 unsigned INLVLA5 : 1;
3192 unsigned : 1;
3193 unsigned : 1;
3196 struct
3198 unsigned INLVLA : 6;
3199 unsigned : 2;
3201 } __INLVLAbits_t;
3203 extern __at(0x038C) volatile __INLVLAbits_t INLVLAbits;
3205 #define _INLVLA0 0x01
3206 #define _INLVLA1 0x02
3207 #define _INLVLA2 0x04
3208 #define _INLVLA3 0x08
3209 #define _INLVLA4 0x10
3210 #define _INLVLA5 0x20
3212 //==============================================================================
3215 //==============================================================================
3216 // INLVLB Bits
3218 extern __at(0x038D) __sfr INLVLB;
3220 typedef struct
3222 unsigned : 1;
3223 unsigned : 1;
3224 unsigned : 1;
3225 unsigned : 1;
3226 unsigned INLVLB4 : 1;
3227 unsigned INLVLB5 : 1;
3228 unsigned INLVLB6 : 1;
3229 unsigned INLVLB7 : 1;
3230 } __INLVLBbits_t;
3232 extern __at(0x038D) volatile __INLVLBbits_t INLVLBbits;
3234 #define _INLVLB4 0x10
3235 #define _INLVLB5 0x20
3236 #define _INLVLB6 0x40
3237 #define _INLVLB7 0x80
3239 //==============================================================================
3242 //==============================================================================
3243 // INLVLC Bits
3245 extern __at(0x038E) __sfr INLVLC;
3247 typedef struct
3249 unsigned INLVLC0 : 1;
3250 unsigned INLVLC1 : 1;
3251 unsigned INLVLC2 : 1;
3252 unsigned INLVLC3 : 1;
3253 unsigned INLVLC4 : 1;
3254 unsigned INLVLC5 : 1;
3255 unsigned INLVLC6 : 1;
3256 unsigned INLVLC7 : 1;
3257 } __INLVLCbits_t;
3259 extern __at(0x038E) volatile __INLVLCbits_t INLVLCbits;
3261 #define _INLVLC0 0x01
3262 #define _INLVLC1 0x02
3263 #define _INLVLC2 0x04
3264 #define _INLVLC3 0x08
3265 #define _INLVLC4 0x10
3266 #define _INLVLC5 0x20
3267 #define _INLVLC6 0x40
3268 #define _INLVLC7 0x80
3270 //==============================================================================
3273 //==============================================================================
3274 // IOCAP Bits
3276 extern __at(0x0391) __sfr IOCAP;
3278 typedef union
3280 struct
3282 unsigned IOCAP0 : 1;
3283 unsigned IOCAP1 : 1;
3284 unsigned IOCAP2 : 1;
3285 unsigned IOCAP3 : 1;
3286 unsigned IOCAP4 : 1;
3287 unsigned IOCAP5 : 1;
3288 unsigned : 1;
3289 unsigned : 1;
3292 struct
3294 unsigned IOCAP : 6;
3295 unsigned : 2;
3297 } __IOCAPbits_t;
3299 extern __at(0x0391) volatile __IOCAPbits_t IOCAPbits;
3301 #define _IOCAP0 0x01
3302 #define _IOCAP1 0x02
3303 #define _IOCAP2 0x04
3304 #define _IOCAP3 0x08
3305 #define _IOCAP4 0x10
3306 #define _IOCAP5 0x20
3308 //==============================================================================
3311 //==============================================================================
3312 // IOCAN Bits
3314 extern __at(0x0392) __sfr IOCAN;
3316 typedef union
3318 struct
3320 unsigned IOCAN0 : 1;
3321 unsigned IOCAN1 : 1;
3322 unsigned IOCAN2 : 1;
3323 unsigned IOCAN3 : 1;
3324 unsigned IOCAN4 : 1;
3325 unsigned IOCAN5 : 1;
3326 unsigned : 1;
3327 unsigned : 1;
3330 struct
3332 unsigned IOCAN : 6;
3333 unsigned : 2;
3335 } __IOCANbits_t;
3337 extern __at(0x0392) volatile __IOCANbits_t IOCANbits;
3339 #define _IOCAN0 0x01
3340 #define _IOCAN1 0x02
3341 #define _IOCAN2 0x04
3342 #define _IOCAN3 0x08
3343 #define _IOCAN4 0x10
3344 #define _IOCAN5 0x20
3346 //==============================================================================
3349 //==============================================================================
3350 // IOCAF Bits
3352 extern __at(0x0393) __sfr IOCAF;
3354 typedef union
3356 struct
3358 unsigned IOCAF0 : 1;
3359 unsigned IOCAF1 : 1;
3360 unsigned IOCAF2 : 1;
3361 unsigned IOCAF3 : 1;
3362 unsigned IOCAF4 : 1;
3363 unsigned IOCAF5 : 1;
3364 unsigned : 1;
3365 unsigned : 1;
3368 struct
3370 unsigned IOCAF : 6;
3371 unsigned : 2;
3373 } __IOCAFbits_t;
3375 extern __at(0x0393) volatile __IOCAFbits_t IOCAFbits;
3377 #define _IOCAF0 0x01
3378 #define _IOCAF1 0x02
3379 #define _IOCAF2 0x04
3380 #define _IOCAF3 0x08
3381 #define _IOCAF4 0x10
3382 #define _IOCAF5 0x20
3384 //==============================================================================
3387 //==============================================================================
3388 // IOCBP Bits
3390 extern __at(0x0394) __sfr IOCBP;
3392 typedef struct
3394 unsigned : 1;
3395 unsigned : 1;
3396 unsigned : 1;
3397 unsigned : 1;
3398 unsigned IOCBP4 : 1;
3399 unsigned IOCBP5 : 1;
3400 unsigned IOCBP6 : 1;
3401 unsigned IOCBP7 : 1;
3402 } __IOCBPbits_t;
3404 extern __at(0x0394) volatile __IOCBPbits_t IOCBPbits;
3406 #define _IOCBP4 0x10
3407 #define _IOCBP5 0x20
3408 #define _IOCBP6 0x40
3409 #define _IOCBP7 0x80
3411 //==============================================================================
3414 //==============================================================================
3415 // IOCBN Bits
3417 extern __at(0x0395) __sfr IOCBN;
3419 typedef struct
3421 unsigned : 1;
3422 unsigned : 1;
3423 unsigned : 1;
3424 unsigned : 1;
3425 unsigned IOCBN4 : 1;
3426 unsigned IOCBN5 : 1;
3427 unsigned IOCBN6 : 1;
3428 unsigned IOCBN7 : 1;
3429 } __IOCBNbits_t;
3431 extern __at(0x0395) volatile __IOCBNbits_t IOCBNbits;
3433 #define _IOCBN4 0x10
3434 #define _IOCBN5 0x20
3435 #define _IOCBN6 0x40
3436 #define _IOCBN7 0x80
3438 //==============================================================================
3441 //==============================================================================
3442 // IOCBF Bits
3444 extern __at(0x0396) __sfr IOCBF;
3446 typedef struct
3448 unsigned : 1;
3449 unsigned : 1;
3450 unsigned : 1;
3451 unsigned : 1;
3452 unsigned IOCBF4 : 1;
3453 unsigned IOCBF5 : 1;
3454 unsigned IOCBF6 : 1;
3455 unsigned IOCBF7 : 1;
3456 } __IOCBFbits_t;
3458 extern __at(0x0396) volatile __IOCBFbits_t IOCBFbits;
3460 #define _IOCBF4 0x10
3461 #define _IOCBF5 0x20
3462 #define _IOCBF6 0x40
3463 #define _IOCBF7 0x80
3465 //==============================================================================
3468 //==============================================================================
3469 // CLKRCON Bits
3471 extern __at(0x039A) __sfr CLKRCON;
3473 typedef union
3475 struct
3477 unsigned CLKRDIV0 : 1;
3478 unsigned CLKRDIV1 : 1;
3479 unsigned CLKRDIV2 : 1;
3480 unsigned CLKRDC0 : 1;
3481 unsigned CLKRDC1 : 1;
3482 unsigned CLKRSLR : 1;
3483 unsigned CLKROE : 1;
3484 unsigned CLKREN : 1;
3487 struct
3489 unsigned CLKRDIV : 3;
3490 unsigned : 5;
3493 struct
3495 unsigned : 3;
3496 unsigned CLKRDC : 2;
3497 unsigned : 3;
3499 } __CLKRCONbits_t;
3501 extern __at(0x039A) volatile __CLKRCONbits_t CLKRCONbits;
3503 #define _CLKRDIV0 0x01
3504 #define _CLKRDIV1 0x02
3505 #define _CLKRDIV2 0x04
3506 #define _CLKRDC0 0x08
3507 #define _CLKRDC1 0x10
3508 #define _CLKRSLR 0x20
3509 #define _CLKROE 0x40
3510 #define _CLKREN 0x80
3512 //==============================================================================
3515 //==============================================================================
3516 // MDCON Bits
3518 extern __at(0x039C) __sfr MDCON;
3520 typedef struct
3522 unsigned MDBIT : 1;
3523 unsigned : 1;
3524 unsigned : 1;
3525 unsigned MDOUT : 1;
3526 unsigned MDOPOL : 1;
3527 unsigned MDSLR : 1;
3528 unsigned MDOE : 1;
3529 unsigned MDEN : 1;
3530 } __MDCONbits_t;
3532 extern __at(0x039C) volatile __MDCONbits_t MDCONbits;
3534 #define _MDBIT 0x01
3535 #define _MDOUT 0x08
3536 #define _MDOPOL 0x10
3537 #define _MDSLR 0x20
3538 #define _MDOE 0x40
3539 #define _MDEN 0x80
3541 //==============================================================================
3544 //==============================================================================
3545 // MDSRC Bits
3547 extern __at(0x039D) __sfr MDSRC;
3549 typedef union
3551 struct
3553 unsigned MDMS0 : 1;
3554 unsigned MDMS1 : 1;
3555 unsigned MDMS2 : 1;
3556 unsigned MDMS3 : 1;
3557 unsigned : 1;
3558 unsigned : 1;
3559 unsigned : 1;
3560 unsigned MDMSODIS : 1;
3563 struct
3565 unsigned MDMS : 4;
3566 unsigned : 4;
3568 } __MDSRCbits_t;
3570 extern __at(0x039D) volatile __MDSRCbits_t MDSRCbits;
3572 #define _MDMS0 0x01
3573 #define _MDMS1 0x02
3574 #define _MDMS2 0x04
3575 #define _MDMS3 0x08
3576 #define _MDMSODIS 0x80
3578 //==============================================================================
3581 //==============================================================================
3582 // MDCARL Bits
3584 extern __at(0x039E) __sfr MDCARL;
3586 typedef union
3588 struct
3590 unsigned MDCL0 : 1;
3591 unsigned MDCL1 : 1;
3592 unsigned MDCL2 : 1;
3593 unsigned MDCL3 : 1;
3594 unsigned : 1;
3595 unsigned MDCLSYNC : 1;
3596 unsigned MDCLPOL : 1;
3597 unsigned MDCLODIS : 1;
3600 struct
3602 unsigned MDCL : 4;
3603 unsigned : 4;
3605 } __MDCARLbits_t;
3607 extern __at(0x039E) volatile __MDCARLbits_t MDCARLbits;
3609 #define _MDCL0 0x01
3610 #define _MDCL1 0x02
3611 #define _MDCL2 0x04
3612 #define _MDCL3 0x08
3613 #define _MDCLSYNC 0x20
3614 #define _MDCLPOL 0x40
3615 #define _MDCLODIS 0x80
3617 //==============================================================================
3620 //==============================================================================
3621 // MDCARH Bits
3623 extern __at(0x039F) __sfr MDCARH;
3625 typedef union
3627 struct
3629 unsigned MDCH0 : 1;
3630 unsigned MDCH1 : 1;
3631 unsigned MDCH2 : 1;
3632 unsigned MDCH3 : 1;
3633 unsigned : 1;
3634 unsigned MDCHSYNC : 1;
3635 unsigned MDCHPOL : 1;
3636 unsigned MDCHODIS : 1;
3639 struct
3641 unsigned MDCH : 4;
3642 unsigned : 4;
3644 } __MDCARHbits_t;
3646 extern __at(0x039F) volatile __MDCARHbits_t MDCARHbits;
3648 #define _MDCH0 0x01
3649 #define _MDCH1 0x02
3650 #define _MDCH2 0x04
3651 #define _MDCH3 0x08
3652 #define _MDCHSYNC 0x20
3653 #define _MDCHPOL 0x40
3654 #define _MDCHODIS 0x80
3656 //==============================================================================
3658 extern __at(0x0415) __sfr TMR4;
3659 extern __at(0x0416) __sfr PR4;
3661 //==============================================================================
3662 // T4CON Bits
3664 extern __at(0x0417) __sfr T4CON;
3666 typedef union
3668 struct
3670 unsigned T4CKPS0 : 1;
3671 unsigned T4CKPS1 : 1;
3672 unsigned TMR4ON : 1;
3673 unsigned T4OUTPS0 : 1;
3674 unsigned T4OUTPS1 : 1;
3675 unsigned T4OUTPS2 : 1;
3676 unsigned T4OUTPS3 : 1;
3677 unsigned : 1;
3680 struct
3682 unsigned T4CKPS : 2;
3683 unsigned : 6;
3686 struct
3688 unsigned : 3;
3689 unsigned T4OUTPS : 4;
3690 unsigned : 1;
3692 } __T4CONbits_t;
3694 extern __at(0x0417) volatile __T4CONbits_t T4CONbits;
3696 #define _T4CKPS0 0x01
3697 #define _T4CKPS1 0x02
3698 #define _TMR4ON 0x04
3699 #define _T4OUTPS0 0x08
3700 #define _T4OUTPS1 0x10
3701 #define _T4OUTPS2 0x20
3702 #define _T4OUTPS3 0x40
3704 //==============================================================================
3706 extern __at(0x041C) __sfr TMR6;
3707 extern __at(0x041D) __sfr PR6;
3709 //==============================================================================
3710 // T6CON Bits
3712 extern __at(0x041E) __sfr T6CON;
3714 typedef union
3716 struct
3718 unsigned T6CKPS0 : 1;
3719 unsigned T6CKPS1 : 1;
3720 unsigned TMR6ON : 1;
3721 unsigned T6OUTPS0 : 1;
3722 unsigned T6OUTPS1 : 1;
3723 unsigned T6OUTPS2 : 1;
3724 unsigned T6OUTPS3 : 1;
3725 unsigned : 1;
3728 struct
3730 unsigned T6CKPS : 2;
3731 unsigned : 6;
3734 struct
3736 unsigned : 3;
3737 unsigned T6OUTPS : 4;
3738 unsigned : 1;
3740 } __T6CONbits_t;
3742 extern __at(0x041E) volatile __T6CONbits_t T6CONbits;
3744 #define _T6CKPS0 0x01
3745 #define _T6CKPS1 0x02
3746 #define _TMR6ON 0x04
3747 #define _T6OUTPS0 0x08
3748 #define _T6OUTPS1 0x10
3749 #define _T6OUTPS2 0x20
3750 #define _T6OUTPS3 0x40
3752 //==============================================================================
3755 //==============================================================================
3756 // STATUS_SHAD Bits
3758 extern __at(0x0FE4) __sfr STATUS_SHAD;
3760 typedef struct
3762 unsigned C_SHAD : 1;
3763 unsigned DC_SHAD : 1;
3764 unsigned Z_SHAD : 1;
3765 unsigned : 1;
3766 unsigned : 1;
3767 unsigned : 1;
3768 unsigned : 1;
3769 unsigned : 1;
3770 } __STATUS_SHADbits_t;
3772 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits;
3774 #define _C_SHAD 0x01
3775 #define _DC_SHAD 0x02
3776 #define _Z_SHAD 0x04
3778 //==============================================================================
3780 extern __at(0x0FE5) __sfr WREG_SHAD;
3781 extern __at(0x0FE6) __sfr BSR_SHAD;
3782 extern __at(0x0FE7) __sfr PCLATH_SHAD;
3783 extern __at(0x0FE8) __sfr FSR0L_SHAD;
3784 extern __at(0x0FE9) __sfr FSR0H_SHAD;
3785 extern __at(0x0FEA) __sfr FSR1L_SHAD;
3786 extern __at(0x0FEB) __sfr FSR1H_SHAD;
3787 extern __at(0x0FED) __sfr STKPTR;
3788 extern __at(0x0FEE) __sfr TOSL;
3789 extern __at(0x0FEF) __sfr TOSH;
3791 //==============================================================================
3793 // Configuration Bits
3795 //==============================================================================
3797 #define _CONFIG1 0x8007
3798 #define _CONFIG2 0x8008
3800 //----------------------------- CONFIG1 Options -------------------------------
3802 #define _FOSC_LP 0x3FF8 // LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins.
3803 #define _FOSC_XT 0x3FF9 // XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins.
3804 #define _FOSC_HS 0x3FFA // HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins.
3805 #define _FOSC_EXTRC 0x3FFB // EXTRC oscillator: External RC circuit connected to CLKIN pin.
3806 #define _FOSC_INTOSC 0x3FFC // INTOSC oscillator: I/O function on CLKIN pin.
3807 #define _FOSC_ECL 0x3FFD // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pin.
3808 #define _FOSC_ECM 0x3FFE // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pin.
3809 #define _FOSC_ECH 0x3FFF // ECH, External Clock, High Power Mode (4-32 MHz): device clock supplied to CLKIN pin.
3810 #define _WDTE_OFF 0x3FE7 // WDT disabled.
3811 #define _WDTE_SWDTEN 0x3FEF // WDT controlled by the SWDTEN bit in the WDTCON register.
3812 #define _WDTE_NSLEEP 0x3FF7 // WDT enabled while running and disabled in Sleep.
3813 #define _WDTE_ON 0x3FFF // WDT enabled.
3814 #define _PWRTE_ON 0x3FDF // PWRT enabled.
3815 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
3816 #define _MCLRE_OFF 0x3FBF // MCLR/VPP pin function is digital input.
3817 #define _MCLRE_ON 0x3FFF // MCLR/VPP pin function is MCLR.
3818 #define _CP_ON 0x3F7F // Program memory code protection is enabled.
3819 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
3820 #define _CPD_ON 0x3EFF // Data memory code protection is enabled.
3821 #define _CPD_OFF 0x3FFF // Data memory code protection is disabled.
3822 #define _BOREN_OFF 0x39FF // Brown-out Reset disabled.
3823 #define _BOREN_SBODEN 0x3BFF // Brown-out Reset controlled by the SBOREN bit in the BORCON register.
3824 #define _BOREN_NSLEEP 0x3DFF // Brown-out Reset enabled while running and disabled in Sleep.
3825 #define _BOREN_ON 0x3FFF // Brown-out Reset enabled.
3826 #define _CLKOUTEN_ON 0x37FF // CLKOUT function is enabled on the CLKOUT pin.
3827 #define _CLKOUTEN_OFF 0x3FFF // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin.
3828 #define _IESO_OFF 0x2FFF // Internal/External Switchover mode is disabled.
3829 #define _IESO_ON 0x3FFF // Internal/External Switchover mode is enabled.
3830 #define _FCMEN_OFF 0x1FFF // Fail-Safe Clock Monitor is disabled.
3831 #define _FCMEN_ON 0x3FFF // Fail-Safe Clock Monitor is enabled.
3833 //----------------------------- CONFIG2 Options -------------------------------
3835 #define _WRT_ALL 0x3FFC // 000h to 1FFFh write protected, no addresses may be modified by EECON control.
3836 #define _WRT_HALF 0x3FFD // 000h to FFFh write protected, 1000h to 1FFFh may be modified by EECON control.
3837 #define _WRT_BOOT 0x3FFE // 000h to 1FFh write protected, 200h to 1FFFh may be modified by EECON control.
3838 #define _WRT_OFF 0x3FFF // Write protection off.
3839 #define _PLLEN_OFF 0x3EFF // 4x PLL disabled.
3840 #define _PLLEN_ON 0x3FFF // 4x PLL enabled.
3841 #define _STVREN_OFF 0x3DFF // Stack Overflow or Underflow will not cause a Reset.
3842 #define _STVREN_ON 0x3FFF // Stack Overflow or Underflow will cause a Reset.
3843 #define _BORV_HI 0x3BFF // Brown-out Reset Voltage (Vbor), high trip point selected.
3844 #define _BORV_LO 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
3845 #define _BORV_19 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
3846 #define _DEBUG_ON 0x2FFF // In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger.
3847 #define _DEBUG_OFF 0x3FFF // In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins.
3848 #define _LVP_OFF 0x1FFF // High-voltage on MCLR/VPP must be used for programming.
3849 #define _LVP_ON 0x3FFF // Low-voltage programming enabled.
3851 //==============================================================================
3853 #define _DEVID1 0x8006
3855 #define _IDLOC0 0x8000
3856 #define _IDLOC1 0x8001
3857 #define _IDLOC2 0x8002
3858 #define _IDLOC3 0x8003
3860 //==============================================================================
3862 #ifndef NO_BIT_DEFINES
3864 #define ADON ADCON0bits.ADON // bit 0
3865 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1, shadows bit in ADCON0bits
3866 #define ADGO ADCON0bits.ADGO // bit 1, shadows bit in ADCON0bits
3867 #define GO ADCON0bits.GO // bit 1, shadows bit in ADCON0bits
3868 #define CHS0 ADCON0bits.CHS0 // bit 2
3869 #define CHS1 ADCON0bits.CHS1 // bit 3
3870 #define CHS2 ADCON0bits.CHS2 // bit 4
3871 #define CHS3 ADCON0bits.CHS3 // bit 5
3872 #define CHS4 ADCON0bits.CHS4 // bit 6
3874 #define ADPREF0 ADCON1bits.ADPREF0 // bit 0
3875 #define ADPREF1 ADCON1bits.ADPREF1 // bit 1
3876 #define ADNREF ADCON1bits.ADNREF // bit 2
3877 #define ADCS0 ADCON1bits.ADCS0 // bit 4
3878 #define ADCS1 ADCON1bits.ADCS1 // bit 5
3879 #define ADCS2 ADCON1bits.ADCS2 // bit 6
3880 #define ADFM ADCON1bits.ADFM // bit 7
3882 #define ANSA0 ANSELAbits.ANSA0 // bit 0
3883 #define ANSA1 ANSELAbits.ANSA1 // bit 1
3884 #define ANSA2 ANSELAbits.ANSA2 // bit 2
3885 #define ANSA4 ANSELAbits.ANSA4 // bit 4
3887 #define ANSB4 ANSELBbits.ANSB4 // bit 4
3888 #define ANSB5 ANSELBbits.ANSB5 // bit 5
3890 #define ANSC0 ANSELCbits.ANSC0 // bit 0
3891 #define ANSC1 ANSELCbits.ANSC1 // bit 1
3892 #define ANSC2 ANSELCbits.ANSC2 // bit 2
3893 #define ANSC3 ANSELCbits.ANSC3 // bit 3
3894 #define ANSC6 ANSELCbits.ANSC6 // bit 6
3895 #define ANSC7 ANSELCbits.ANSC7 // bit 7
3897 #define TXCKSEL APFCON0bits.TXCKSEL // bit 2
3898 #define T1GSEL APFCON0bits.T1GSEL // bit 3
3899 #define RXDTSEL APFCON0bits.RXDTSEL // bit 7
3901 #define CCP2SEL APFCON1bits.CCP2SEL // bit 0
3902 #define P2BSEL APFCON1bits.P2BSEL // bit 1
3903 #define P1CSEL APFCON1bits.P1CSEL // bit 2
3904 #define P1DSEL APFCON1bits.P1DSEL // bit 3
3905 #define SS2SEL APFCON1bits.SS2SEL // bit 4
3906 #define SDO2SEL APFCON1bits.SDO2SEL // bit 5
3908 #define ABDEN BAUDCONbits.ABDEN // bit 0
3909 #define WUE BAUDCONbits.WUE // bit 1
3910 #define BRG16 BAUDCONbits.BRG16 // bit 3
3911 #define SCKP BAUDCONbits.SCKP // bit 4
3912 #define RCIDL BAUDCONbits.RCIDL // bit 6
3913 #define ABDOVF BAUDCONbits.ABDOVF // bit 7
3915 #define BORRDY BORCONbits.BORRDY // bit 0
3916 #define SBOREN BORCONbits.SBOREN // bit 7
3918 #define BSR0 BSRbits.BSR0 // bit 0
3919 #define BSR1 BSRbits.BSR1 // bit 1
3920 #define BSR2 BSRbits.BSR2 // bit 2
3921 #define BSR3 BSRbits.BSR3 // bit 3
3922 #define BSR4 BSRbits.BSR4 // bit 4
3924 #define PSS1BD0 CCP1ASbits.PSS1BD0 // bit 0
3925 #define PSS1BD1 CCP1ASbits.PSS1BD1 // bit 1
3926 #define PSS1AC0 CCP1ASbits.PSS1AC0 // bit 2
3927 #define PSS1AC1 CCP1ASbits.PSS1AC1 // bit 3
3928 #define CCP1AS0 CCP1ASbits.CCP1AS0 // bit 4
3929 #define CCP1AS1 CCP1ASbits.CCP1AS1 // bit 5
3930 #define CCP1AS2 CCP1ASbits.CCP1AS2 // bit 6
3931 #define CCP1ASE CCP1ASbits.CCP1ASE // bit 7
3933 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
3934 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
3935 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
3936 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
3937 #define DC1B0 CCP1CONbits.DC1B0 // bit 4
3938 #define DC1B1 CCP1CONbits.DC1B1 // bit 5
3939 #define P1M0 CCP1CONbits.P1M0 // bit 6
3940 #define P1M1 CCP1CONbits.P1M1 // bit 7
3942 #define PSS2BD0 CCP2ASbits.PSS2BD0 // bit 0
3943 #define PSS2BD1 CCP2ASbits.PSS2BD1 // bit 1
3944 #define PSS2AC0 CCP2ASbits.PSS2AC0 // bit 2
3945 #define PSS2AC1 CCP2ASbits.PSS2AC1 // bit 3
3946 #define CCP2AS0 CCP2ASbits.CCP2AS0 // bit 4
3947 #define CCP2AS1 CCP2ASbits.CCP2AS1 // bit 5
3948 #define CCP2AS2 CCP2ASbits.CCP2AS2 // bit 6
3949 #define CCP2ASE CCP2ASbits.CCP2ASE // bit 7
3951 #define CCP2M0 CCP2CONbits.CCP2M0 // bit 0
3952 #define CCP2M1 CCP2CONbits.CCP2M1 // bit 1
3953 #define CCP2M2 CCP2CONbits.CCP2M2 // bit 2
3954 #define CCP2M3 CCP2CONbits.CCP2M3 // bit 3
3955 #define DC2B0 CCP2CONbits.DC2B0 // bit 4
3956 #define DC2B1 CCP2CONbits.DC2B1 // bit 5
3957 #define P2M0 CCP2CONbits.P2M0 // bit 6
3958 #define P2M1 CCP2CONbits.P2M1 // bit 7
3960 #define CCP3M0 CCP3CONbits.CCP3M0 // bit 0
3961 #define CCP3M1 CCP3CONbits.CCP3M1 // bit 1
3962 #define CCP3M2 CCP3CONbits.CCP3M2 // bit 2
3963 #define CCP3M3 CCP3CONbits.CCP3M3 // bit 3
3964 #define DC3B0 CCP3CONbits.DC3B0 // bit 4
3965 #define DC3B1 CCP3CONbits.DC3B1 // bit 5
3967 #define CCP4M0 CCP4CONbits.CCP4M0 // bit 0
3968 #define CCP4M1 CCP4CONbits.CCP4M1 // bit 1
3969 #define CCP4M2 CCP4CONbits.CCP4M2 // bit 2
3970 #define CCP4M3 CCP4CONbits.CCP4M3 // bit 3
3971 #define DC4B0 CCP4CONbits.DC4B0 // bit 4
3972 #define DC4B1 CCP4CONbits.DC4B1 // bit 5
3974 #define C1TSEL0 CCPTMRSbits.C1TSEL0 // bit 0
3975 #define C1TSEL1 CCPTMRSbits.C1TSEL1 // bit 1
3976 #define C2TSEL0 CCPTMRSbits.C2TSEL0 // bit 2
3977 #define C2TSEL1 CCPTMRSbits.C2TSEL1 // bit 3
3978 #define C3TSEL0 CCPTMRSbits.C3TSEL0 // bit 4
3979 #define C3TSEL1 CCPTMRSbits.C3TSEL1 // bit 5
3980 #define C4TSEL0 CCPTMRSbits.C4TSEL0 // bit 6
3981 #define C4TSEL1 CCPTMRSbits.C4TSEL1 // bit 7
3983 #define CLKRDIV0 CLKRCONbits.CLKRDIV0 // bit 0
3984 #define CLKRDIV1 CLKRCONbits.CLKRDIV1 // bit 1
3985 #define CLKRDIV2 CLKRCONbits.CLKRDIV2 // bit 2
3986 #define CLKRDC0 CLKRCONbits.CLKRDC0 // bit 3
3987 #define CLKRDC1 CLKRCONbits.CLKRDC1 // bit 4
3988 #define CLKRSLR CLKRCONbits.CLKRSLR // bit 5
3989 #define CLKROE CLKRCONbits.CLKROE // bit 6
3990 #define CLKREN CLKRCONbits.CLKREN // bit 7
3992 #define C1SYNC CM1CON0bits.C1SYNC // bit 0
3993 #define C1HYS CM1CON0bits.C1HYS // bit 1
3994 #define C1SP CM1CON0bits.C1SP // bit 2
3995 #define C1POL CM1CON0bits.C1POL // bit 4
3996 #define C1OE CM1CON0bits.C1OE // bit 5
3997 #define C1OUT CM1CON0bits.C1OUT // bit 6
3998 #define C1ON CM1CON0bits.C1ON // bit 7
4000 #define C1NCH0 CM1CON1bits.C1NCH0 // bit 0
4001 #define C1NCH1 CM1CON1bits.C1NCH1 // bit 1
4002 #define C1PCH0 CM1CON1bits.C1PCH0 // bit 4
4003 #define C1PCH1 CM1CON1bits.C1PCH1 // bit 5
4004 #define C1INTN CM1CON1bits.C1INTN // bit 6
4005 #define C1INTP CM1CON1bits.C1INTP // bit 7
4007 #define C2SYNC CM2CON0bits.C2SYNC // bit 0
4008 #define C2HYS CM2CON0bits.C2HYS // bit 1
4009 #define C2SP CM2CON0bits.C2SP // bit 2
4010 #define C2POL CM2CON0bits.C2POL // bit 4
4011 #define C2OE CM2CON0bits.C2OE // bit 5
4012 #define C2OUT CM2CON0bits.C2OUT // bit 6
4013 #define C2ON CM2CON0bits.C2ON // bit 7
4015 #define C2NCH0 CM2CON1bits.C2NCH0 // bit 0
4016 #define C2NCH1 CM2CON1bits.C2NCH1 // bit 1
4017 #define C2PCH0 CM2CON1bits.C2PCH0 // bit 4
4018 #define C2PCH1 CM2CON1bits.C2PCH1 // bit 5
4019 #define C2INTN CM2CON1bits.C2INTN // bit 6
4020 #define C2INTP CM2CON1bits.C2INTP // bit 7
4022 #define MC1OUT CMOUTbits.MC1OUT // bit 0
4023 #define MC2OUT CMOUTbits.MC2OUT // bit 1
4025 #define T0XCS CPSCON0bits.T0XCS // bit 0
4026 #define CPSOUT CPSCON0bits.CPSOUT // bit 1
4027 #define CPSRNG0 CPSCON0bits.CPSRNG0 // bit 2
4028 #define CPSRNG1 CPSCON0bits.CPSRNG1 // bit 3
4029 #define CPSRM CPSCON0bits.CPSRM // bit 6
4030 #define CPSON CPSCON0bits.CPSON // bit 7
4032 #define CPSCH0 CPSCON1bits.CPSCH0 // bit 0
4033 #define CPSCH1 CPSCON1bits.CPSCH1 // bit 1
4034 #define CPSCH2 CPSCON1bits.CPSCH2 // bit 2
4035 #define CPSCH3 CPSCON1bits.CPSCH3 // bit 3
4037 #define DACNSS DACCON0bits.DACNSS // bit 0
4038 #define DACPSS0 DACCON0bits.DACPSS0 // bit 2
4039 #define DACPSS1 DACCON0bits.DACPSS1 // bit 3
4040 #define DACOE DACCON0bits.DACOE // bit 5
4041 #define DACLPS DACCON0bits.DACLPS // bit 6
4042 #define DACEN DACCON0bits.DACEN // bit 7
4044 #define DACR0 DACCON1bits.DACR0 // bit 0
4045 #define DACR1 DACCON1bits.DACR1 // bit 1
4046 #define DACR2 DACCON1bits.DACR2 // bit 2
4047 #define DACR3 DACCON1bits.DACR3 // bit 3
4048 #define DACR4 DACCON1bits.DACR4 // bit 4
4050 #define RD EECON1bits.RD // bit 0
4051 #define WR EECON1bits.WR // bit 1
4052 #define WREN EECON1bits.WREN // bit 2
4053 #define WRERR EECON1bits.WRERR // bit 3
4054 #define FREE EECON1bits.FREE // bit 4
4055 #define LWLO EECON1bits.LWLO // bit 5
4056 #define CFGS EECON1bits.CFGS // bit 6
4057 #define EEPGD EECON1bits.EEPGD // bit 7
4059 #define ADFVR0 FVRCONbits.ADFVR0 // bit 0
4060 #define ADFVR1 FVRCONbits.ADFVR1 // bit 1
4061 #define CDAFVR0 FVRCONbits.CDAFVR0 // bit 2
4062 #define CDAFVR1 FVRCONbits.CDAFVR1 // bit 3
4063 #define TSRNG FVRCONbits.TSRNG // bit 4
4064 #define TSEN FVRCONbits.TSEN // bit 5
4065 #define FVRRDY FVRCONbits.FVRRDY // bit 6
4066 #define FVREN FVRCONbits.FVREN // bit 7
4068 #define INLVLA0 INLVLAbits.INLVLA0 // bit 0
4069 #define INLVLA1 INLVLAbits.INLVLA1 // bit 1
4070 #define INLVLA2 INLVLAbits.INLVLA2 // bit 2
4071 #define INLVLA3 INLVLAbits.INLVLA3 // bit 3
4072 #define INLVLA4 INLVLAbits.INLVLA4 // bit 4
4073 #define INLVLA5 INLVLAbits.INLVLA5 // bit 5
4075 #define INLVLB4 INLVLBbits.INLVLB4 // bit 4
4076 #define INLVLB5 INLVLBbits.INLVLB5 // bit 5
4077 #define INLVLB6 INLVLBbits.INLVLB6 // bit 6
4078 #define INLVLB7 INLVLBbits.INLVLB7 // bit 7
4080 #define INLVLC0 INLVLCbits.INLVLC0 // bit 0
4081 #define INLVLC1 INLVLCbits.INLVLC1 // bit 1
4082 #define INLVLC2 INLVLCbits.INLVLC2 // bit 2
4083 #define INLVLC3 INLVLCbits.INLVLC3 // bit 3
4084 #define INLVLC4 INLVLCbits.INLVLC4 // bit 4
4085 #define INLVLC5 INLVLCbits.INLVLC5 // bit 5
4086 #define INLVLC6 INLVLCbits.INLVLC6 // bit 6
4087 #define INLVLC7 INLVLCbits.INLVLC7 // bit 7
4089 #define IOCIF INTCONbits.IOCIF // bit 0
4090 #define INTF INTCONbits.INTF // bit 1
4091 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
4092 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
4093 #define IOCIE INTCONbits.IOCIE // bit 3
4094 #define INTE INTCONbits.INTE // bit 4
4095 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
4096 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
4097 #define PEIE INTCONbits.PEIE // bit 6
4098 #define GIE INTCONbits.GIE // bit 7
4100 #define IOCAF0 IOCAFbits.IOCAF0 // bit 0
4101 #define IOCAF1 IOCAFbits.IOCAF1 // bit 1
4102 #define IOCAF2 IOCAFbits.IOCAF2 // bit 2
4103 #define IOCAF3 IOCAFbits.IOCAF3 // bit 3
4104 #define IOCAF4 IOCAFbits.IOCAF4 // bit 4
4105 #define IOCAF5 IOCAFbits.IOCAF5 // bit 5
4107 #define IOCAN0 IOCANbits.IOCAN0 // bit 0
4108 #define IOCAN1 IOCANbits.IOCAN1 // bit 1
4109 #define IOCAN2 IOCANbits.IOCAN2 // bit 2
4110 #define IOCAN3 IOCANbits.IOCAN3 // bit 3
4111 #define IOCAN4 IOCANbits.IOCAN4 // bit 4
4112 #define IOCAN5 IOCANbits.IOCAN5 // bit 5
4114 #define IOCAP0 IOCAPbits.IOCAP0 // bit 0
4115 #define IOCAP1 IOCAPbits.IOCAP1 // bit 1
4116 #define IOCAP2 IOCAPbits.IOCAP2 // bit 2
4117 #define IOCAP3 IOCAPbits.IOCAP3 // bit 3
4118 #define IOCAP4 IOCAPbits.IOCAP4 // bit 4
4119 #define IOCAP5 IOCAPbits.IOCAP5 // bit 5
4121 #define IOCBF4 IOCBFbits.IOCBF4 // bit 4
4122 #define IOCBF5 IOCBFbits.IOCBF5 // bit 5
4123 #define IOCBF6 IOCBFbits.IOCBF6 // bit 6
4124 #define IOCBF7 IOCBFbits.IOCBF7 // bit 7
4126 #define IOCBN4 IOCBNbits.IOCBN4 // bit 4
4127 #define IOCBN5 IOCBNbits.IOCBN5 // bit 5
4128 #define IOCBN6 IOCBNbits.IOCBN6 // bit 6
4129 #define IOCBN7 IOCBNbits.IOCBN7 // bit 7
4131 #define IOCBP4 IOCBPbits.IOCBP4 // bit 4
4132 #define IOCBP5 IOCBPbits.IOCBP5 // bit 5
4133 #define IOCBP6 IOCBPbits.IOCBP6 // bit 6
4134 #define IOCBP7 IOCBPbits.IOCBP7 // bit 7
4136 #define LATA0 LATAbits.LATA0 // bit 0
4137 #define LATA1 LATAbits.LATA1 // bit 1
4138 #define LATA2 LATAbits.LATA2 // bit 2
4139 #define LATA4 LATAbits.LATA4 // bit 4
4140 #define LATA5 LATAbits.LATA5 // bit 5
4142 #define LATB4 LATBbits.LATB4 // bit 4
4143 #define LATB5 LATBbits.LATB5 // bit 5
4144 #define LATB6 LATBbits.LATB6 // bit 6
4145 #define LATB7 LATBbits.LATB7 // bit 7
4147 #define LATC0 LATCbits.LATC0 // bit 0
4148 #define LATC1 LATCbits.LATC1 // bit 1
4149 #define LATC2 LATCbits.LATC2 // bit 2
4150 #define LATC3 LATCbits.LATC3 // bit 3
4151 #define LATC4 LATCbits.LATC4 // bit 4
4152 #define LATC5 LATCbits.LATC5 // bit 5
4153 #define LATC6 LATCbits.LATC6 // bit 6
4154 #define LATC7 LATCbits.LATC7 // bit 7
4156 #define MDCH0 MDCARHbits.MDCH0 // bit 0
4157 #define MDCH1 MDCARHbits.MDCH1 // bit 1
4158 #define MDCH2 MDCARHbits.MDCH2 // bit 2
4159 #define MDCH3 MDCARHbits.MDCH3 // bit 3
4160 #define MDCHSYNC MDCARHbits.MDCHSYNC // bit 5
4161 #define MDCHPOL MDCARHbits.MDCHPOL // bit 6
4162 #define MDCHODIS MDCARHbits.MDCHODIS // bit 7
4164 #define MDCL0 MDCARLbits.MDCL0 // bit 0
4165 #define MDCL1 MDCARLbits.MDCL1 // bit 1
4166 #define MDCL2 MDCARLbits.MDCL2 // bit 2
4167 #define MDCL3 MDCARLbits.MDCL3 // bit 3
4168 #define MDCLSYNC MDCARLbits.MDCLSYNC // bit 5
4169 #define MDCLPOL MDCARLbits.MDCLPOL // bit 6
4170 #define MDCLODIS MDCARLbits.MDCLODIS // bit 7
4172 #define MDBIT MDCONbits.MDBIT // bit 0
4173 #define MDOUT MDCONbits.MDOUT // bit 3
4174 #define MDOPOL MDCONbits.MDOPOL // bit 4
4175 #define MDSLR MDCONbits.MDSLR // bit 5
4176 #define MDOE MDCONbits.MDOE // bit 6
4177 #define MDEN MDCONbits.MDEN // bit 7
4179 #define MDMS0 MDSRCbits.MDMS0 // bit 0
4180 #define MDMS1 MDSRCbits.MDMS1 // bit 1
4181 #define MDMS2 MDSRCbits.MDMS2 // bit 2
4182 #define MDMS3 MDSRCbits.MDMS3 // bit 3
4183 #define MDMSODIS MDSRCbits.MDMSODIS // bit 7
4185 #define PS0 OPTION_REGbits.PS0 // bit 0
4186 #define PS1 OPTION_REGbits.PS1 // bit 1
4187 #define PS2 OPTION_REGbits.PS2 // bit 2
4188 #define PSA OPTION_REGbits.PSA // bit 3
4189 #define TMR0SE OPTION_REGbits.TMR0SE // bit 4, shadows bit in OPTION_REGbits
4190 #define T0SE OPTION_REGbits.T0SE // bit 4, shadows bit in OPTION_REGbits
4191 #define TMR0CS OPTION_REGbits.TMR0CS // bit 5, shadows bit in OPTION_REGbits
4192 #define T0CS OPTION_REGbits.T0CS // bit 5, shadows bit in OPTION_REGbits
4193 #define INTEDG OPTION_REGbits.INTEDG // bit 6
4194 #define NOT_WPUEN OPTION_REGbits.NOT_WPUEN // bit 7
4196 #define SCS0 OSCCONbits.SCS0 // bit 0
4197 #define SCS1 OSCCONbits.SCS1 // bit 1
4198 #define IRCF0 OSCCONbits.IRCF0 // bit 3
4199 #define IRCF1 OSCCONbits.IRCF1 // bit 4
4200 #define IRCF2 OSCCONbits.IRCF2 // bit 5
4201 #define IRCF3 OSCCONbits.IRCF3 // bit 6
4202 #define SPLLEN OSCCONbits.SPLLEN // bit 7
4204 #define HFIOFS OSCSTATbits.HFIOFS // bit 0
4205 #define LFIOFR OSCSTATbits.LFIOFR // bit 1
4206 #define MFIOFR OSCSTATbits.MFIOFR // bit 2
4207 #define HFIOFL OSCSTATbits.HFIOFL // bit 3
4208 #define HFIOFR OSCSTATbits.HFIOFR // bit 4
4209 #define OSTS OSCSTATbits.OSTS // bit 5
4210 #define PLLR OSCSTATbits.PLLR // bit 6
4211 #define T1OSCR OSCSTATbits.T1OSCR // bit 7
4213 #define TUN0 OSCTUNEbits.TUN0 // bit 0
4214 #define TUN1 OSCTUNEbits.TUN1 // bit 1
4215 #define TUN2 OSCTUNEbits.TUN2 // bit 2
4216 #define TUN3 OSCTUNEbits.TUN3 // bit 3
4217 #define TUN4 OSCTUNEbits.TUN4 // bit 4
4218 #define TUN5 OSCTUNEbits.TUN5 // bit 5
4220 #define NOT_BOR PCONbits.NOT_BOR // bit 0
4221 #define NOT_POR PCONbits.NOT_POR // bit 1
4222 #define NOT_RI PCONbits.NOT_RI // bit 2
4223 #define NOT_RMCLR PCONbits.NOT_RMCLR // bit 3
4224 #define STKUNF PCONbits.STKUNF // bit 6
4225 #define STKOVF PCONbits.STKOVF // bit 7
4227 #define TMR1IE PIE1bits.TMR1IE // bit 0
4228 #define TMR2IE PIE1bits.TMR2IE // bit 1
4229 #define CCP1IE PIE1bits.CCP1IE // bit 2
4230 #define SSP1IE PIE1bits.SSP1IE // bit 3
4231 #define TXIE PIE1bits.TXIE // bit 4
4232 #define RCIE PIE1bits.RCIE // bit 5
4233 #define ADIE PIE1bits.ADIE // bit 6
4234 #define TMR1GIE PIE1bits.TMR1GIE // bit 7
4236 #define CCP2IE PIE2bits.CCP2IE // bit 0
4237 #define BCL1IE PIE2bits.BCL1IE // bit 3
4238 #define EEIE PIE2bits.EEIE // bit 4
4239 #define C1IE PIE2bits.C1IE // bit 5
4240 #define C2IE PIE2bits.C2IE // bit 6
4241 #define OSFIE PIE2bits.OSFIE // bit 7
4243 #define TMR4IE PIE3bits.TMR4IE // bit 1
4244 #define TMR6IE PIE3bits.TMR6IE // bit 3
4245 #define CCP3IE PIE3bits.CCP3IE // bit 4
4246 #define CCP4IE PIE3bits.CCP4IE // bit 5
4248 #define SSP2IE PIE4bits.SSP2IE // bit 0
4249 #define BCL2IE PIE4bits.BCL2IE // bit 1
4251 #define TMR1IF PIR1bits.TMR1IF // bit 0
4252 #define TMR2IF PIR1bits.TMR2IF // bit 1
4253 #define CCP1IF PIR1bits.CCP1IF // bit 2
4254 #define SSP1IF PIR1bits.SSP1IF // bit 3
4255 #define TXIF PIR1bits.TXIF // bit 4
4256 #define RCIF PIR1bits.RCIF // bit 5
4257 #define ADIF PIR1bits.ADIF // bit 6
4258 #define TMR1GIF PIR1bits.TMR1GIF // bit 7
4260 #define CCP2IF PIR2bits.CCP2IF // bit 0
4261 #define BCL1IF PIR2bits.BCL1IF // bit 3
4262 #define EEIF PIR2bits.EEIF // bit 4
4263 #define C1IF PIR2bits.C1IF // bit 5
4264 #define C2IF PIR2bits.C2IF // bit 6
4265 #define OSFIF PIR2bits.OSFIF // bit 7
4267 #define TMR4IF PIR3bits.TMR4IF // bit 1
4268 #define TMR6IF PIR3bits.TMR6IF // bit 3
4269 #define CCP3IF PIR3bits.CCP3IF // bit 4
4270 #define CCP4IF PIR3bits.CCP4IF // bit 5
4272 #define SSP2IF PIR4bits.SSP2IF // bit 0
4273 #define BCL2IF PIR4bits.BCL2IF // bit 1
4275 #define RA0 PORTAbits.RA0 // bit 0
4276 #define RA1 PORTAbits.RA1 // bit 1
4277 #define RA2 PORTAbits.RA2 // bit 2
4278 #define RA3 PORTAbits.RA3 // bit 3
4279 #define RA4 PORTAbits.RA4 // bit 4
4280 #define RA5 PORTAbits.RA5 // bit 5
4282 #define RB4 PORTBbits.RB4 // bit 4
4283 #define RB5 PORTBbits.RB5 // bit 5
4284 #define RB6 PORTBbits.RB6 // bit 6
4285 #define RB7 PORTBbits.RB7 // bit 7
4287 #define RC0 PORTCbits.RC0 // bit 0
4288 #define RC1 PORTCbits.RC1 // bit 1
4289 #define RC2 PORTCbits.RC2 // bit 2
4290 #define RC3 PORTCbits.RC3 // bit 3
4291 #define RC4 PORTCbits.RC4 // bit 4
4292 #define RC5 PORTCbits.RC5 // bit 5
4293 #define RC6 PORTCbits.RC6 // bit 6
4294 #define RC7 PORTCbits.RC7 // bit 7
4296 #define STR1A PSTR1CONbits.STR1A // bit 0
4297 #define STR1B PSTR1CONbits.STR1B // bit 1
4298 #define STR1C PSTR1CONbits.STR1C // bit 2
4299 #define STR1D PSTR1CONbits.STR1D // bit 3
4300 #define STR1SYNC PSTR1CONbits.STR1SYNC // bit 4
4302 #define STR2A PSTR2CONbits.STR2A // bit 0
4303 #define STR2B PSTR2CONbits.STR2B // bit 1
4304 #define STR2C PSTR2CONbits.STR2C // bit 2
4305 #define STR2D PSTR2CONbits.STR2D // bit 3
4306 #define STR2SYNC PSTR2CONbits.STR2SYNC // bit 4
4308 #define P1DC0 PWM1CONbits.P1DC0 // bit 0
4309 #define P1DC1 PWM1CONbits.P1DC1 // bit 1
4310 #define P1DC2 PWM1CONbits.P1DC2 // bit 2
4311 #define P1DC3 PWM1CONbits.P1DC3 // bit 3
4312 #define P1DC4 PWM1CONbits.P1DC4 // bit 4
4313 #define P1DC5 PWM1CONbits.P1DC5 // bit 5
4314 #define P1DC6 PWM1CONbits.P1DC6 // bit 6
4315 #define P1RSEN PWM1CONbits.P1RSEN // bit 7
4317 #define P2DC0 PWM2CONbits.P2DC0 // bit 0
4318 #define P2DC1 PWM2CONbits.P2DC1 // bit 1
4319 #define P2DC2 PWM2CONbits.P2DC2 // bit 2
4320 #define P2DC3 PWM2CONbits.P2DC3 // bit 3
4321 #define P2DC4 PWM2CONbits.P2DC4 // bit 4
4322 #define P2DC5 PWM2CONbits.P2DC5 // bit 5
4323 #define P2DC6 PWM2CONbits.P2DC6 // bit 6
4324 #define P2RSEN PWM2CONbits.P2RSEN // bit 7
4326 #define RX9D RCSTAbits.RX9D // bit 0
4327 #define OERR RCSTAbits.OERR // bit 1
4328 #define FERR RCSTAbits.FERR // bit 2
4329 #define ADDEN RCSTAbits.ADDEN // bit 3
4330 #define CREN RCSTAbits.CREN // bit 4
4331 #define SREN RCSTAbits.SREN // bit 5
4332 #define RX9 RCSTAbits.RX9 // bit 6
4333 #define SPEN RCSTAbits.SPEN // bit 7
4335 #define SRPR SRCON0bits.SRPR // bit 0
4336 #define SRPS SRCON0bits.SRPS // bit 1
4337 #define SRNQEN SRCON0bits.SRNQEN // bit 2
4338 #define SRQEN SRCON0bits.SRQEN // bit 3
4339 #define SRCLK0 SRCON0bits.SRCLK0 // bit 4
4340 #define SRCLK1 SRCON0bits.SRCLK1 // bit 5
4341 #define SRCLK2 SRCON0bits.SRCLK2 // bit 6
4342 #define SRLEN SRCON0bits.SRLEN // bit 7
4344 #define SRRC1E SRCON1bits.SRRC1E // bit 0
4345 #define SRRC2E SRCON1bits.SRRC2E // bit 1
4346 #define SRRCKE SRCON1bits.SRRCKE // bit 2
4347 #define SRRPE SRCON1bits.SRRPE // bit 3
4348 #define SRSC1E SRCON1bits.SRSC1E // bit 4
4349 #define SRSC2E SRCON1bits.SRSC2E // bit 5
4350 #define SRSCKE SRCON1bits.SRSCKE // bit 6
4351 #define SRSPE SRCON1bits.SRSPE // bit 7
4353 #define SSPM0 SSP1CON1bits.SSPM0 // bit 0
4354 #define SSPM1 SSP1CON1bits.SSPM1 // bit 1
4355 #define SSPM2 SSP1CON1bits.SSPM2 // bit 2
4356 #define SSPM3 SSP1CON1bits.SSPM3 // bit 3
4357 #define CKP SSP1CON1bits.CKP // bit 4
4358 #define SSPEN SSP1CON1bits.SSPEN // bit 5
4359 #define SSPOV SSP1CON1bits.SSPOV // bit 6
4360 #define WCOL SSP1CON1bits.WCOL // bit 7
4362 #define SEN SSP1CON2bits.SEN // bit 0
4363 #define RSEN SSP1CON2bits.RSEN // bit 1
4364 #define PEN SSP1CON2bits.PEN // bit 2
4365 #define RCEN SSP1CON2bits.RCEN // bit 3
4366 #define ACKEN SSP1CON2bits.ACKEN // bit 4
4367 #define ACKDT SSP1CON2bits.ACKDT // bit 5
4368 #define ACKSTAT SSP1CON2bits.ACKSTAT // bit 6
4369 #define GCEN SSP1CON2bits.GCEN // bit 7
4371 #define DHEN SSP1CON3bits.DHEN // bit 0
4372 #define AHEN SSP1CON3bits.AHEN // bit 1
4373 #define SBCDE SSP1CON3bits.SBCDE // bit 2
4374 #define SDAHT SSP1CON3bits.SDAHT // bit 3
4375 #define BOEN SSP1CON3bits.BOEN // bit 4
4376 #define SCIE SSP1CON3bits.SCIE // bit 5
4377 #define PCIE SSP1CON3bits.PCIE // bit 6
4378 #define ACKTIM SSP1CON3bits.ACKTIM // bit 7
4380 #define BF SSP1STATbits.BF // bit 0
4381 #define UA SSP1STATbits.UA // bit 1
4382 #define R_NOT_W SSP1STATbits.R_NOT_W // bit 2
4383 #define S SSP1STATbits.S // bit 3
4384 #define P SSP1STATbits.P // bit 4
4385 #define D_NOT_A SSP1STATbits.D_NOT_A // bit 5
4386 #define CKE SSP1STATbits.CKE // bit 6
4387 #define SMP SSP1STATbits.SMP // bit 7
4389 #define C STATUSbits.C // bit 0
4390 #define DC STATUSbits.DC // bit 1
4391 #define Z STATUSbits.Z // bit 2
4392 #define NOT_PD STATUSbits.NOT_PD // bit 3
4393 #define NOT_TO STATUSbits.NOT_TO // bit 4
4395 #define C_SHAD STATUS_SHADbits.C_SHAD // bit 0
4396 #define DC_SHAD STATUS_SHADbits.DC_SHAD // bit 1
4397 #define Z_SHAD STATUS_SHADbits.Z_SHAD // bit 2
4399 #define TMR1ON T1CONbits.TMR1ON // bit 0
4400 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2
4401 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
4402 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
4403 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
4404 #define TMR1CS0 T1CONbits.TMR1CS0 // bit 6
4405 #define TMR1CS1 T1CONbits.TMR1CS1 // bit 7
4407 #define T1GSS0 T1GCONbits.T1GSS0 // bit 0
4408 #define T1GSS1 T1GCONbits.T1GSS1 // bit 1
4409 #define T1GVAL T1GCONbits.T1GVAL // bit 2
4410 #define T1GGO T1GCONbits.T1GGO // bit 3
4411 #define T1GSPM T1GCONbits.T1GSPM // bit 4
4412 #define T1GTM T1GCONbits.T1GTM // bit 5
4413 #define T1GPOL T1GCONbits.T1GPOL // bit 6
4414 #define TMR1GE T1GCONbits.TMR1GE // bit 7
4416 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
4417 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
4418 #define TMR2ON T2CONbits.TMR2ON // bit 2
4419 #define T2OUTPS0 T2CONbits.T2OUTPS0 // bit 3
4420 #define T2OUTPS1 T2CONbits.T2OUTPS1 // bit 4
4421 #define T2OUTPS2 T2CONbits.T2OUTPS2 // bit 5
4422 #define T2OUTPS3 T2CONbits.T2OUTPS3 // bit 6
4424 #define T4CKPS0 T4CONbits.T4CKPS0 // bit 0
4425 #define T4CKPS1 T4CONbits.T4CKPS1 // bit 1
4426 #define TMR4ON T4CONbits.TMR4ON // bit 2
4427 #define T4OUTPS0 T4CONbits.T4OUTPS0 // bit 3
4428 #define T4OUTPS1 T4CONbits.T4OUTPS1 // bit 4
4429 #define T4OUTPS2 T4CONbits.T4OUTPS2 // bit 5
4430 #define T4OUTPS3 T4CONbits.T4OUTPS3 // bit 6
4432 #define T6CKPS0 T6CONbits.T6CKPS0 // bit 0
4433 #define T6CKPS1 T6CONbits.T6CKPS1 // bit 1
4434 #define TMR6ON T6CONbits.TMR6ON // bit 2
4435 #define T6OUTPS0 T6CONbits.T6OUTPS0 // bit 3
4436 #define T6OUTPS1 T6CONbits.T6OUTPS1 // bit 4
4437 #define T6OUTPS2 T6CONbits.T6OUTPS2 // bit 5
4438 #define T6OUTPS3 T6CONbits.T6OUTPS3 // bit 6
4440 #define TRISA0 TRISAbits.TRISA0 // bit 0
4441 #define TRISA1 TRISAbits.TRISA1 // bit 1
4442 #define TRISA2 TRISAbits.TRISA2 // bit 2
4443 #define TRISA3 TRISAbits.TRISA3 // bit 3
4444 #define TRISA4 TRISAbits.TRISA4 // bit 4
4445 #define TRISA5 TRISAbits.TRISA5 // bit 5
4447 #define TRISB4 TRISBbits.TRISB4 // bit 4
4448 #define TRISB5 TRISBbits.TRISB5 // bit 5
4449 #define TRISB6 TRISBbits.TRISB6 // bit 6
4450 #define TRISB7 TRISBbits.TRISB7 // bit 7
4452 #define TRISC0 TRISCbits.TRISC0 // bit 0
4453 #define TRISC1 TRISCbits.TRISC1 // bit 1
4454 #define TRISC2 TRISCbits.TRISC2 // bit 2
4455 #define TRISC3 TRISCbits.TRISC3 // bit 3
4456 #define TRISC4 TRISCbits.TRISC4 // bit 4
4457 #define TRISC5 TRISCbits.TRISC5 // bit 5
4458 #define TRISC6 TRISCbits.TRISC6 // bit 6
4459 #define TRISC7 TRISCbits.TRISC7 // bit 7
4461 #define TX9D TXSTAbits.TX9D // bit 0
4462 #define TRMT TXSTAbits.TRMT // bit 1
4463 #define BRGH TXSTAbits.BRGH // bit 2
4464 #define SENDB TXSTAbits.SENDB // bit 3
4465 #define SYNC TXSTAbits.SYNC // bit 4
4466 #define TXEN TXSTAbits.TXEN // bit 5
4467 #define TX9 TXSTAbits.TX9 // bit 6
4468 #define CSRC TXSTAbits.CSRC // bit 7
4470 #define SWDTEN WDTCONbits.SWDTEN // bit 0
4471 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1
4472 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2
4473 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3
4474 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4
4475 #define WDTPS4 WDTCONbits.WDTPS4 // bit 5
4477 #define WPUA0 WPUAbits.WPUA0 // bit 0
4478 #define WPUA1 WPUAbits.WPUA1 // bit 1
4479 #define WPUA2 WPUAbits.WPUA2 // bit 2
4480 #define WPUA3 WPUAbits.WPUA3 // bit 3
4481 #define WPUA4 WPUAbits.WPUA4 // bit 4
4482 #define WPUA5 WPUAbits.WPUA5 // bit 5
4484 #define WPUB4 WPUBbits.WPUB4 // bit 4
4485 #define WPUB5 WPUBbits.WPUB5 // bit 5
4486 #define WPUB6 WPUBbits.WPUB6 // bit 6
4487 #define WPUB7 WPUBbits.WPUB7 // bit 7
4489 #define WPUC0 WPUCbits.WPUC0 // bit 0
4490 #define WPUC1 WPUCbits.WPUC1 // bit 1
4491 #define WPUC2 WPUCbits.WPUC2 // bit 2
4492 #define WPUC3 WPUCbits.WPUC3 // bit 3
4493 #define WPUC4 WPUCbits.WPUC4 // bit 4
4494 #define WPUC5 WPUCbits.WPUC5 // bit 5
4495 #define WPUC6 WPUCbits.WPUC6 // bit 6
4496 #define WPUC7 WPUCbits.WPUC7 // bit 7
4498 #endif // #ifndef NO_BIT_DEFINES
4500 #endif // #ifndef __PIC16F1829_H__