Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16f1823.h
blobf461d37ffc33800137c8768bac6c804f6a35a517
1 /*
2 * This declarations of the PIC16F1823 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:19 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 __PIC16F1823_H__
26 #define __PIC16F1823_H__
28 //==============================================================================
30 // Register Addresses
32 //==============================================================================
34 #ifndef NO_ADDR_DEFINES
36 #define INDF0_ADDR 0x0000
37 #define INDF1_ADDR 0x0001
38 #define PCL_ADDR 0x0002
39 #define STATUS_ADDR 0x0003
40 #define FSR0_ADDR 0x0004
41 #define FSR0L_ADDR 0x0004
42 #define FSR0H_ADDR 0x0005
43 #define FSR1_ADDR 0x0006
44 #define FSR1L_ADDR 0x0006
45 #define FSR1H_ADDR 0x0007
46 #define BSR_ADDR 0x0008
47 #define WREG_ADDR 0x0009
48 #define PCLATH_ADDR 0x000A
49 #define INTCON_ADDR 0x000B
50 #define PORTA_ADDR 0x000C
51 #define PORTC_ADDR 0x000E
52 #define PIR1_ADDR 0x0011
53 #define PIR2_ADDR 0x0012
54 #define TMR0_ADDR 0x0015
55 #define TMR1_ADDR 0x0016
56 #define TMR1L_ADDR 0x0016
57 #define TMR1H_ADDR 0x0017
58 #define T1CON_ADDR 0x0018
59 #define T1GCON_ADDR 0x0019
60 #define TMR2_ADDR 0x001A
61 #define PR2_ADDR 0x001B
62 #define T2CON_ADDR 0x001C
63 #define CPSCON0_ADDR 0x001E
64 #define CPSCON1_ADDR 0x001F
65 #define TRISA_ADDR 0x008C
66 #define TRISC_ADDR 0x008E
67 #define PIE1_ADDR 0x0091
68 #define PIE2_ADDR 0x0092
69 #define OPTION_REG_ADDR 0x0095
70 #define PCON_ADDR 0x0096
71 #define WDTCON_ADDR 0x0097
72 #define OSCTUNE_ADDR 0x0098
73 #define OSCCON_ADDR 0x0099
74 #define OSCSTAT_ADDR 0x009A
75 #define ADRES_ADDR 0x009B
76 #define ADRESL_ADDR 0x009B
77 #define ADRESH_ADDR 0x009C
78 #define ADCON0_ADDR 0x009D
79 #define ADCON1_ADDR 0x009E
80 #define LATA_ADDR 0x010C
81 #define LATC_ADDR 0x010E
82 #define CM1CON0_ADDR 0x0111
83 #define CM1CON1_ADDR 0x0112
84 #define CM2CON0_ADDR 0x0113
85 #define CM2CON1_ADDR 0x0114
86 #define CMOUT_ADDR 0x0115
87 #define BORCON_ADDR 0x0116
88 #define FVRCON_ADDR 0x0117
89 #define DACCON0_ADDR 0x0118
90 #define DACCON1_ADDR 0x0119
91 #define SRCON0_ADDR 0x011A
92 #define SRCON1_ADDR 0x011B
93 #define APFCON_ADDR 0x011D
94 #define APFCON0_ADDR 0x011D
95 #define ANSELA_ADDR 0x018C
96 #define ANSELC_ADDR 0x018E
97 #define EEADR_ADDR 0x0191
98 #define EEADRL_ADDR 0x0191
99 #define EEADRH_ADDR 0x0192
100 #define EEDAT_ADDR 0x0193
101 #define EEDATL_ADDR 0x0193
102 #define EEDATH_ADDR 0x0194
103 #define EECON1_ADDR 0x0195
104 #define EECON2_ADDR 0x0196
105 #define RCREG_ADDR 0x0199
106 #define TXREG_ADDR 0x019A
107 #define SP1BRG_ADDR 0x019B
108 #define SP1BRGL_ADDR 0x019B
109 #define SPBRG_ADDR 0x019B
110 #define SPBRGL_ADDR 0x019B
111 #define SP1BRGH_ADDR 0x019C
112 #define SPBRGH_ADDR 0x019C
113 #define RCSTA_ADDR 0x019D
114 #define TXSTA_ADDR 0x019E
115 #define BAUDCON_ADDR 0x019F
116 #define WPUA_ADDR 0x020C
117 #define WPUC_ADDR 0x020E
118 #define SSP1BUF_ADDR 0x0211
119 #define SSPBUF_ADDR 0x0211
120 #define SSP1ADD_ADDR 0x0212
121 #define SSPADD_ADDR 0x0212
122 #define SSP1MSK_ADDR 0x0213
123 #define SSPMSK_ADDR 0x0213
124 #define SSP1STAT_ADDR 0x0214
125 #define SSPSTAT_ADDR 0x0214
126 #define SSP1CON1_ADDR 0x0215
127 #define SSPCON_ADDR 0x0215
128 #define SSPCON1_ADDR 0x0215
129 #define SSP1CON2_ADDR 0x0216
130 #define SSPCON2_ADDR 0x0216
131 #define SSP1CON3_ADDR 0x0217
132 #define SSPCON3_ADDR 0x0217
133 #define CCPR1_ADDR 0x0291
134 #define CCPR1L_ADDR 0x0291
135 #define CCPR1H_ADDR 0x0292
136 #define CCP1CON_ADDR 0x0293
137 #define PWM1CON_ADDR 0x0294
138 #define CCP1AS_ADDR 0x0295
139 #define ECCP1AS_ADDR 0x0295
140 #define PSTR1CON_ADDR 0x0296
141 #define IOCAP_ADDR 0x0391
142 #define IOCAN_ADDR 0x0392
143 #define IOCAF_ADDR 0x0393
144 #define CLKRCON_ADDR 0x039A
145 #define MDCON_ADDR 0x039C
146 #define MDSRC_ADDR 0x039D
147 #define MDCARL_ADDR 0x039E
148 #define MDCARH_ADDR 0x039F
149 #define STATUS_SHAD_ADDR 0x0FE4
150 #define WREG_SHAD_ADDR 0x0FE5
151 #define BSR_SHAD_ADDR 0x0FE6
152 #define PCLATH_SHAD_ADDR 0x0FE7
153 #define FSR0L_SHAD_ADDR 0x0FE8
154 #define FSR0H_SHAD_ADDR 0x0FE9
155 #define FSR1L_SHAD_ADDR 0x0FEA
156 #define FSR1H_SHAD_ADDR 0x0FEB
157 #define STKPTR_ADDR 0x0FED
158 #define TOSL_ADDR 0x0FEE
159 #define TOSH_ADDR 0x0FEF
161 #endif // #ifndef NO_ADDR_DEFINES
163 //==============================================================================
165 // Register Definitions
167 //==============================================================================
169 extern __at(0x0000) __sfr INDF0;
170 extern __at(0x0001) __sfr INDF1;
171 extern __at(0x0002) __sfr PCL;
173 //==============================================================================
174 // STATUS Bits
176 extern __at(0x0003) __sfr STATUS;
178 typedef struct
180 unsigned C : 1;
181 unsigned DC : 1;
182 unsigned Z : 1;
183 unsigned NOT_PD : 1;
184 unsigned NOT_TO : 1;
185 unsigned : 1;
186 unsigned : 1;
187 unsigned : 1;
188 } __STATUSbits_t;
190 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
192 #define _C 0x01
193 #define _DC 0x02
194 #define _Z 0x04
195 #define _NOT_PD 0x08
196 #define _NOT_TO 0x10
198 //==============================================================================
200 extern __at(0x0004) __sfr FSR0;
201 extern __at(0x0004) __sfr FSR0L;
202 extern __at(0x0005) __sfr FSR0H;
203 extern __at(0x0006) __sfr FSR1;
204 extern __at(0x0006) __sfr FSR1L;
205 extern __at(0x0007) __sfr FSR1H;
207 //==============================================================================
208 // BSR Bits
210 extern __at(0x0008) __sfr BSR;
212 typedef union
214 struct
216 unsigned BSR0 : 1;
217 unsigned BSR1 : 1;
218 unsigned BSR2 : 1;
219 unsigned BSR3 : 1;
220 unsigned BSR4 : 1;
221 unsigned : 1;
222 unsigned : 1;
223 unsigned : 1;
226 struct
228 unsigned BSR : 5;
229 unsigned : 3;
231 } __BSRbits_t;
233 extern __at(0x0008) volatile __BSRbits_t BSRbits;
235 #define _BSR0 0x01
236 #define _BSR1 0x02
237 #define _BSR2 0x04
238 #define _BSR3 0x08
239 #define _BSR4 0x10
241 //==============================================================================
243 extern __at(0x0009) __sfr WREG;
244 extern __at(0x000A) __sfr PCLATH;
246 //==============================================================================
247 // INTCON Bits
249 extern __at(0x000B) __sfr INTCON;
251 typedef union
253 struct
255 unsigned IOCIF : 1;
256 unsigned INTF : 1;
257 unsigned TMR0IF : 1;
258 unsigned IOCIE : 1;
259 unsigned INTE : 1;
260 unsigned TMR0IE : 1;
261 unsigned PEIE : 1;
262 unsigned GIE : 1;
265 struct
267 unsigned : 1;
268 unsigned : 1;
269 unsigned T0IF : 1;
270 unsigned : 1;
271 unsigned : 1;
272 unsigned T0IE : 1;
273 unsigned : 1;
274 unsigned : 1;
276 } __INTCONbits_t;
278 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
280 #define _IOCIF 0x01
281 #define _INTF 0x02
282 #define _TMR0IF 0x04
283 #define _T0IF 0x04
284 #define _IOCIE 0x08
285 #define _INTE 0x10
286 #define _TMR0IE 0x20
287 #define _T0IE 0x20
288 #define _PEIE 0x40
289 #define _GIE 0x80
291 //==============================================================================
294 //==============================================================================
295 // PORTA Bits
297 extern __at(0x000C) __sfr PORTA;
299 typedef union
301 struct
303 unsigned RA0 : 1;
304 unsigned RA1 : 1;
305 unsigned RA2 : 1;
306 unsigned RA3 : 1;
307 unsigned RA4 : 1;
308 unsigned RA5 : 1;
309 unsigned : 1;
310 unsigned : 1;
313 struct
315 unsigned AN0 : 1;
316 unsigned AN1 : 1;
317 unsigned AN2 : 1;
318 unsigned NOT_SS : 1;
319 unsigned AN3 : 1;
320 unsigned T1OSI : 1;
321 unsigned : 1;
322 unsigned : 1;
325 struct
327 unsigned CPS0 : 1;
328 unsigned CPS1 : 1;
329 unsigned CPS2 : 1;
330 unsigned NOT_MCLR : 1;
331 unsigned CPS3 : 1;
332 unsigned T1CKI : 1;
333 unsigned : 1;
334 unsigned : 1;
337 struct
339 unsigned C1INP : 1;
340 unsigned C12IN0N : 1;
341 unsigned C1OUT : 1;
342 unsigned : 1;
343 unsigned SDO : 1;
344 unsigned OSC1 : 1;
345 unsigned : 1;
346 unsigned : 1;
349 struct
351 unsigned TX : 1;
352 unsigned RX : 1;
353 unsigned T0CKI : 1;
354 unsigned : 1;
355 unsigned CLKR : 1;
356 unsigned CLKIN : 1;
357 unsigned : 1;
358 unsigned : 1;
361 struct
363 unsigned CK : 1;
364 unsigned DT : 1;
365 unsigned FLT0 : 1;
366 unsigned : 1;
367 unsigned T1OSO : 1;
368 unsigned : 1;
369 unsigned : 1;
370 unsigned : 1;
373 struct
375 unsigned DACOUT : 1;
376 unsigned SRI : 1;
377 unsigned SRQ : 1;
378 unsigned : 1;
379 unsigned OSC2 : 1;
380 unsigned : 1;
381 unsigned : 1;
382 unsigned : 1;
385 struct
387 unsigned : 1;
388 unsigned : 1;
389 unsigned : 1;
390 unsigned : 1;
391 unsigned CLKOUT : 1;
392 unsigned : 1;
393 unsigned : 1;
394 unsigned : 1;
397 struct
399 unsigned RA : 6;
400 unsigned : 2;
402 } __PORTAbits_t;
404 extern __at(0x000C) volatile __PORTAbits_t PORTAbits;
406 #define _PORTA_RA0 0x01
407 #define _PORTA_AN0 0x01
408 #define _PORTA_CPS0 0x01
409 #define _PORTA_C1INP 0x01
410 #define _PORTA_TX 0x01
411 #define _PORTA_CK 0x01
412 #define _PORTA_DACOUT 0x01
413 #define _PORTA_RA1 0x02
414 #define _PORTA_AN1 0x02
415 #define _PORTA_CPS1 0x02
416 #define _PORTA_C12IN0N 0x02
417 #define _PORTA_RX 0x02
418 #define _PORTA_DT 0x02
419 #define _PORTA_SRI 0x02
420 #define _PORTA_RA2 0x04
421 #define _PORTA_AN2 0x04
422 #define _PORTA_CPS2 0x04
423 #define _PORTA_C1OUT 0x04
424 #define _PORTA_T0CKI 0x04
425 #define _PORTA_FLT0 0x04
426 #define _PORTA_SRQ 0x04
427 #define _PORTA_RA3 0x08
428 #define _PORTA_NOT_SS 0x08
429 #define _PORTA_NOT_MCLR 0x08
430 #define _PORTA_RA4 0x10
431 #define _PORTA_AN3 0x10
432 #define _PORTA_CPS3 0x10
433 #define _PORTA_SDO 0x10
434 #define _PORTA_CLKR 0x10
435 #define _PORTA_T1OSO 0x10
436 #define _PORTA_OSC2 0x10
437 #define _PORTA_CLKOUT 0x10
438 #define _PORTA_RA5 0x20
439 #define _PORTA_T1OSI 0x20
440 #define _PORTA_T1CKI 0x20
441 #define _PORTA_OSC1 0x20
442 #define _PORTA_CLKIN 0x20
444 //==============================================================================
447 //==============================================================================
448 // PORTC Bits
450 extern __at(0x000E) __sfr PORTC;
452 typedef union
454 struct
456 unsigned RC0 : 1;
457 unsigned RC1 : 1;
458 unsigned RC2 : 1;
459 unsigned RC3 : 1;
460 unsigned RC4 : 1;
461 unsigned RC5 : 1;
462 unsigned : 1;
463 unsigned : 1;
466 struct
468 unsigned AN4 : 1;
469 unsigned AN5 : 1;
470 unsigned AN6 : 1;
471 unsigned AN7 : 1;
472 unsigned C2OUT : 1;
473 unsigned P1A : 1;
474 unsigned : 1;
475 unsigned : 1;
478 struct
480 unsigned CPS4 : 1;
481 unsigned CPS5 : 1;
482 unsigned CPS6 : 1;
483 unsigned CPS7 : 1;
484 unsigned P1B : 1;
485 unsigned CCP1 : 1;
486 unsigned : 1;
487 unsigned : 1;
490 struct
492 unsigned C2INP : 1;
493 unsigned C12IN1N : 1;
494 unsigned C12IN2N : 1;
495 unsigned C12IN3N : 1;
496 unsigned SRNQ : 1;
497 unsigned MDCIN2 : 1;
498 unsigned : 1;
499 unsigned : 1;
502 struct
504 unsigned SCL : 1;
505 unsigned SDA : 1;
506 unsigned P1D : 1;
507 unsigned P1C : 1;
508 unsigned MDOUT : 1;
509 unsigned RX : 1;
510 unsigned : 1;
511 unsigned : 1;
514 struct
516 unsigned SCK : 1;
517 unsigned SDI : 1;
518 unsigned SDO : 1;
519 unsigned NOT_SS : 1;
520 unsigned TX : 1;
521 unsigned DT : 1;
522 unsigned : 1;
523 unsigned : 1;
526 struct
528 unsigned : 1;
529 unsigned : 1;
530 unsigned MDCIN1 : 1;
531 unsigned MDMIN : 1;
532 unsigned CK : 1;
533 unsigned : 1;
534 unsigned : 1;
535 unsigned : 1;
538 struct
540 unsigned RC : 6;
541 unsigned : 2;
543 } __PORTCbits_t;
545 extern __at(0x000E) volatile __PORTCbits_t PORTCbits;
547 #define _PORTC_RC0 0x01
548 #define _PORTC_AN4 0x01
549 #define _PORTC_CPS4 0x01
550 #define _PORTC_C2INP 0x01
551 #define _PORTC_SCL 0x01
552 #define _PORTC_SCK 0x01
553 #define _PORTC_RC1 0x02
554 #define _PORTC_AN5 0x02
555 #define _PORTC_CPS5 0x02
556 #define _PORTC_C12IN1N 0x02
557 #define _PORTC_SDA 0x02
558 #define _PORTC_SDI 0x02
559 #define _PORTC_RC2 0x04
560 #define _PORTC_AN6 0x04
561 #define _PORTC_CPS6 0x04
562 #define _PORTC_C12IN2N 0x04
563 #define _PORTC_P1D 0x04
564 #define _PORTC_SDO 0x04
565 #define _PORTC_MDCIN1 0x04
566 #define _PORTC_RC3 0x08
567 #define _PORTC_AN7 0x08
568 #define _PORTC_CPS7 0x08
569 #define _PORTC_C12IN3N 0x08
570 #define _PORTC_P1C 0x08
571 #define _PORTC_NOT_SS 0x08
572 #define _PORTC_MDMIN 0x08
573 #define _PORTC_RC4 0x10
574 #define _PORTC_C2OUT 0x10
575 #define _PORTC_P1B 0x10
576 #define _PORTC_SRNQ 0x10
577 #define _PORTC_MDOUT 0x10
578 #define _PORTC_TX 0x10
579 #define _PORTC_CK 0x10
580 #define _PORTC_RC5 0x20
581 #define _PORTC_P1A 0x20
582 #define _PORTC_CCP1 0x20
583 #define _PORTC_MDCIN2 0x20
584 #define _PORTC_RX 0x20
585 #define _PORTC_DT 0x20
587 //==============================================================================
590 //==============================================================================
591 // PIR1 Bits
593 extern __at(0x0011) __sfr PIR1;
595 typedef struct
597 unsigned TMR1IF : 1;
598 unsigned TMR2IF : 1;
599 unsigned CCP1IF : 1;
600 unsigned SSP1IF : 1;
601 unsigned TXIF : 1;
602 unsigned RCIF : 1;
603 unsigned ADIF : 1;
604 unsigned TMR1GIF : 1;
605 } __PIR1bits_t;
607 extern __at(0x0011) volatile __PIR1bits_t PIR1bits;
609 #define _TMR1IF 0x01
610 #define _TMR2IF 0x02
611 #define _CCP1IF 0x04
612 #define _SSP1IF 0x08
613 #define _TXIF 0x10
614 #define _RCIF 0x20
615 #define _ADIF 0x40
616 #define _TMR1GIF 0x80
618 //==============================================================================
621 //==============================================================================
622 // PIR2 Bits
624 extern __at(0x0012) __sfr PIR2;
626 typedef struct
628 unsigned : 1;
629 unsigned : 1;
630 unsigned : 1;
631 unsigned BCL1IF : 1;
632 unsigned EEIF : 1;
633 unsigned C1IF : 1;
634 unsigned C2IF : 1;
635 unsigned OSFIF : 1;
636 } __PIR2bits_t;
638 extern __at(0x0012) volatile __PIR2bits_t PIR2bits;
640 #define _BCL1IF 0x08
641 #define _EEIF 0x10
642 #define _C1IF 0x20
643 #define _C2IF 0x40
644 #define _OSFIF 0x80
646 //==============================================================================
648 extern __at(0x0015) __sfr TMR0;
649 extern __at(0x0016) __sfr TMR1;
650 extern __at(0x0016) __sfr TMR1L;
651 extern __at(0x0017) __sfr TMR1H;
653 //==============================================================================
654 // T1CON Bits
656 extern __at(0x0018) __sfr T1CON;
658 typedef union
660 struct
662 unsigned TMR1ON : 1;
663 unsigned : 1;
664 unsigned NOT_T1SYNC : 1;
665 unsigned T1OSCEN : 1;
666 unsigned T1CKPS0 : 1;
667 unsigned T1CKPS1 : 1;
668 unsigned TMR1CS0 : 1;
669 unsigned TMR1CS1 : 1;
672 struct
674 unsigned : 4;
675 unsigned T1CKPS : 2;
676 unsigned : 2;
679 struct
681 unsigned : 6;
682 unsigned TMR1CS : 2;
684 } __T1CONbits_t;
686 extern __at(0x0018) volatile __T1CONbits_t T1CONbits;
688 #define _TMR1ON 0x01
689 #define _NOT_T1SYNC 0x04
690 #define _T1OSCEN 0x08
691 #define _T1CKPS0 0x10
692 #define _T1CKPS1 0x20
693 #define _TMR1CS0 0x40
694 #define _TMR1CS1 0x80
696 //==============================================================================
699 //==============================================================================
700 // T1GCON Bits
702 extern __at(0x0019) __sfr T1GCON;
704 typedef union
706 struct
708 unsigned T1GSS0 : 1;
709 unsigned T1GSS1 : 1;
710 unsigned T1GVAL : 1;
711 unsigned T1GGO_NOT_DONE : 1;
712 unsigned T1GSPM : 1;
713 unsigned T1GTM : 1;
714 unsigned T1GPOL : 1;
715 unsigned TMR1GE : 1;
718 struct
720 unsigned : 1;
721 unsigned : 1;
722 unsigned : 1;
723 unsigned T1GGO : 1;
724 unsigned : 1;
725 unsigned : 1;
726 unsigned : 1;
727 unsigned : 1;
730 struct
732 unsigned T1GSS : 2;
733 unsigned : 6;
735 } __T1GCONbits_t;
737 extern __at(0x0019) volatile __T1GCONbits_t T1GCONbits;
739 #define _T1GSS0 0x01
740 #define _T1GSS1 0x02
741 #define _T1GVAL 0x04
742 #define _T1GGO_NOT_DONE 0x08
743 #define _T1GGO 0x08
744 #define _T1GSPM 0x10
745 #define _T1GTM 0x20
746 #define _T1GPOL 0x40
747 #define _TMR1GE 0x80
749 //==============================================================================
751 extern __at(0x001A) __sfr TMR2;
752 extern __at(0x001B) __sfr PR2;
754 //==============================================================================
755 // T2CON Bits
757 extern __at(0x001C) __sfr T2CON;
759 typedef union
761 struct
763 unsigned T2CKPS0 : 1;
764 unsigned T2CKPS1 : 1;
765 unsigned TMR2ON : 1;
766 unsigned T2OUTPS0 : 1;
767 unsigned T2OUTPS1 : 1;
768 unsigned T2OUTPS2 : 1;
769 unsigned T2OUTPS3 : 1;
770 unsigned : 1;
773 struct
775 unsigned T2CKPS : 2;
776 unsigned : 6;
779 struct
781 unsigned : 3;
782 unsigned T2OUTPS : 4;
783 unsigned : 1;
785 } __T2CONbits_t;
787 extern __at(0x001C) volatile __T2CONbits_t T2CONbits;
789 #define _T2CKPS0 0x01
790 #define _T2CKPS1 0x02
791 #define _TMR2ON 0x04
792 #define _T2OUTPS0 0x08
793 #define _T2OUTPS1 0x10
794 #define _T2OUTPS2 0x20
795 #define _T2OUTPS3 0x40
797 //==============================================================================
800 //==============================================================================
801 // CPSCON0 Bits
803 extern __at(0x001E) __sfr CPSCON0;
805 typedef union
807 struct
809 unsigned T0XCS : 1;
810 unsigned CPSOUT : 1;
811 unsigned CPSRNG0 : 1;
812 unsigned CPSRNG1 : 1;
813 unsigned : 1;
814 unsigned : 1;
815 unsigned CPSRM : 1;
816 unsigned CPSON : 1;
819 struct
821 unsigned : 2;
822 unsigned CPSRNG : 2;
823 unsigned : 4;
825 } __CPSCON0bits_t;
827 extern __at(0x001E) volatile __CPSCON0bits_t CPSCON0bits;
829 #define _T0XCS 0x01
830 #define _CPSOUT 0x02
831 #define _CPSRNG0 0x04
832 #define _CPSRNG1 0x08
833 #define _CPSRM 0x40
834 #define _CPSON 0x80
836 //==============================================================================
839 //==============================================================================
840 // CPSCON1 Bits
842 extern __at(0x001F) __sfr CPSCON1;
844 typedef union
846 struct
848 unsigned CPSCH0 : 1;
849 unsigned CPSCH1 : 1;
850 unsigned CPSCH2 : 1;
851 unsigned CPSCH3 : 1;
852 unsigned : 1;
853 unsigned : 1;
854 unsigned : 1;
855 unsigned : 1;
858 struct
860 unsigned CPSCH : 4;
861 unsigned : 4;
863 } __CPSCON1bits_t;
865 extern __at(0x001F) volatile __CPSCON1bits_t CPSCON1bits;
867 #define _CPSCH0 0x01
868 #define _CPSCH1 0x02
869 #define _CPSCH2 0x04
870 #define _CPSCH3 0x08
872 //==============================================================================
875 //==============================================================================
876 // TRISA Bits
878 extern __at(0x008C) __sfr TRISA;
880 typedef union
882 struct
884 unsigned TRISA0 : 1;
885 unsigned TRISA1 : 1;
886 unsigned TRISA2 : 1;
887 unsigned TRISA3 : 1;
888 unsigned TRISA4 : 1;
889 unsigned TRISA5 : 1;
890 unsigned : 1;
891 unsigned : 1;
894 struct
896 unsigned TRISA : 6;
897 unsigned : 2;
899 } __TRISAbits_t;
901 extern __at(0x008C) volatile __TRISAbits_t TRISAbits;
903 #define _TRISA0 0x01
904 #define _TRISA1 0x02
905 #define _TRISA2 0x04
906 #define _TRISA3 0x08
907 #define _TRISA4 0x10
908 #define _TRISA5 0x20
910 //==============================================================================
913 //==============================================================================
914 // TRISC Bits
916 extern __at(0x008E) __sfr TRISC;
918 typedef union
920 struct
922 unsigned TRISC0 : 1;
923 unsigned TRISC1 : 1;
924 unsigned TRISC2 : 1;
925 unsigned TRISC3 : 1;
926 unsigned TRISC4 : 1;
927 unsigned TRISC5 : 1;
928 unsigned : 1;
929 unsigned : 1;
932 struct
934 unsigned TRISC : 6;
935 unsigned : 2;
937 } __TRISCbits_t;
939 extern __at(0x008E) volatile __TRISCbits_t TRISCbits;
941 #define _TRISC0 0x01
942 #define _TRISC1 0x02
943 #define _TRISC2 0x04
944 #define _TRISC3 0x08
945 #define _TRISC4 0x10
946 #define _TRISC5 0x20
948 //==============================================================================
951 //==============================================================================
952 // PIE1 Bits
954 extern __at(0x0091) __sfr PIE1;
956 typedef struct
958 unsigned TMR1IE : 1;
959 unsigned TMR2IE : 1;
960 unsigned CCP1IE : 1;
961 unsigned SSP1IE : 1;
962 unsigned TXIE : 1;
963 unsigned RCIE : 1;
964 unsigned ADIE : 1;
965 unsigned TMR1GIE : 1;
966 } __PIE1bits_t;
968 extern __at(0x0091) volatile __PIE1bits_t PIE1bits;
970 #define _TMR1IE 0x01
971 #define _TMR2IE 0x02
972 #define _CCP1IE 0x04
973 #define _SSP1IE 0x08
974 #define _TXIE 0x10
975 #define _RCIE 0x20
976 #define _ADIE 0x40
977 #define _TMR1GIE 0x80
979 //==============================================================================
982 //==============================================================================
983 // PIE2 Bits
985 extern __at(0x0092) __sfr PIE2;
987 typedef struct
989 unsigned : 1;
990 unsigned : 1;
991 unsigned : 1;
992 unsigned BCL1IE : 1;
993 unsigned EEIE : 1;
994 unsigned C1IE : 1;
995 unsigned C2IE : 1;
996 unsigned OSFIE : 1;
997 } __PIE2bits_t;
999 extern __at(0x0092) volatile __PIE2bits_t PIE2bits;
1001 #define _BCL1IE 0x08
1002 #define _EEIE 0x10
1003 #define _C1IE 0x20
1004 #define _C2IE 0x40
1005 #define _OSFIE 0x80
1007 //==============================================================================
1010 //==============================================================================
1011 // OPTION_REG Bits
1013 extern __at(0x0095) __sfr OPTION_REG;
1015 typedef union
1017 struct
1019 unsigned PS0 : 1;
1020 unsigned PS1 : 1;
1021 unsigned PS2 : 1;
1022 unsigned PSA : 1;
1023 unsigned TMR0SE : 1;
1024 unsigned TMR0CS : 1;
1025 unsigned INTEDG : 1;
1026 unsigned NOT_WPUEN : 1;
1029 struct
1031 unsigned : 1;
1032 unsigned : 1;
1033 unsigned : 1;
1034 unsigned : 1;
1035 unsigned T0SE : 1;
1036 unsigned T0CS : 1;
1037 unsigned : 1;
1038 unsigned : 1;
1041 struct
1043 unsigned PS : 3;
1044 unsigned : 5;
1046 } __OPTION_REGbits_t;
1048 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits;
1050 #define _PS0 0x01
1051 #define _PS1 0x02
1052 #define _PS2 0x04
1053 #define _PSA 0x08
1054 #define _TMR0SE 0x10
1055 #define _T0SE 0x10
1056 #define _TMR0CS 0x20
1057 #define _T0CS 0x20
1058 #define _INTEDG 0x40
1059 #define _NOT_WPUEN 0x80
1061 //==============================================================================
1064 //==============================================================================
1065 // PCON Bits
1067 extern __at(0x0096) __sfr PCON;
1069 typedef struct
1071 unsigned NOT_BOR : 1;
1072 unsigned NOT_POR : 1;
1073 unsigned NOT_RI : 1;
1074 unsigned NOT_RMCLR : 1;
1075 unsigned : 1;
1076 unsigned : 1;
1077 unsigned STKUNF : 1;
1078 unsigned STKOVF : 1;
1079 } __PCONbits_t;
1081 extern __at(0x0096) volatile __PCONbits_t PCONbits;
1083 #define _NOT_BOR 0x01
1084 #define _NOT_POR 0x02
1085 #define _NOT_RI 0x04
1086 #define _NOT_RMCLR 0x08
1087 #define _STKUNF 0x40
1088 #define _STKOVF 0x80
1090 //==============================================================================
1093 //==============================================================================
1094 // WDTCON Bits
1096 extern __at(0x0097) __sfr WDTCON;
1098 typedef union
1100 struct
1102 unsigned SWDTEN : 1;
1103 unsigned WDTPS0 : 1;
1104 unsigned WDTPS1 : 1;
1105 unsigned WDTPS2 : 1;
1106 unsigned WDTPS3 : 1;
1107 unsigned WDTPS4 : 1;
1108 unsigned : 1;
1109 unsigned : 1;
1112 struct
1114 unsigned : 1;
1115 unsigned WDTPS : 5;
1116 unsigned : 2;
1118 } __WDTCONbits_t;
1120 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
1122 #define _SWDTEN 0x01
1123 #define _WDTPS0 0x02
1124 #define _WDTPS1 0x04
1125 #define _WDTPS2 0x08
1126 #define _WDTPS3 0x10
1127 #define _WDTPS4 0x20
1129 //==============================================================================
1132 //==============================================================================
1133 // OSCTUNE Bits
1135 extern __at(0x0098) __sfr OSCTUNE;
1137 typedef union
1139 struct
1141 unsigned TUN0 : 1;
1142 unsigned TUN1 : 1;
1143 unsigned TUN2 : 1;
1144 unsigned TUN3 : 1;
1145 unsigned TUN4 : 1;
1146 unsigned TUN5 : 1;
1147 unsigned : 1;
1148 unsigned : 1;
1151 struct
1153 unsigned TUN : 6;
1154 unsigned : 2;
1156 } __OSCTUNEbits_t;
1158 extern __at(0x0098) volatile __OSCTUNEbits_t OSCTUNEbits;
1160 #define _TUN0 0x01
1161 #define _TUN1 0x02
1162 #define _TUN2 0x04
1163 #define _TUN3 0x08
1164 #define _TUN4 0x10
1165 #define _TUN5 0x20
1167 //==============================================================================
1170 //==============================================================================
1171 // OSCCON Bits
1173 extern __at(0x0099) __sfr OSCCON;
1175 typedef union
1177 struct
1179 unsigned SCS0 : 1;
1180 unsigned SCS1 : 1;
1181 unsigned : 1;
1182 unsigned IRCF0 : 1;
1183 unsigned IRCF1 : 1;
1184 unsigned IRCF2 : 1;
1185 unsigned IRCF3 : 1;
1186 unsigned SPLLEN : 1;
1189 struct
1191 unsigned SCS : 2;
1192 unsigned : 6;
1195 struct
1197 unsigned : 3;
1198 unsigned IRCF : 4;
1199 unsigned : 1;
1201 } __OSCCONbits_t;
1203 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits;
1205 #define _SCS0 0x01
1206 #define _SCS1 0x02
1207 #define _IRCF0 0x08
1208 #define _IRCF1 0x10
1209 #define _IRCF2 0x20
1210 #define _IRCF3 0x40
1211 #define _SPLLEN 0x80
1213 //==============================================================================
1216 //==============================================================================
1217 // OSCSTAT Bits
1219 extern __at(0x009A) __sfr OSCSTAT;
1221 typedef struct
1223 unsigned HFIOFS : 1;
1224 unsigned LFIOFR : 1;
1225 unsigned MFIOFR : 1;
1226 unsigned HFIOFL : 1;
1227 unsigned HFIOFR : 1;
1228 unsigned OSTS : 1;
1229 unsigned PLLR : 1;
1230 unsigned T1OSCR : 1;
1231 } __OSCSTATbits_t;
1233 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits;
1235 #define _HFIOFS 0x01
1236 #define _LFIOFR 0x02
1237 #define _MFIOFR 0x04
1238 #define _HFIOFL 0x08
1239 #define _HFIOFR 0x10
1240 #define _OSTS 0x20
1241 #define _PLLR 0x40
1242 #define _T1OSCR 0x80
1244 //==============================================================================
1246 extern __at(0x009B) __sfr ADRES;
1247 extern __at(0x009B) __sfr ADRESL;
1248 extern __at(0x009C) __sfr ADRESH;
1250 //==============================================================================
1251 // ADCON0 Bits
1253 extern __at(0x009D) __sfr ADCON0;
1255 typedef union
1257 struct
1259 unsigned ADON : 1;
1260 unsigned GO_NOT_DONE : 1;
1261 unsigned CHS0 : 1;
1262 unsigned CHS1 : 1;
1263 unsigned CHS2 : 1;
1264 unsigned CHS3 : 1;
1265 unsigned CHS4 : 1;
1266 unsigned : 1;
1269 struct
1271 unsigned : 1;
1272 unsigned ADGO : 1;
1273 unsigned : 1;
1274 unsigned : 1;
1275 unsigned : 1;
1276 unsigned : 1;
1277 unsigned : 1;
1278 unsigned : 1;
1281 struct
1283 unsigned : 1;
1284 unsigned GO : 1;
1285 unsigned : 1;
1286 unsigned : 1;
1287 unsigned : 1;
1288 unsigned : 1;
1289 unsigned : 1;
1290 unsigned : 1;
1293 struct
1295 unsigned : 1;
1296 unsigned NOT_DONE : 1;
1297 unsigned : 1;
1298 unsigned : 1;
1299 unsigned : 1;
1300 unsigned : 1;
1301 unsigned : 1;
1302 unsigned : 1;
1305 struct
1307 unsigned : 2;
1308 unsigned CHS : 5;
1309 unsigned : 1;
1311 } __ADCON0bits_t;
1313 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits;
1315 #define _ADON 0x01
1316 #define _GO_NOT_DONE 0x02
1317 #define _ADGO 0x02
1318 #define _GO 0x02
1319 #define _NOT_DONE 0x02
1320 #define _CHS0 0x04
1321 #define _CHS1 0x08
1322 #define _CHS2 0x10
1323 #define _CHS3 0x20
1324 #define _CHS4 0x40
1326 //==============================================================================
1329 //==============================================================================
1330 // ADCON1 Bits
1332 extern __at(0x009E) __sfr ADCON1;
1334 typedef union
1336 struct
1338 unsigned ADPREF0 : 1;
1339 unsigned ADPREF1 : 1;
1340 unsigned : 1;
1341 unsigned : 1;
1342 unsigned ADCS0 : 1;
1343 unsigned ADCS1 : 1;
1344 unsigned ADCS2 : 1;
1345 unsigned ADFM : 1;
1348 struct
1350 unsigned ADPREF : 2;
1351 unsigned : 6;
1354 struct
1356 unsigned : 4;
1357 unsigned ADCS : 3;
1358 unsigned : 1;
1360 } __ADCON1bits_t;
1362 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits;
1364 #define _ADPREF0 0x01
1365 #define _ADPREF1 0x02
1366 #define _ADCS0 0x10
1367 #define _ADCS1 0x20
1368 #define _ADCS2 0x40
1369 #define _ADFM 0x80
1371 //==============================================================================
1374 //==============================================================================
1375 // LATA Bits
1377 extern __at(0x010C) __sfr LATA;
1379 typedef struct
1381 unsigned LATA0 : 1;
1382 unsigned LATA1 : 1;
1383 unsigned LATA2 : 1;
1384 unsigned : 1;
1385 unsigned LATA4 : 1;
1386 unsigned LATA5 : 1;
1387 unsigned : 1;
1388 unsigned : 1;
1389 } __LATAbits_t;
1391 extern __at(0x010C) volatile __LATAbits_t LATAbits;
1393 #define _LATA0 0x01
1394 #define _LATA1 0x02
1395 #define _LATA2 0x04
1396 #define _LATA4 0x10
1397 #define _LATA5 0x20
1399 //==============================================================================
1402 //==============================================================================
1403 // LATC Bits
1405 extern __at(0x010E) __sfr LATC;
1407 typedef union
1409 struct
1411 unsigned LATC0 : 1;
1412 unsigned LATC1 : 1;
1413 unsigned LATC2 : 1;
1414 unsigned LATC3 : 1;
1415 unsigned LATC4 : 1;
1416 unsigned LATC5 : 1;
1417 unsigned : 1;
1418 unsigned : 1;
1421 struct
1423 unsigned LATC : 6;
1424 unsigned : 2;
1426 } __LATCbits_t;
1428 extern __at(0x010E) volatile __LATCbits_t LATCbits;
1430 #define _LATC0 0x01
1431 #define _LATC1 0x02
1432 #define _LATC2 0x04
1433 #define _LATC3 0x08
1434 #define _LATC4 0x10
1435 #define _LATC5 0x20
1437 //==============================================================================
1440 //==============================================================================
1441 // CM1CON0 Bits
1443 extern __at(0x0111) __sfr CM1CON0;
1445 typedef struct
1447 unsigned C1SYNC : 1;
1448 unsigned C1HYS : 1;
1449 unsigned C1SP : 1;
1450 unsigned : 1;
1451 unsigned C1POL : 1;
1452 unsigned C1OE : 1;
1453 unsigned C1OUT : 1;
1454 unsigned C1ON : 1;
1455 } __CM1CON0bits_t;
1457 extern __at(0x0111) volatile __CM1CON0bits_t CM1CON0bits;
1459 #define _C1SYNC 0x01
1460 #define _C1HYS 0x02
1461 #define _C1SP 0x04
1462 #define _C1POL 0x10
1463 #define _C1OE 0x20
1464 #define _C1OUT 0x40
1465 #define _C1ON 0x80
1467 //==============================================================================
1470 //==============================================================================
1471 // CM1CON1 Bits
1473 extern __at(0x0112) __sfr CM1CON1;
1475 typedef union
1477 struct
1479 unsigned C1NCH0 : 1;
1480 unsigned C1NCH1 : 1;
1481 unsigned : 1;
1482 unsigned : 1;
1483 unsigned C1PCH0 : 1;
1484 unsigned C1PCH1 : 1;
1485 unsigned C1INTN : 1;
1486 unsigned C1INTP : 1;
1489 struct
1491 unsigned C1NCH : 2;
1492 unsigned : 6;
1495 struct
1497 unsigned : 4;
1498 unsigned C1PCH : 2;
1499 unsigned : 2;
1501 } __CM1CON1bits_t;
1503 extern __at(0x0112) volatile __CM1CON1bits_t CM1CON1bits;
1505 #define _C1NCH0 0x01
1506 #define _C1NCH1 0x02
1507 #define _C1PCH0 0x10
1508 #define _C1PCH1 0x20
1509 #define _C1INTN 0x40
1510 #define _C1INTP 0x80
1512 //==============================================================================
1515 //==============================================================================
1516 // CM2CON0 Bits
1518 extern __at(0x0113) __sfr CM2CON0;
1520 typedef struct
1522 unsigned C2SYNC : 1;
1523 unsigned C2HYS : 1;
1524 unsigned C2SP : 1;
1525 unsigned : 1;
1526 unsigned C2POL : 1;
1527 unsigned C2OE : 1;
1528 unsigned C2OUT : 1;
1529 unsigned C2ON : 1;
1530 } __CM2CON0bits_t;
1532 extern __at(0x0113) volatile __CM2CON0bits_t CM2CON0bits;
1534 #define _C2SYNC 0x01
1535 #define _C2HYS 0x02
1536 #define _C2SP 0x04
1537 #define _C2POL 0x10
1538 #define _C2OE 0x20
1539 #define _C2OUT 0x40
1540 #define _C2ON 0x80
1542 //==============================================================================
1545 //==============================================================================
1546 // CM2CON1 Bits
1548 extern __at(0x0114) __sfr CM2CON1;
1550 typedef union
1552 struct
1554 unsigned C2NCH0 : 1;
1555 unsigned C2NCH1 : 1;
1556 unsigned : 1;
1557 unsigned : 1;
1558 unsigned C2PCH0 : 1;
1559 unsigned C2PCH1 : 1;
1560 unsigned C2INTN : 1;
1561 unsigned C2INTP : 1;
1564 struct
1566 unsigned C2NCH : 2;
1567 unsigned : 6;
1570 struct
1572 unsigned : 4;
1573 unsigned C2PCH : 2;
1574 unsigned : 2;
1576 } __CM2CON1bits_t;
1578 extern __at(0x0114) volatile __CM2CON1bits_t CM2CON1bits;
1580 #define _C2NCH0 0x01
1581 #define _C2NCH1 0x02
1582 #define _C2PCH0 0x10
1583 #define _C2PCH1 0x20
1584 #define _C2INTN 0x40
1585 #define _C2INTP 0x80
1587 //==============================================================================
1590 //==============================================================================
1591 // CMOUT Bits
1593 extern __at(0x0115) __sfr CMOUT;
1595 typedef struct
1597 unsigned MC1OUT : 1;
1598 unsigned MC2OUT : 1;
1599 unsigned : 1;
1600 unsigned : 1;
1601 unsigned : 1;
1602 unsigned : 1;
1603 unsigned : 1;
1604 unsigned : 1;
1605 } __CMOUTbits_t;
1607 extern __at(0x0115) volatile __CMOUTbits_t CMOUTbits;
1609 #define _MC1OUT 0x01
1610 #define _MC2OUT 0x02
1612 //==============================================================================
1615 //==============================================================================
1616 // BORCON Bits
1618 extern __at(0x0116) __sfr BORCON;
1620 typedef struct
1622 unsigned BORRDY : 1;
1623 unsigned : 1;
1624 unsigned : 1;
1625 unsigned : 1;
1626 unsigned : 1;
1627 unsigned : 1;
1628 unsigned : 1;
1629 unsigned SBOREN : 1;
1630 } __BORCONbits_t;
1632 extern __at(0x0116) volatile __BORCONbits_t BORCONbits;
1634 #define _BORRDY 0x01
1635 #define _SBOREN 0x80
1637 //==============================================================================
1640 //==============================================================================
1641 // FVRCON Bits
1643 extern __at(0x0117) __sfr FVRCON;
1645 typedef union
1647 struct
1649 unsigned ADFVR0 : 1;
1650 unsigned ADFVR1 : 1;
1651 unsigned CDAFVR0 : 1;
1652 unsigned CDAFVR1 : 1;
1653 unsigned TSRNG : 1;
1654 unsigned TSEN : 1;
1655 unsigned FVRRDY : 1;
1656 unsigned FVREN : 1;
1659 struct
1661 unsigned ADFVR : 2;
1662 unsigned : 6;
1665 struct
1667 unsigned : 2;
1668 unsigned CDAFVR : 2;
1669 unsigned : 4;
1671 } __FVRCONbits_t;
1673 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits;
1675 #define _ADFVR0 0x01
1676 #define _ADFVR1 0x02
1677 #define _CDAFVR0 0x04
1678 #define _CDAFVR1 0x08
1679 #define _TSRNG 0x10
1680 #define _TSEN 0x20
1681 #define _FVRRDY 0x40
1682 #define _FVREN 0x80
1684 //==============================================================================
1687 //==============================================================================
1688 // DACCON0 Bits
1690 extern __at(0x0118) __sfr DACCON0;
1692 typedef union
1694 struct
1696 unsigned : 1;
1697 unsigned : 1;
1698 unsigned DACPSS0 : 1;
1699 unsigned DACPSS1 : 1;
1700 unsigned : 1;
1701 unsigned DACOE : 1;
1702 unsigned DACLPS : 1;
1703 unsigned DACEN : 1;
1706 struct
1708 unsigned : 2;
1709 unsigned DACPSS : 2;
1710 unsigned : 4;
1712 } __DACCON0bits_t;
1714 extern __at(0x0118) volatile __DACCON0bits_t DACCON0bits;
1716 #define _DACPSS0 0x04
1717 #define _DACPSS1 0x08
1718 #define _DACOE 0x20
1719 #define _DACLPS 0x40
1720 #define _DACEN 0x80
1722 //==============================================================================
1725 //==============================================================================
1726 // DACCON1 Bits
1728 extern __at(0x0119) __sfr DACCON1;
1730 typedef union
1732 struct
1734 unsigned DACR0 : 1;
1735 unsigned DACR1 : 1;
1736 unsigned DACR2 : 1;
1737 unsigned DACR3 : 1;
1738 unsigned DACR4 : 1;
1739 unsigned : 1;
1740 unsigned : 1;
1741 unsigned : 1;
1744 struct
1746 unsigned DACR : 5;
1747 unsigned : 3;
1749 } __DACCON1bits_t;
1751 extern __at(0x0119) volatile __DACCON1bits_t DACCON1bits;
1753 #define _DACR0 0x01
1754 #define _DACR1 0x02
1755 #define _DACR2 0x04
1756 #define _DACR3 0x08
1757 #define _DACR4 0x10
1759 //==============================================================================
1762 //==============================================================================
1763 // SRCON0 Bits
1765 extern __at(0x011A) __sfr SRCON0;
1767 typedef union
1769 struct
1771 unsigned SRPR : 1;
1772 unsigned SRPS : 1;
1773 unsigned SRNQEN : 1;
1774 unsigned SRQEN : 1;
1775 unsigned SRCLK0 : 1;
1776 unsigned SRCLK1 : 1;
1777 unsigned SRCLK2 : 1;
1778 unsigned SRLEN : 1;
1781 struct
1783 unsigned : 4;
1784 unsigned SRCLK : 3;
1785 unsigned : 1;
1787 } __SRCON0bits_t;
1789 extern __at(0x011A) volatile __SRCON0bits_t SRCON0bits;
1791 #define _SRPR 0x01
1792 #define _SRPS 0x02
1793 #define _SRNQEN 0x04
1794 #define _SRQEN 0x08
1795 #define _SRCLK0 0x10
1796 #define _SRCLK1 0x20
1797 #define _SRCLK2 0x40
1798 #define _SRLEN 0x80
1800 //==============================================================================
1803 //==============================================================================
1804 // SRCON1 Bits
1806 extern __at(0x011B) __sfr SRCON1;
1808 typedef struct
1810 unsigned SRRC1E : 1;
1811 unsigned SRRC2E : 1;
1812 unsigned SRRCKE : 1;
1813 unsigned SRRPE : 1;
1814 unsigned SRSC1E : 1;
1815 unsigned SRSC2E : 1;
1816 unsigned SRSCKE : 1;
1817 unsigned SRSPE : 1;
1818 } __SRCON1bits_t;
1820 extern __at(0x011B) volatile __SRCON1bits_t SRCON1bits;
1822 #define _SRRC1E 0x01
1823 #define _SRRC2E 0x02
1824 #define _SRRCKE 0x04
1825 #define _SRRPE 0x08
1826 #define _SRSC1E 0x10
1827 #define _SRSC2E 0x20
1828 #define _SRSCKE 0x40
1829 #define _SRSPE 0x80
1831 //==============================================================================
1834 //==============================================================================
1835 // APFCON Bits
1837 extern __at(0x011D) __sfr APFCON;
1839 typedef union
1841 struct
1843 unsigned : 1;
1844 unsigned : 1;
1845 unsigned TXCKSEL : 1;
1846 unsigned T1GSEL : 1;
1847 unsigned : 1;
1848 unsigned SSSEL : 1;
1849 unsigned SDOSEL : 1;
1850 unsigned RXDTSEL : 1;
1853 struct
1855 unsigned : 1;
1856 unsigned : 1;
1857 unsigned : 1;
1858 unsigned : 1;
1859 unsigned : 1;
1860 unsigned SS1SEL : 1;
1861 unsigned SDO1SEL : 1;
1862 unsigned : 1;
1864 } __APFCONbits_t;
1866 extern __at(0x011D) volatile __APFCONbits_t APFCONbits;
1868 #define _TXCKSEL 0x04
1869 #define _T1GSEL 0x08
1870 #define _SSSEL 0x20
1871 #define _SS1SEL 0x20
1872 #define _SDOSEL 0x40
1873 #define _SDO1SEL 0x40
1874 #define _RXDTSEL 0x80
1876 //==============================================================================
1879 //==============================================================================
1880 // APFCON0 Bits
1882 extern __at(0x011D) __sfr APFCON0;
1884 typedef union
1886 struct
1888 unsigned : 1;
1889 unsigned : 1;
1890 unsigned TXCKSEL : 1;
1891 unsigned T1GSEL : 1;
1892 unsigned : 1;
1893 unsigned SSSEL : 1;
1894 unsigned SDOSEL : 1;
1895 unsigned RXDTSEL : 1;
1898 struct
1900 unsigned : 1;
1901 unsigned : 1;
1902 unsigned : 1;
1903 unsigned : 1;
1904 unsigned : 1;
1905 unsigned SS1SEL : 1;
1906 unsigned SDO1SEL : 1;
1907 unsigned : 1;
1909 } __APFCON0bits_t;
1911 extern __at(0x011D) volatile __APFCON0bits_t APFCON0bits;
1913 #define _APFCON0_TXCKSEL 0x04
1914 #define _APFCON0_T1GSEL 0x08
1915 #define _APFCON0_SSSEL 0x20
1916 #define _APFCON0_SS1SEL 0x20
1917 #define _APFCON0_SDOSEL 0x40
1918 #define _APFCON0_SDO1SEL 0x40
1919 #define _APFCON0_RXDTSEL 0x80
1921 //==============================================================================
1924 //==============================================================================
1925 // ANSELA Bits
1927 extern __at(0x018C) __sfr ANSELA;
1929 typedef struct
1931 unsigned ANSA0 : 1;
1932 unsigned ANSA1 : 1;
1933 unsigned ANSA2 : 1;
1934 unsigned : 1;
1935 unsigned ANSA4 : 1;
1936 unsigned : 1;
1937 unsigned : 1;
1938 unsigned : 1;
1939 } __ANSELAbits_t;
1941 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits;
1943 #define _ANSA0 0x01
1944 #define _ANSA1 0x02
1945 #define _ANSA2 0x04
1946 #define _ANSA4 0x10
1948 //==============================================================================
1951 //==============================================================================
1952 // ANSELC Bits
1954 extern __at(0x018E) __sfr ANSELC;
1956 typedef union
1958 struct
1960 unsigned ANSC0 : 1;
1961 unsigned ANSC1 : 1;
1962 unsigned ANSC2 : 1;
1963 unsigned ANSC3 : 1;
1964 unsigned : 1;
1965 unsigned : 1;
1966 unsigned : 1;
1967 unsigned : 1;
1970 struct
1972 unsigned ANSC : 4;
1973 unsigned : 4;
1975 } __ANSELCbits_t;
1977 extern __at(0x018E) volatile __ANSELCbits_t ANSELCbits;
1979 #define _ANSC0 0x01
1980 #define _ANSC1 0x02
1981 #define _ANSC2 0x04
1982 #define _ANSC3 0x08
1984 //==============================================================================
1986 extern __at(0x0191) __sfr EEADR;
1987 extern __at(0x0191) __sfr EEADRL;
1988 extern __at(0x0192) __sfr EEADRH;
1989 extern __at(0x0193) __sfr EEDAT;
1990 extern __at(0x0193) __sfr EEDATL;
1991 extern __at(0x0194) __sfr EEDATH;
1993 //==============================================================================
1994 // EECON1 Bits
1996 extern __at(0x0195) __sfr EECON1;
1998 typedef struct
2000 unsigned RD : 1;
2001 unsigned WR : 1;
2002 unsigned WREN : 1;
2003 unsigned WRERR : 1;
2004 unsigned FREE : 1;
2005 unsigned LWLO : 1;
2006 unsigned CFGS : 1;
2007 unsigned EEPGD : 1;
2008 } __EECON1bits_t;
2010 extern __at(0x0195) volatile __EECON1bits_t EECON1bits;
2012 #define _RD 0x01
2013 #define _WR 0x02
2014 #define _WREN 0x04
2015 #define _WRERR 0x08
2016 #define _FREE 0x10
2017 #define _LWLO 0x20
2018 #define _CFGS 0x40
2019 #define _EEPGD 0x80
2021 //==============================================================================
2023 extern __at(0x0196) __sfr EECON2;
2024 extern __at(0x0199) __sfr RCREG;
2025 extern __at(0x019A) __sfr TXREG;
2026 extern __at(0x019B) __sfr SP1BRG;
2027 extern __at(0x019B) __sfr SP1BRGL;
2028 extern __at(0x019B) __sfr SPBRG;
2029 extern __at(0x019B) __sfr SPBRGL;
2030 extern __at(0x019C) __sfr SP1BRGH;
2031 extern __at(0x019C) __sfr SPBRGH;
2033 //==============================================================================
2034 // RCSTA Bits
2036 extern __at(0x019D) __sfr RCSTA;
2038 typedef struct
2040 unsigned RX9D : 1;
2041 unsigned OERR : 1;
2042 unsigned FERR : 1;
2043 unsigned ADDEN : 1;
2044 unsigned CREN : 1;
2045 unsigned SREN : 1;
2046 unsigned RX9 : 1;
2047 unsigned SPEN : 1;
2048 } __RCSTAbits_t;
2050 extern __at(0x019D) volatile __RCSTAbits_t RCSTAbits;
2052 #define _RX9D 0x01
2053 #define _OERR 0x02
2054 #define _FERR 0x04
2055 #define _ADDEN 0x08
2056 #define _CREN 0x10
2057 #define _SREN 0x20
2058 #define _RX9 0x40
2059 #define _SPEN 0x80
2061 //==============================================================================
2064 //==============================================================================
2065 // TXSTA Bits
2067 extern __at(0x019E) __sfr TXSTA;
2069 typedef struct
2071 unsigned TX9D : 1;
2072 unsigned TRMT : 1;
2073 unsigned BRGH : 1;
2074 unsigned SENDB : 1;
2075 unsigned SYNC : 1;
2076 unsigned TXEN : 1;
2077 unsigned TX9 : 1;
2078 unsigned CSRC : 1;
2079 } __TXSTAbits_t;
2081 extern __at(0x019E) volatile __TXSTAbits_t TXSTAbits;
2083 #define _TX9D 0x01
2084 #define _TRMT 0x02
2085 #define _BRGH 0x04
2086 #define _SENDB 0x08
2087 #define _SYNC 0x10
2088 #define _TXEN 0x20
2089 #define _TX9 0x40
2090 #define _CSRC 0x80
2092 //==============================================================================
2095 //==============================================================================
2096 // BAUDCON Bits
2098 extern __at(0x019F) __sfr BAUDCON;
2100 typedef struct
2102 unsigned ABDEN : 1;
2103 unsigned WUE : 1;
2104 unsigned : 1;
2105 unsigned BRG16 : 1;
2106 unsigned SCKP : 1;
2107 unsigned : 1;
2108 unsigned RCIDL : 1;
2109 unsigned ABDOVF : 1;
2110 } __BAUDCONbits_t;
2112 extern __at(0x019F) volatile __BAUDCONbits_t BAUDCONbits;
2114 #define _ABDEN 0x01
2115 #define _WUE 0x02
2116 #define _BRG16 0x08
2117 #define _SCKP 0x10
2118 #define _RCIDL 0x40
2119 #define _ABDOVF 0x80
2121 //==============================================================================
2124 //==============================================================================
2125 // WPUA Bits
2127 extern __at(0x020C) __sfr WPUA;
2129 typedef union
2131 struct
2133 unsigned WPUA0 : 1;
2134 unsigned WPUA1 : 1;
2135 unsigned WPUA2 : 1;
2136 unsigned WPUA3 : 1;
2137 unsigned WPUA4 : 1;
2138 unsigned WPUA5 : 1;
2139 unsigned : 1;
2140 unsigned : 1;
2143 struct
2145 unsigned WPUA : 6;
2146 unsigned : 2;
2148 } __WPUAbits_t;
2150 extern __at(0x020C) volatile __WPUAbits_t WPUAbits;
2152 #define _WPUA0 0x01
2153 #define _WPUA1 0x02
2154 #define _WPUA2 0x04
2155 #define _WPUA3 0x08
2156 #define _WPUA4 0x10
2157 #define _WPUA5 0x20
2159 //==============================================================================
2162 //==============================================================================
2163 // WPUC Bits
2165 extern __at(0x020E) __sfr WPUC;
2167 typedef union
2169 struct
2171 unsigned WPUC0 : 1;
2172 unsigned WPUC1 : 1;
2173 unsigned WPUC2 : 1;
2174 unsigned WPUC3 : 1;
2175 unsigned WPUC4 : 1;
2176 unsigned WPUC5 : 1;
2177 unsigned : 1;
2178 unsigned : 1;
2181 struct
2183 unsigned WPUC : 6;
2184 unsigned : 2;
2186 } __WPUCbits_t;
2188 extern __at(0x020E) volatile __WPUCbits_t WPUCbits;
2190 #define _WPUC0 0x01
2191 #define _WPUC1 0x02
2192 #define _WPUC2 0x04
2193 #define _WPUC3 0x08
2194 #define _WPUC4 0x10
2195 #define _WPUC5 0x20
2197 //==============================================================================
2199 extern __at(0x0211) __sfr SSP1BUF;
2200 extern __at(0x0211) __sfr SSPBUF;
2201 extern __at(0x0212) __sfr SSP1ADD;
2202 extern __at(0x0212) __sfr SSPADD;
2203 extern __at(0x0213) __sfr SSP1MSK;
2204 extern __at(0x0213) __sfr SSPMSK;
2206 //==============================================================================
2207 // SSP1STAT Bits
2209 extern __at(0x0214) __sfr SSP1STAT;
2211 typedef struct
2213 unsigned BF : 1;
2214 unsigned UA : 1;
2215 unsigned R_NOT_W : 1;
2216 unsigned S : 1;
2217 unsigned P : 1;
2218 unsigned D_NOT_A : 1;
2219 unsigned CKE : 1;
2220 unsigned SMP : 1;
2221 } __SSP1STATbits_t;
2223 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits;
2225 #define _BF 0x01
2226 #define _UA 0x02
2227 #define _R_NOT_W 0x04
2228 #define _S 0x08
2229 #define _P 0x10
2230 #define _D_NOT_A 0x20
2231 #define _CKE 0x40
2232 #define _SMP 0x80
2234 //==============================================================================
2237 //==============================================================================
2238 // SSPSTAT Bits
2240 extern __at(0x0214) __sfr SSPSTAT;
2242 typedef struct
2244 unsigned BF : 1;
2245 unsigned UA : 1;
2246 unsigned R_NOT_W : 1;
2247 unsigned S : 1;
2248 unsigned P : 1;
2249 unsigned D_NOT_A : 1;
2250 unsigned CKE : 1;
2251 unsigned SMP : 1;
2252 } __SSPSTATbits_t;
2254 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits;
2256 #define _SSPSTAT_BF 0x01
2257 #define _SSPSTAT_UA 0x02
2258 #define _SSPSTAT_R_NOT_W 0x04
2259 #define _SSPSTAT_S 0x08
2260 #define _SSPSTAT_P 0x10
2261 #define _SSPSTAT_D_NOT_A 0x20
2262 #define _SSPSTAT_CKE 0x40
2263 #define _SSPSTAT_SMP 0x80
2265 //==============================================================================
2268 //==============================================================================
2269 // SSP1CON1 Bits
2271 extern __at(0x0215) __sfr SSP1CON1;
2273 typedef union
2275 struct
2277 unsigned SSPM0 : 1;
2278 unsigned SSPM1 : 1;
2279 unsigned SSPM2 : 1;
2280 unsigned SSPM3 : 1;
2281 unsigned CKP : 1;
2282 unsigned SSPEN : 1;
2283 unsigned SSPOV : 1;
2284 unsigned WCOL : 1;
2287 struct
2289 unsigned SSPM : 4;
2290 unsigned : 4;
2292 } __SSP1CON1bits_t;
2294 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits;
2296 #define _SSPM0 0x01
2297 #define _SSPM1 0x02
2298 #define _SSPM2 0x04
2299 #define _SSPM3 0x08
2300 #define _CKP 0x10
2301 #define _SSPEN 0x20
2302 #define _SSPOV 0x40
2303 #define _WCOL 0x80
2305 //==============================================================================
2308 //==============================================================================
2309 // SSPCON Bits
2311 extern __at(0x0215) __sfr SSPCON;
2313 typedef union
2315 struct
2317 unsigned SSPM0 : 1;
2318 unsigned SSPM1 : 1;
2319 unsigned SSPM2 : 1;
2320 unsigned SSPM3 : 1;
2321 unsigned CKP : 1;
2322 unsigned SSPEN : 1;
2323 unsigned SSPOV : 1;
2324 unsigned WCOL : 1;
2327 struct
2329 unsigned SSPM : 4;
2330 unsigned : 4;
2332 } __SSPCONbits_t;
2334 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits;
2336 #define _SSPCON_SSPM0 0x01
2337 #define _SSPCON_SSPM1 0x02
2338 #define _SSPCON_SSPM2 0x04
2339 #define _SSPCON_SSPM3 0x08
2340 #define _SSPCON_CKP 0x10
2341 #define _SSPCON_SSPEN 0x20
2342 #define _SSPCON_SSPOV 0x40
2343 #define _SSPCON_WCOL 0x80
2345 //==============================================================================
2348 //==============================================================================
2349 // SSPCON1 Bits
2351 extern __at(0x0215) __sfr SSPCON1;
2353 typedef union
2355 struct
2357 unsigned SSPM0 : 1;
2358 unsigned SSPM1 : 1;
2359 unsigned SSPM2 : 1;
2360 unsigned SSPM3 : 1;
2361 unsigned CKP : 1;
2362 unsigned SSPEN : 1;
2363 unsigned SSPOV : 1;
2364 unsigned WCOL : 1;
2367 struct
2369 unsigned SSPM : 4;
2370 unsigned : 4;
2372 } __SSPCON1bits_t;
2374 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits;
2376 #define _SSPCON1_SSPM0 0x01
2377 #define _SSPCON1_SSPM1 0x02
2378 #define _SSPCON1_SSPM2 0x04
2379 #define _SSPCON1_SSPM3 0x08
2380 #define _SSPCON1_CKP 0x10
2381 #define _SSPCON1_SSPEN 0x20
2382 #define _SSPCON1_SSPOV 0x40
2383 #define _SSPCON1_WCOL 0x80
2385 //==============================================================================
2388 //==============================================================================
2389 // SSP1CON2 Bits
2391 extern __at(0x0216) __sfr SSP1CON2;
2393 typedef struct
2395 unsigned SEN : 1;
2396 unsigned RSEN : 1;
2397 unsigned PEN : 1;
2398 unsigned RCEN : 1;
2399 unsigned ACKEN : 1;
2400 unsigned ACKDT : 1;
2401 unsigned ACKSTAT : 1;
2402 unsigned GCEN : 1;
2403 } __SSP1CON2bits_t;
2405 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits;
2407 #define _SEN 0x01
2408 #define _RSEN 0x02
2409 #define _PEN 0x04
2410 #define _RCEN 0x08
2411 #define _ACKEN 0x10
2412 #define _ACKDT 0x20
2413 #define _ACKSTAT 0x40
2414 #define _GCEN 0x80
2416 //==============================================================================
2419 //==============================================================================
2420 // SSPCON2 Bits
2422 extern __at(0x0216) __sfr SSPCON2;
2424 typedef struct
2426 unsigned SEN : 1;
2427 unsigned RSEN : 1;
2428 unsigned PEN : 1;
2429 unsigned RCEN : 1;
2430 unsigned ACKEN : 1;
2431 unsigned ACKDT : 1;
2432 unsigned ACKSTAT : 1;
2433 unsigned GCEN : 1;
2434 } __SSPCON2bits_t;
2436 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits;
2438 #define _SSPCON2_SEN 0x01
2439 #define _SSPCON2_RSEN 0x02
2440 #define _SSPCON2_PEN 0x04
2441 #define _SSPCON2_RCEN 0x08
2442 #define _SSPCON2_ACKEN 0x10
2443 #define _SSPCON2_ACKDT 0x20
2444 #define _SSPCON2_ACKSTAT 0x40
2445 #define _SSPCON2_GCEN 0x80
2447 //==============================================================================
2450 //==============================================================================
2451 // SSP1CON3 Bits
2453 extern __at(0x0217) __sfr SSP1CON3;
2455 typedef struct
2457 unsigned DHEN : 1;
2458 unsigned AHEN : 1;
2459 unsigned SBCDE : 1;
2460 unsigned SDAHT : 1;
2461 unsigned BOEN : 1;
2462 unsigned SCIE : 1;
2463 unsigned PCIE : 1;
2464 unsigned ACKTIM : 1;
2465 } __SSP1CON3bits_t;
2467 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits;
2469 #define _DHEN 0x01
2470 #define _AHEN 0x02
2471 #define _SBCDE 0x04
2472 #define _SDAHT 0x08
2473 #define _BOEN 0x10
2474 #define _SCIE 0x20
2475 #define _PCIE 0x40
2476 #define _ACKTIM 0x80
2478 //==============================================================================
2481 //==============================================================================
2482 // SSPCON3 Bits
2484 extern __at(0x0217) __sfr SSPCON3;
2486 typedef struct
2488 unsigned DHEN : 1;
2489 unsigned AHEN : 1;
2490 unsigned SBCDE : 1;
2491 unsigned SDAHT : 1;
2492 unsigned BOEN : 1;
2493 unsigned SCIE : 1;
2494 unsigned PCIE : 1;
2495 unsigned ACKTIM : 1;
2496 } __SSPCON3bits_t;
2498 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits;
2500 #define _SSPCON3_DHEN 0x01
2501 #define _SSPCON3_AHEN 0x02
2502 #define _SSPCON3_SBCDE 0x04
2503 #define _SSPCON3_SDAHT 0x08
2504 #define _SSPCON3_BOEN 0x10
2505 #define _SSPCON3_SCIE 0x20
2506 #define _SSPCON3_PCIE 0x40
2507 #define _SSPCON3_ACKTIM 0x80
2509 //==============================================================================
2511 extern __at(0x0291) __sfr CCPR1;
2512 extern __at(0x0291) __sfr CCPR1L;
2513 extern __at(0x0292) __sfr CCPR1H;
2515 //==============================================================================
2516 // CCP1CON Bits
2518 extern __at(0x0293) __sfr CCP1CON;
2520 typedef union
2522 struct
2524 unsigned CCP1M0 : 1;
2525 unsigned CCP1M1 : 1;
2526 unsigned CCP1M2 : 1;
2527 unsigned CCP1M3 : 1;
2528 unsigned DC1B0 : 1;
2529 unsigned DC1B1 : 1;
2530 unsigned P1M0 : 1;
2531 unsigned P1M1 : 1;
2534 struct
2536 unsigned CCP1M : 4;
2537 unsigned : 4;
2540 struct
2542 unsigned : 4;
2543 unsigned DC1B : 2;
2544 unsigned : 2;
2547 struct
2549 unsigned : 6;
2550 unsigned P1M : 2;
2552 } __CCP1CONbits_t;
2554 extern __at(0x0293) volatile __CCP1CONbits_t CCP1CONbits;
2556 #define _CCP1M0 0x01
2557 #define _CCP1M1 0x02
2558 #define _CCP1M2 0x04
2559 #define _CCP1M3 0x08
2560 #define _DC1B0 0x10
2561 #define _DC1B1 0x20
2562 #define _P1M0 0x40
2563 #define _P1M1 0x80
2565 //==============================================================================
2568 //==============================================================================
2569 // PWM1CON Bits
2571 extern __at(0x0294) __sfr PWM1CON;
2573 typedef union
2575 struct
2577 unsigned P1DC0 : 1;
2578 unsigned P1DC1 : 1;
2579 unsigned P1DC2 : 1;
2580 unsigned P1DC3 : 1;
2581 unsigned P1DC4 : 1;
2582 unsigned P1DC5 : 1;
2583 unsigned P1DC6 : 1;
2584 unsigned P1RSEN : 1;
2587 struct
2589 unsigned P1DC : 7;
2590 unsigned : 1;
2592 } __PWM1CONbits_t;
2594 extern __at(0x0294) volatile __PWM1CONbits_t PWM1CONbits;
2596 #define _P1DC0 0x01
2597 #define _P1DC1 0x02
2598 #define _P1DC2 0x04
2599 #define _P1DC3 0x08
2600 #define _P1DC4 0x10
2601 #define _P1DC5 0x20
2602 #define _P1DC6 0x40
2603 #define _P1RSEN 0x80
2605 //==============================================================================
2608 //==============================================================================
2609 // CCP1AS Bits
2611 extern __at(0x0295) __sfr CCP1AS;
2613 typedef union
2615 struct
2617 unsigned PSS1BD0 : 1;
2618 unsigned PSS1BD1 : 1;
2619 unsigned PSS1AC0 : 1;
2620 unsigned PSS1AC1 : 1;
2621 unsigned CCP1AS0 : 1;
2622 unsigned CCP1AS1 : 1;
2623 unsigned CCP1AS2 : 1;
2624 unsigned CCP1ASE : 1;
2627 struct
2629 unsigned PSS1BD : 2;
2630 unsigned : 6;
2633 struct
2635 unsigned : 2;
2636 unsigned PSS1AC : 2;
2637 unsigned : 4;
2640 struct
2642 unsigned : 4;
2643 unsigned CCP1AS : 3;
2644 unsigned : 1;
2646 } __CCP1ASbits_t;
2648 extern __at(0x0295) volatile __CCP1ASbits_t CCP1ASbits;
2650 #define _PSS1BD0 0x01
2651 #define _PSS1BD1 0x02
2652 #define _PSS1AC0 0x04
2653 #define _PSS1AC1 0x08
2654 #define _CCP1AS0 0x10
2655 #define _CCP1AS1 0x20
2656 #define _CCP1AS2 0x40
2657 #define _CCP1ASE 0x80
2659 //==============================================================================
2662 //==============================================================================
2663 // ECCP1AS Bits
2665 extern __at(0x0295) __sfr ECCP1AS;
2667 typedef union
2669 struct
2671 unsigned PSS1BD0 : 1;
2672 unsigned PSS1BD1 : 1;
2673 unsigned PSS1AC0 : 1;
2674 unsigned PSS1AC1 : 1;
2675 unsigned CCP1AS0 : 1;
2676 unsigned CCP1AS1 : 1;
2677 unsigned CCP1AS2 : 1;
2678 unsigned CCP1ASE : 1;
2681 struct
2683 unsigned PSS1BD : 2;
2684 unsigned : 6;
2687 struct
2689 unsigned : 2;
2690 unsigned PSS1AC : 2;
2691 unsigned : 4;
2694 struct
2696 unsigned : 4;
2697 unsigned CCP1AS : 3;
2698 unsigned : 1;
2700 } __ECCP1ASbits_t;
2702 extern __at(0x0295) volatile __ECCP1ASbits_t ECCP1ASbits;
2704 #define _ECCP1AS_PSS1BD0 0x01
2705 #define _ECCP1AS_PSS1BD1 0x02
2706 #define _ECCP1AS_PSS1AC0 0x04
2707 #define _ECCP1AS_PSS1AC1 0x08
2708 #define _ECCP1AS_CCP1AS0 0x10
2709 #define _ECCP1AS_CCP1AS1 0x20
2710 #define _ECCP1AS_CCP1AS2 0x40
2711 #define _ECCP1AS_CCP1ASE 0x80
2713 //==============================================================================
2716 //==============================================================================
2717 // PSTR1CON Bits
2719 extern __at(0x0296) __sfr PSTR1CON;
2721 typedef struct
2723 unsigned STR1A : 1;
2724 unsigned STR1B : 1;
2725 unsigned STR1C : 1;
2726 unsigned STR1D : 1;
2727 unsigned STR1SYNC : 1;
2728 unsigned : 1;
2729 unsigned : 1;
2730 unsigned : 1;
2731 } __PSTR1CONbits_t;
2733 extern __at(0x0296) volatile __PSTR1CONbits_t PSTR1CONbits;
2735 #define _STR1A 0x01
2736 #define _STR1B 0x02
2737 #define _STR1C 0x04
2738 #define _STR1D 0x08
2739 #define _STR1SYNC 0x10
2741 //==============================================================================
2744 //==============================================================================
2745 // IOCAP Bits
2747 extern __at(0x0391) __sfr IOCAP;
2749 typedef union
2751 struct
2753 unsigned IOCAP0 : 1;
2754 unsigned IOCAP1 : 1;
2755 unsigned IOCAP2 : 1;
2756 unsigned IOCAP3 : 1;
2757 unsigned IOCAP4 : 1;
2758 unsigned IOCAP5 : 1;
2759 unsigned : 1;
2760 unsigned : 1;
2763 struct
2765 unsigned IOCAP : 6;
2766 unsigned : 2;
2768 } __IOCAPbits_t;
2770 extern __at(0x0391) volatile __IOCAPbits_t IOCAPbits;
2772 #define _IOCAP0 0x01
2773 #define _IOCAP1 0x02
2774 #define _IOCAP2 0x04
2775 #define _IOCAP3 0x08
2776 #define _IOCAP4 0x10
2777 #define _IOCAP5 0x20
2779 //==============================================================================
2782 //==============================================================================
2783 // IOCAN Bits
2785 extern __at(0x0392) __sfr IOCAN;
2787 typedef union
2789 struct
2791 unsigned IOCAN0 : 1;
2792 unsigned IOCAN1 : 1;
2793 unsigned IOCAN2 : 1;
2794 unsigned IOCAN3 : 1;
2795 unsigned IOCAN4 : 1;
2796 unsigned IOCAN5 : 1;
2797 unsigned : 1;
2798 unsigned : 1;
2801 struct
2803 unsigned IOCAN : 6;
2804 unsigned : 2;
2806 } __IOCANbits_t;
2808 extern __at(0x0392) volatile __IOCANbits_t IOCANbits;
2810 #define _IOCAN0 0x01
2811 #define _IOCAN1 0x02
2812 #define _IOCAN2 0x04
2813 #define _IOCAN3 0x08
2814 #define _IOCAN4 0x10
2815 #define _IOCAN5 0x20
2817 //==============================================================================
2820 //==============================================================================
2821 // IOCAF Bits
2823 extern __at(0x0393) __sfr IOCAF;
2825 typedef union
2827 struct
2829 unsigned IOCAF0 : 1;
2830 unsigned IOCAF1 : 1;
2831 unsigned IOCAF2 : 1;
2832 unsigned IOCAF3 : 1;
2833 unsigned IOCAF4 : 1;
2834 unsigned IOCAF5 : 1;
2835 unsigned : 1;
2836 unsigned : 1;
2839 struct
2841 unsigned IOCAF : 6;
2842 unsigned : 2;
2844 } __IOCAFbits_t;
2846 extern __at(0x0393) volatile __IOCAFbits_t IOCAFbits;
2848 #define _IOCAF0 0x01
2849 #define _IOCAF1 0x02
2850 #define _IOCAF2 0x04
2851 #define _IOCAF3 0x08
2852 #define _IOCAF4 0x10
2853 #define _IOCAF5 0x20
2855 //==============================================================================
2858 //==============================================================================
2859 // CLKRCON Bits
2861 extern __at(0x039A) __sfr CLKRCON;
2863 typedef union
2865 struct
2867 unsigned CLKRDIV0 : 1;
2868 unsigned CLKRDIV1 : 1;
2869 unsigned CLKRDIV2 : 1;
2870 unsigned CLKRDC0 : 1;
2871 unsigned CLKRDC1 : 1;
2872 unsigned CLKRSLR : 1;
2873 unsigned CLKROE : 1;
2874 unsigned CLKREN : 1;
2877 struct
2879 unsigned CLKRDIV : 3;
2880 unsigned : 5;
2883 struct
2885 unsigned : 3;
2886 unsigned CLKRDC : 2;
2887 unsigned : 3;
2889 } __CLKRCONbits_t;
2891 extern __at(0x039A) volatile __CLKRCONbits_t CLKRCONbits;
2893 #define _CLKRDIV0 0x01
2894 #define _CLKRDIV1 0x02
2895 #define _CLKRDIV2 0x04
2896 #define _CLKRDC0 0x08
2897 #define _CLKRDC1 0x10
2898 #define _CLKRSLR 0x20
2899 #define _CLKROE 0x40
2900 #define _CLKREN 0x80
2902 //==============================================================================
2905 //==============================================================================
2906 // MDCON Bits
2908 extern __at(0x039C) __sfr MDCON;
2910 typedef struct
2912 unsigned MDBIT : 1;
2913 unsigned : 1;
2914 unsigned : 1;
2915 unsigned MDOUT : 1;
2916 unsigned MDOPOL : 1;
2917 unsigned MDSLR : 1;
2918 unsigned MDOE : 1;
2919 unsigned MDEN : 1;
2920 } __MDCONbits_t;
2922 extern __at(0x039C) volatile __MDCONbits_t MDCONbits;
2924 #define _MDBIT 0x01
2925 #define _MDOUT 0x08
2926 #define _MDOPOL 0x10
2927 #define _MDSLR 0x20
2928 #define _MDOE 0x40
2929 #define _MDEN 0x80
2931 //==============================================================================
2934 //==============================================================================
2935 // MDSRC Bits
2937 extern __at(0x039D) __sfr MDSRC;
2939 typedef union
2941 struct
2943 unsigned MDMS0 : 1;
2944 unsigned MDMS1 : 1;
2945 unsigned MDMS2 : 1;
2946 unsigned MDMS3 : 1;
2947 unsigned : 1;
2948 unsigned : 1;
2949 unsigned : 1;
2950 unsigned MDMSODIS : 1;
2953 struct
2955 unsigned MDMS : 4;
2956 unsigned : 4;
2958 } __MDSRCbits_t;
2960 extern __at(0x039D) volatile __MDSRCbits_t MDSRCbits;
2962 #define _MDMS0 0x01
2963 #define _MDMS1 0x02
2964 #define _MDMS2 0x04
2965 #define _MDMS3 0x08
2966 #define _MDMSODIS 0x80
2968 //==============================================================================
2971 //==============================================================================
2972 // MDCARL Bits
2974 extern __at(0x039E) __sfr MDCARL;
2976 typedef union
2978 struct
2980 unsigned MDCL0 : 1;
2981 unsigned MDCL1 : 1;
2982 unsigned MDCL2 : 1;
2983 unsigned MDCL3 : 1;
2984 unsigned : 1;
2985 unsigned MDCLSYNC : 1;
2986 unsigned MDCLPOL : 1;
2987 unsigned MDCLODIS : 1;
2990 struct
2992 unsigned MDCL : 4;
2993 unsigned : 4;
2995 } __MDCARLbits_t;
2997 extern __at(0x039E) volatile __MDCARLbits_t MDCARLbits;
2999 #define _MDCL0 0x01
3000 #define _MDCL1 0x02
3001 #define _MDCL2 0x04
3002 #define _MDCL3 0x08
3003 #define _MDCLSYNC 0x20
3004 #define _MDCLPOL 0x40
3005 #define _MDCLODIS 0x80
3007 //==============================================================================
3010 //==============================================================================
3011 // MDCARH Bits
3013 extern __at(0x039F) __sfr MDCARH;
3015 typedef union
3017 struct
3019 unsigned MDCH0 : 1;
3020 unsigned MDCH1 : 1;
3021 unsigned MDCH2 : 1;
3022 unsigned MDCH3 : 1;
3023 unsigned : 1;
3024 unsigned MDCHSYNC : 1;
3025 unsigned MDCHPOL : 1;
3026 unsigned MDCHODIS : 1;
3029 struct
3031 unsigned MDCH : 4;
3032 unsigned : 4;
3034 } __MDCARHbits_t;
3036 extern __at(0x039F) volatile __MDCARHbits_t MDCARHbits;
3038 #define _MDCH0 0x01
3039 #define _MDCH1 0x02
3040 #define _MDCH2 0x04
3041 #define _MDCH3 0x08
3042 #define _MDCHSYNC 0x20
3043 #define _MDCHPOL 0x40
3044 #define _MDCHODIS 0x80
3046 //==============================================================================
3049 //==============================================================================
3050 // STATUS_SHAD Bits
3052 extern __at(0x0FE4) __sfr STATUS_SHAD;
3054 typedef struct
3056 unsigned C_SHAD : 1;
3057 unsigned DC_SHAD : 1;
3058 unsigned Z_SHAD : 1;
3059 unsigned : 1;
3060 unsigned : 1;
3061 unsigned : 1;
3062 unsigned : 1;
3063 unsigned : 1;
3064 } __STATUS_SHADbits_t;
3066 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits;
3068 #define _C_SHAD 0x01
3069 #define _DC_SHAD 0x02
3070 #define _Z_SHAD 0x04
3072 //==============================================================================
3074 extern __at(0x0FE5) __sfr WREG_SHAD;
3075 extern __at(0x0FE6) __sfr BSR_SHAD;
3076 extern __at(0x0FE7) __sfr PCLATH_SHAD;
3077 extern __at(0x0FE8) __sfr FSR0L_SHAD;
3078 extern __at(0x0FE9) __sfr FSR0H_SHAD;
3079 extern __at(0x0FEA) __sfr FSR1L_SHAD;
3080 extern __at(0x0FEB) __sfr FSR1H_SHAD;
3081 extern __at(0x0FED) __sfr STKPTR;
3082 extern __at(0x0FEE) __sfr TOSL;
3083 extern __at(0x0FEF) __sfr TOSH;
3085 //==============================================================================
3087 // Configuration Bits
3089 //==============================================================================
3091 #define _CONFIG1 0x8007
3092 #define _CONFIG2 0x8008
3094 //----------------------------- CONFIG1 Options -------------------------------
3096 #define _FOSC_LP 0x3FF8 // LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins.
3097 #define _FOSC_XT 0x3FF9 // XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins.
3098 #define _FOSC_HS 0x3FFA // HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins.
3099 #define _FOSC_EXTRC 0x3FFB // EXTRC oscillator: External RC circuit connected to CLKIN pin.
3100 #define _FOSC_INTOSC 0x3FFC // INTOSC oscillator: I/O function on CLKIN pin.
3101 #define _FOSC_ECL 0x3FFD // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pin.
3102 #define _FOSC_ECM 0x3FFE // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pin.
3103 #define _FOSC_ECH 0x3FFF // ECH, External Clock, High Power Mode (4-32 MHz): device clock supplied to CLKIN pin.
3104 #define _WDTE_OFF 0x3FE7 // WDT disabled.
3105 #define _WDTE_SWDTEN 0x3FEF // WDT controlled by the SWDTEN bit in the WDTCON register.
3106 #define _WDTE_NSLEEP 0x3FF7 // WDT enabled while running and disabled in Sleep.
3107 #define _WDTE_ON 0x3FFF // WDT enabled.
3108 #define _PWRTE_ON 0x3FDF // PWRT enabled.
3109 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
3110 #define _MCLRE_OFF 0x3FBF // MCLR/VPP pin function is digital input.
3111 #define _MCLRE_ON 0x3FFF // MCLR/VPP pin function is MCLR.
3112 #define _CP_ON 0x3F7F // Program memory code protection is enabled.
3113 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
3114 #define _CPD_ON 0x3EFF // Data memory code protection is enabled.
3115 #define _CPD_OFF 0x3FFF // Data memory code protection is disabled.
3116 #define _BOREN_OFF 0x39FF // Brown-out Reset disabled.
3117 #define _BOREN_SBODEN 0x3BFF // Brown-out Reset controlled by the SBOREN bit in the BORCON register.
3118 #define _BOREN_NSLEEP 0x3DFF // Brown-out Reset enabled while running and disabled in Sleep.
3119 #define _BOREN_ON 0x3FFF // Brown-out Reset enabled.
3120 #define _CLKOUTEN_ON 0x37FF // CLKOUT function is enabled on the CLKOUT pin.
3121 #define _CLKOUTEN_OFF 0x3FFF // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin.
3122 #define _IESO_OFF 0x2FFF // Internal/External Switchover mode is disabled.
3123 #define _IESO_ON 0x3FFF // Internal/External Switchover mode is enabled.
3124 #define _FCMEN_OFF 0x1FFF // Fail-Safe Clock Monitor is disabled.
3125 #define _FCMEN_ON 0x3FFF // Fail-Safe Clock Monitor is enabled.
3127 //----------------------------- CONFIG2 Options -------------------------------
3129 #define _WRT_ALL 0x3FFC // 000h to 7FFh write protected, no addresses may be modified by EECON control.
3130 #define _WRT_HALF 0x3FFD // 000h to 3FFh write protected, 400h to 7FFh may be modified by EECON control.
3131 #define _WRT_BOOT 0x3FFE // 000h to 1FFh write protected, 200h to 7FFh may be modified by EECON control.
3132 #define _WRT_OFF 0x3FFF // Write protection off.
3133 #define _PLLEN_OFF 0x3EFF // 4x PLL disabled.
3134 #define _PLLEN_ON 0x3FFF // 4x PLL enabled.
3135 #define _STVREN_OFF 0x3DFF // Stack Overflow or Underflow will not cause a Reset.
3136 #define _STVREN_ON 0x3FFF // Stack Overflow or Underflow will cause a Reset.
3137 #define _BORV_HI 0x3BFF // Brown-out Reset Voltage (Vbor), high trip point selected.
3138 #define _BORV_LO 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
3139 #define _DEBUG_ON 0x2FFF // In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger.
3140 #define _DEBUG_OFF 0x3FFF // In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins.
3141 #define _LVP_OFF 0x1FFF // High-voltage on MCLR/VPP must be used for programming.
3142 #define _LVP_ON 0x3FFF // Low-voltage programming enabled.
3144 //==============================================================================
3146 #define _DEVID1 0x8006
3148 #define _IDLOC0 0x8000
3149 #define _IDLOC1 0x8001
3150 #define _IDLOC2 0x8002
3151 #define _IDLOC3 0x8003
3153 //==============================================================================
3155 #ifndef NO_BIT_DEFINES
3157 #define ADON ADCON0bits.ADON // bit 0
3158 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1, shadows bit in ADCON0bits
3159 #define ADGO ADCON0bits.ADGO // bit 1, shadows bit in ADCON0bits
3160 #define GO ADCON0bits.GO // bit 1, shadows bit in ADCON0bits
3161 #define NOT_DONE ADCON0bits.NOT_DONE // bit 1, shadows bit in ADCON0bits
3162 #define CHS0 ADCON0bits.CHS0 // bit 2
3163 #define CHS1 ADCON0bits.CHS1 // bit 3
3164 #define CHS2 ADCON0bits.CHS2 // bit 4
3165 #define CHS3 ADCON0bits.CHS3 // bit 5
3166 #define CHS4 ADCON0bits.CHS4 // bit 6
3168 #define ADPREF0 ADCON1bits.ADPREF0 // bit 0
3169 #define ADPREF1 ADCON1bits.ADPREF1 // bit 1
3170 #define ADCS0 ADCON1bits.ADCS0 // bit 4
3171 #define ADCS1 ADCON1bits.ADCS1 // bit 5
3172 #define ADCS2 ADCON1bits.ADCS2 // bit 6
3173 #define ADFM ADCON1bits.ADFM // bit 7
3175 #define ANSA0 ANSELAbits.ANSA0 // bit 0
3176 #define ANSA1 ANSELAbits.ANSA1 // bit 1
3177 #define ANSA2 ANSELAbits.ANSA2 // bit 2
3178 #define ANSA4 ANSELAbits.ANSA4 // bit 4
3180 #define ANSC0 ANSELCbits.ANSC0 // bit 0
3181 #define ANSC1 ANSELCbits.ANSC1 // bit 1
3182 #define ANSC2 ANSELCbits.ANSC2 // bit 2
3183 #define ANSC3 ANSELCbits.ANSC3 // bit 3
3185 #define TXCKSEL APFCONbits.TXCKSEL // bit 2
3186 #define T1GSEL APFCONbits.T1GSEL // bit 3
3187 #define SSSEL APFCONbits.SSSEL // bit 5, shadows bit in APFCONbits
3188 #define SS1SEL APFCONbits.SS1SEL // bit 5, shadows bit in APFCONbits
3189 #define SDOSEL APFCONbits.SDOSEL // bit 6, shadows bit in APFCONbits
3190 #define SDO1SEL APFCONbits.SDO1SEL // bit 6, shadows bit in APFCONbits
3191 #define RXDTSEL APFCONbits.RXDTSEL // bit 7
3193 #define ABDEN BAUDCONbits.ABDEN // bit 0
3194 #define WUE BAUDCONbits.WUE // bit 1
3195 #define BRG16 BAUDCONbits.BRG16 // bit 3
3196 #define SCKP BAUDCONbits.SCKP // bit 4
3197 #define RCIDL BAUDCONbits.RCIDL // bit 6
3198 #define ABDOVF BAUDCONbits.ABDOVF // bit 7
3200 #define BORRDY BORCONbits.BORRDY // bit 0
3201 #define SBOREN BORCONbits.SBOREN // bit 7
3203 #define BSR0 BSRbits.BSR0 // bit 0
3204 #define BSR1 BSRbits.BSR1 // bit 1
3205 #define BSR2 BSRbits.BSR2 // bit 2
3206 #define BSR3 BSRbits.BSR3 // bit 3
3207 #define BSR4 BSRbits.BSR4 // bit 4
3209 #define PSS1BD0 CCP1ASbits.PSS1BD0 // bit 0
3210 #define PSS1BD1 CCP1ASbits.PSS1BD1 // bit 1
3211 #define PSS1AC0 CCP1ASbits.PSS1AC0 // bit 2
3212 #define PSS1AC1 CCP1ASbits.PSS1AC1 // bit 3
3213 #define CCP1AS0 CCP1ASbits.CCP1AS0 // bit 4
3214 #define CCP1AS1 CCP1ASbits.CCP1AS1 // bit 5
3215 #define CCP1AS2 CCP1ASbits.CCP1AS2 // bit 6
3216 #define CCP1ASE CCP1ASbits.CCP1ASE // bit 7
3218 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
3219 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
3220 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
3221 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
3222 #define DC1B0 CCP1CONbits.DC1B0 // bit 4
3223 #define DC1B1 CCP1CONbits.DC1B1 // bit 5
3224 #define P1M0 CCP1CONbits.P1M0 // bit 6
3225 #define P1M1 CCP1CONbits.P1M1 // bit 7
3227 #define CLKRDIV0 CLKRCONbits.CLKRDIV0 // bit 0
3228 #define CLKRDIV1 CLKRCONbits.CLKRDIV1 // bit 1
3229 #define CLKRDIV2 CLKRCONbits.CLKRDIV2 // bit 2
3230 #define CLKRDC0 CLKRCONbits.CLKRDC0 // bit 3
3231 #define CLKRDC1 CLKRCONbits.CLKRDC1 // bit 4
3232 #define CLKRSLR CLKRCONbits.CLKRSLR // bit 5
3233 #define CLKROE CLKRCONbits.CLKROE // bit 6
3234 #define CLKREN CLKRCONbits.CLKREN // bit 7
3236 #define C1SYNC CM1CON0bits.C1SYNC // bit 0
3237 #define C1HYS CM1CON0bits.C1HYS // bit 1
3238 #define C1SP CM1CON0bits.C1SP // bit 2
3239 #define C1POL CM1CON0bits.C1POL // bit 4
3240 #define C1OE CM1CON0bits.C1OE // bit 5
3241 #define C1OUT CM1CON0bits.C1OUT // bit 6
3242 #define C1ON CM1CON0bits.C1ON // bit 7
3244 #define C1NCH0 CM1CON1bits.C1NCH0 // bit 0
3245 #define C1NCH1 CM1CON1bits.C1NCH1 // bit 1
3246 #define C1PCH0 CM1CON1bits.C1PCH0 // bit 4
3247 #define C1PCH1 CM1CON1bits.C1PCH1 // bit 5
3248 #define C1INTN CM1CON1bits.C1INTN // bit 6
3249 #define C1INTP CM1CON1bits.C1INTP // bit 7
3251 #define C2SYNC CM2CON0bits.C2SYNC // bit 0
3252 #define C2HYS CM2CON0bits.C2HYS // bit 1
3253 #define C2SP CM2CON0bits.C2SP // bit 2
3254 #define C2POL CM2CON0bits.C2POL // bit 4
3255 #define C2OE CM2CON0bits.C2OE // bit 5
3256 #define C2OUT CM2CON0bits.C2OUT // bit 6
3257 #define C2ON CM2CON0bits.C2ON // bit 7
3259 #define C2NCH0 CM2CON1bits.C2NCH0 // bit 0
3260 #define C2NCH1 CM2CON1bits.C2NCH1 // bit 1
3261 #define C2PCH0 CM2CON1bits.C2PCH0 // bit 4
3262 #define C2PCH1 CM2CON1bits.C2PCH1 // bit 5
3263 #define C2INTN CM2CON1bits.C2INTN // bit 6
3264 #define C2INTP CM2CON1bits.C2INTP // bit 7
3266 #define MC1OUT CMOUTbits.MC1OUT // bit 0
3267 #define MC2OUT CMOUTbits.MC2OUT // bit 1
3269 #define T0XCS CPSCON0bits.T0XCS // bit 0
3270 #define CPSOUT CPSCON0bits.CPSOUT // bit 1
3271 #define CPSRNG0 CPSCON0bits.CPSRNG0 // bit 2
3272 #define CPSRNG1 CPSCON0bits.CPSRNG1 // bit 3
3273 #define CPSRM CPSCON0bits.CPSRM // bit 6
3274 #define CPSON CPSCON0bits.CPSON // bit 7
3276 #define CPSCH0 CPSCON1bits.CPSCH0 // bit 0
3277 #define CPSCH1 CPSCON1bits.CPSCH1 // bit 1
3278 #define CPSCH2 CPSCON1bits.CPSCH2 // bit 2
3279 #define CPSCH3 CPSCON1bits.CPSCH3 // bit 3
3281 #define DACPSS0 DACCON0bits.DACPSS0 // bit 2
3282 #define DACPSS1 DACCON0bits.DACPSS1 // bit 3
3283 #define DACOE DACCON0bits.DACOE // bit 5
3284 #define DACLPS DACCON0bits.DACLPS // bit 6
3285 #define DACEN DACCON0bits.DACEN // bit 7
3287 #define DACR0 DACCON1bits.DACR0 // bit 0
3288 #define DACR1 DACCON1bits.DACR1 // bit 1
3289 #define DACR2 DACCON1bits.DACR2 // bit 2
3290 #define DACR3 DACCON1bits.DACR3 // bit 3
3291 #define DACR4 DACCON1bits.DACR4 // bit 4
3293 #define RD EECON1bits.RD // bit 0
3294 #define WR EECON1bits.WR // bit 1
3295 #define WREN EECON1bits.WREN // bit 2
3296 #define WRERR EECON1bits.WRERR // bit 3
3297 #define FREE EECON1bits.FREE // bit 4
3298 #define LWLO EECON1bits.LWLO // bit 5
3299 #define CFGS EECON1bits.CFGS // bit 6
3300 #define EEPGD EECON1bits.EEPGD // bit 7
3302 #define ADFVR0 FVRCONbits.ADFVR0 // bit 0
3303 #define ADFVR1 FVRCONbits.ADFVR1 // bit 1
3304 #define CDAFVR0 FVRCONbits.CDAFVR0 // bit 2
3305 #define CDAFVR1 FVRCONbits.CDAFVR1 // bit 3
3306 #define TSRNG FVRCONbits.TSRNG // bit 4
3307 #define TSEN FVRCONbits.TSEN // bit 5
3308 #define FVRRDY FVRCONbits.FVRRDY // bit 6
3309 #define FVREN FVRCONbits.FVREN // bit 7
3311 #define IOCIF INTCONbits.IOCIF // bit 0
3312 #define INTF INTCONbits.INTF // bit 1
3313 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
3314 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
3315 #define IOCIE INTCONbits.IOCIE // bit 3
3316 #define INTE INTCONbits.INTE // bit 4
3317 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
3318 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
3319 #define PEIE INTCONbits.PEIE // bit 6
3320 #define GIE INTCONbits.GIE // bit 7
3322 #define IOCAF0 IOCAFbits.IOCAF0 // bit 0
3323 #define IOCAF1 IOCAFbits.IOCAF1 // bit 1
3324 #define IOCAF2 IOCAFbits.IOCAF2 // bit 2
3325 #define IOCAF3 IOCAFbits.IOCAF3 // bit 3
3326 #define IOCAF4 IOCAFbits.IOCAF4 // bit 4
3327 #define IOCAF5 IOCAFbits.IOCAF5 // bit 5
3329 #define IOCAN0 IOCANbits.IOCAN0 // bit 0
3330 #define IOCAN1 IOCANbits.IOCAN1 // bit 1
3331 #define IOCAN2 IOCANbits.IOCAN2 // bit 2
3332 #define IOCAN3 IOCANbits.IOCAN3 // bit 3
3333 #define IOCAN4 IOCANbits.IOCAN4 // bit 4
3334 #define IOCAN5 IOCANbits.IOCAN5 // bit 5
3336 #define IOCAP0 IOCAPbits.IOCAP0 // bit 0
3337 #define IOCAP1 IOCAPbits.IOCAP1 // bit 1
3338 #define IOCAP2 IOCAPbits.IOCAP2 // bit 2
3339 #define IOCAP3 IOCAPbits.IOCAP3 // bit 3
3340 #define IOCAP4 IOCAPbits.IOCAP4 // bit 4
3341 #define IOCAP5 IOCAPbits.IOCAP5 // bit 5
3343 #define LATA0 LATAbits.LATA0 // bit 0
3344 #define LATA1 LATAbits.LATA1 // bit 1
3345 #define LATA2 LATAbits.LATA2 // bit 2
3346 #define LATA4 LATAbits.LATA4 // bit 4
3347 #define LATA5 LATAbits.LATA5 // bit 5
3349 #define LATC0 LATCbits.LATC0 // bit 0
3350 #define LATC1 LATCbits.LATC1 // bit 1
3351 #define LATC2 LATCbits.LATC2 // bit 2
3352 #define LATC3 LATCbits.LATC3 // bit 3
3353 #define LATC4 LATCbits.LATC4 // bit 4
3354 #define LATC5 LATCbits.LATC5 // bit 5
3356 #define MDCH0 MDCARHbits.MDCH0 // bit 0
3357 #define MDCH1 MDCARHbits.MDCH1 // bit 1
3358 #define MDCH2 MDCARHbits.MDCH2 // bit 2
3359 #define MDCH3 MDCARHbits.MDCH3 // bit 3
3360 #define MDCHSYNC MDCARHbits.MDCHSYNC // bit 5
3361 #define MDCHPOL MDCARHbits.MDCHPOL // bit 6
3362 #define MDCHODIS MDCARHbits.MDCHODIS // bit 7
3364 #define MDCL0 MDCARLbits.MDCL0 // bit 0
3365 #define MDCL1 MDCARLbits.MDCL1 // bit 1
3366 #define MDCL2 MDCARLbits.MDCL2 // bit 2
3367 #define MDCL3 MDCARLbits.MDCL3 // bit 3
3368 #define MDCLSYNC MDCARLbits.MDCLSYNC // bit 5
3369 #define MDCLPOL MDCARLbits.MDCLPOL // bit 6
3370 #define MDCLODIS MDCARLbits.MDCLODIS // bit 7
3372 #define MDBIT MDCONbits.MDBIT // bit 0
3373 #define MDOUT MDCONbits.MDOUT // bit 3
3374 #define MDOPOL MDCONbits.MDOPOL // bit 4
3375 #define MDSLR MDCONbits.MDSLR // bit 5
3376 #define MDOE MDCONbits.MDOE // bit 6
3377 #define MDEN MDCONbits.MDEN // bit 7
3379 #define MDMS0 MDSRCbits.MDMS0 // bit 0
3380 #define MDMS1 MDSRCbits.MDMS1 // bit 1
3381 #define MDMS2 MDSRCbits.MDMS2 // bit 2
3382 #define MDMS3 MDSRCbits.MDMS3 // bit 3
3383 #define MDMSODIS MDSRCbits.MDMSODIS // bit 7
3385 #define PS0 OPTION_REGbits.PS0 // bit 0
3386 #define PS1 OPTION_REGbits.PS1 // bit 1
3387 #define PS2 OPTION_REGbits.PS2 // bit 2
3388 #define PSA OPTION_REGbits.PSA // bit 3
3389 #define TMR0SE OPTION_REGbits.TMR0SE // bit 4, shadows bit in OPTION_REGbits
3390 #define T0SE OPTION_REGbits.T0SE // bit 4, shadows bit in OPTION_REGbits
3391 #define TMR0CS OPTION_REGbits.TMR0CS // bit 5, shadows bit in OPTION_REGbits
3392 #define T0CS OPTION_REGbits.T0CS // bit 5, shadows bit in OPTION_REGbits
3393 #define INTEDG OPTION_REGbits.INTEDG // bit 6
3394 #define NOT_WPUEN OPTION_REGbits.NOT_WPUEN // bit 7
3396 #define SCS0 OSCCONbits.SCS0 // bit 0
3397 #define SCS1 OSCCONbits.SCS1 // bit 1
3398 #define IRCF0 OSCCONbits.IRCF0 // bit 3
3399 #define IRCF1 OSCCONbits.IRCF1 // bit 4
3400 #define IRCF2 OSCCONbits.IRCF2 // bit 5
3401 #define IRCF3 OSCCONbits.IRCF3 // bit 6
3402 #define SPLLEN OSCCONbits.SPLLEN // bit 7
3404 #define HFIOFS OSCSTATbits.HFIOFS // bit 0
3405 #define LFIOFR OSCSTATbits.LFIOFR // bit 1
3406 #define MFIOFR OSCSTATbits.MFIOFR // bit 2
3407 #define HFIOFL OSCSTATbits.HFIOFL // bit 3
3408 #define HFIOFR OSCSTATbits.HFIOFR // bit 4
3409 #define OSTS OSCSTATbits.OSTS // bit 5
3410 #define PLLR OSCSTATbits.PLLR // bit 6
3411 #define T1OSCR OSCSTATbits.T1OSCR // bit 7
3413 #define TUN0 OSCTUNEbits.TUN0 // bit 0
3414 #define TUN1 OSCTUNEbits.TUN1 // bit 1
3415 #define TUN2 OSCTUNEbits.TUN2 // bit 2
3416 #define TUN3 OSCTUNEbits.TUN3 // bit 3
3417 #define TUN4 OSCTUNEbits.TUN4 // bit 4
3418 #define TUN5 OSCTUNEbits.TUN5 // bit 5
3420 #define NOT_BOR PCONbits.NOT_BOR // bit 0
3421 #define NOT_POR PCONbits.NOT_POR // bit 1
3422 #define NOT_RI PCONbits.NOT_RI // bit 2
3423 #define NOT_RMCLR PCONbits.NOT_RMCLR // bit 3
3424 #define STKUNF PCONbits.STKUNF // bit 6
3425 #define STKOVF PCONbits.STKOVF // bit 7
3427 #define TMR1IE PIE1bits.TMR1IE // bit 0
3428 #define TMR2IE PIE1bits.TMR2IE // bit 1
3429 #define CCP1IE PIE1bits.CCP1IE // bit 2
3430 #define SSP1IE PIE1bits.SSP1IE // bit 3
3431 #define TXIE PIE1bits.TXIE // bit 4
3432 #define RCIE PIE1bits.RCIE // bit 5
3433 #define ADIE PIE1bits.ADIE // bit 6
3434 #define TMR1GIE PIE1bits.TMR1GIE // bit 7
3436 #define BCL1IE PIE2bits.BCL1IE // bit 3
3437 #define EEIE PIE2bits.EEIE // bit 4
3438 #define C1IE PIE2bits.C1IE // bit 5
3439 #define C2IE PIE2bits.C2IE // bit 6
3440 #define OSFIE PIE2bits.OSFIE // bit 7
3442 #define TMR1IF PIR1bits.TMR1IF // bit 0
3443 #define TMR2IF PIR1bits.TMR2IF // bit 1
3444 #define CCP1IF PIR1bits.CCP1IF // bit 2
3445 #define SSP1IF PIR1bits.SSP1IF // bit 3
3446 #define TXIF PIR1bits.TXIF // bit 4
3447 #define RCIF PIR1bits.RCIF // bit 5
3448 #define ADIF PIR1bits.ADIF // bit 6
3449 #define TMR1GIF PIR1bits.TMR1GIF // bit 7
3451 #define BCL1IF PIR2bits.BCL1IF // bit 3
3452 #define EEIF PIR2bits.EEIF // bit 4
3453 #define C1IF PIR2bits.C1IF // bit 5
3454 #define C2IF PIR2bits.C2IF // bit 6
3455 #define OSFIF PIR2bits.OSFIF // bit 7
3457 #define STR1A PSTR1CONbits.STR1A // bit 0
3458 #define STR1B PSTR1CONbits.STR1B // bit 1
3459 #define STR1C PSTR1CONbits.STR1C // bit 2
3460 #define STR1D PSTR1CONbits.STR1D // bit 3
3461 #define STR1SYNC PSTR1CONbits.STR1SYNC // bit 4
3463 #define P1DC0 PWM1CONbits.P1DC0 // bit 0
3464 #define P1DC1 PWM1CONbits.P1DC1 // bit 1
3465 #define P1DC2 PWM1CONbits.P1DC2 // bit 2
3466 #define P1DC3 PWM1CONbits.P1DC3 // bit 3
3467 #define P1DC4 PWM1CONbits.P1DC4 // bit 4
3468 #define P1DC5 PWM1CONbits.P1DC5 // bit 5
3469 #define P1DC6 PWM1CONbits.P1DC6 // bit 6
3470 #define P1RSEN PWM1CONbits.P1RSEN // bit 7
3472 #define RX9D RCSTAbits.RX9D // bit 0
3473 #define OERR RCSTAbits.OERR // bit 1
3474 #define FERR RCSTAbits.FERR // bit 2
3475 #define ADDEN RCSTAbits.ADDEN // bit 3
3476 #define CREN RCSTAbits.CREN // bit 4
3477 #define SREN RCSTAbits.SREN // bit 5
3478 #define RX9 RCSTAbits.RX9 // bit 6
3479 #define SPEN RCSTAbits.SPEN // bit 7
3481 #define SRPR SRCON0bits.SRPR // bit 0
3482 #define SRPS SRCON0bits.SRPS // bit 1
3483 #define SRNQEN SRCON0bits.SRNQEN // bit 2
3484 #define SRQEN SRCON0bits.SRQEN // bit 3
3485 #define SRCLK0 SRCON0bits.SRCLK0 // bit 4
3486 #define SRCLK1 SRCON0bits.SRCLK1 // bit 5
3487 #define SRCLK2 SRCON0bits.SRCLK2 // bit 6
3488 #define SRLEN SRCON0bits.SRLEN // bit 7
3490 #define SRRC1E SRCON1bits.SRRC1E // bit 0
3491 #define SRRC2E SRCON1bits.SRRC2E // bit 1
3492 #define SRRCKE SRCON1bits.SRRCKE // bit 2
3493 #define SRRPE SRCON1bits.SRRPE // bit 3
3494 #define SRSC1E SRCON1bits.SRSC1E // bit 4
3495 #define SRSC2E SRCON1bits.SRSC2E // bit 5
3496 #define SRSCKE SRCON1bits.SRSCKE // bit 6
3497 #define SRSPE SRCON1bits.SRSPE // bit 7
3499 #define SSPM0 SSP1CON1bits.SSPM0 // bit 0
3500 #define SSPM1 SSP1CON1bits.SSPM1 // bit 1
3501 #define SSPM2 SSP1CON1bits.SSPM2 // bit 2
3502 #define SSPM3 SSP1CON1bits.SSPM3 // bit 3
3503 #define CKP SSP1CON1bits.CKP // bit 4
3504 #define SSPEN SSP1CON1bits.SSPEN // bit 5
3505 #define SSPOV SSP1CON1bits.SSPOV // bit 6
3506 #define WCOL SSP1CON1bits.WCOL // bit 7
3508 #define SEN SSP1CON2bits.SEN // bit 0
3509 #define RSEN SSP1CON2bits.RSEN // bit 1
3510 #define PEN SSP1CON2bits.PEN // bit 2
3511 #define RCEN SSP1CON2bits.RCEN // bit 3
3512 #define ACKEN SSP1CON2bits.ACKEN // bit 4
3513 #define ACKDT SSP1CON2bits.ACKDT // bit 5
3514 #define ACKSTAT SSP1CON2bits.ACKSTAT // bit 6
3515 #define GCEN SSP1CON2bits.GCEN // bit 7
3517 #define DHEN SSP1CON3bits.DHEN // bit 0
3518 #define AHEN SSP1CON3bits.AHEN // bit 1
3519 #define SBCDE SSP1CON3bits.SBCDE // bit 2
3520 #define SDAHT SSP1CON3bits.SDAHT // bit 3
3521 #define BOEN SSP1CON3bits.BOEN // bit 4
3522 #define SCIE SSP1CON3bits.SCIE // bit 5
3523 #define PCIE SSP1CON3bits.PCIE // bit 6
3524 #define ACKTIM SSP1CON3bits.ACKTIM // bit 7
3526 #define BF SSP1STATbits.BF // bit 0
3527 #define UA SSP1STATbits.UA // bit 1
3528 #define R_NOT_W SSP1STATbits.R_NOT_W // bit 2
3529 #define S SSP1STATbits.S // bit 3
3530 #define P SSP1STATbits.P // bit 4
3531 #define D_NOT_A SSP1STATbits.D_NOT_A // bit 5
3532 #define CKE SSP1STATbits.CKE // bit 6
3533 #define SMP SSP1STATbits.SMP // bit 7
3535 #define C STATUSbits.C // bit 0
3536 #define DC STATUSbits.DC // bit 1
3537 #define Z STATUSbits.Z // bit 2
3538 #define NOT_PD STATUSbits.NOT_PD // bit 3
3539 #define NOT_TO STATUSbits.NOT_TO // bit 4
3541 #define C_SHAD STATUS_SHADbits.C_SHAD // bit 0
3542 #define DC_SHAD STATUS_SHADbits.DC_SHAD // bit 1
3543 #define Z_SHAD STATUS_SHADbits.Z_SHAD // bit 2
3545 #define TMR1ON T1CONbits.TMR1ON // bit 0
3546 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2
3547 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
3548 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
3549 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
3550 #define TMR1CS0 T1CONbits.TMR1CS0 // bit 6
3551 #define TMR1CS1 T1CONbits.TMR1CS1 // bit 7
3553 #define T1GSS0 T1GCONbits.T1GSS0 // bit 0
3554 #define T1GSS1 T1GCONbits.T1GSS1 // bit 1
3555 #define T1GVAL T1GCONbits.T1GVAL // bit 2
3556 #define T1GGO_NOT_DONE T1GCONbits.T1GGO_NOT_DONE // bit 3, shadows bit in T1GCONbits
3557 #define T1GGO T1GCONbits.T1GGO // bit 3, shadows bit in T1GCONbits
3558 #define T1GSPM T1GCONbits.T1GSPM // bit 4
3559 #define T1GTM T1GCONbits.T1GTM // bit 5
3560 #define T1GPOL T1GCONbits.T1GPOL // bit 6
3561 #define TMR1GE T1GCONbits.TMR1GE // bit 7
3563 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
3564 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
3565 #define TMR2ON T2CONbits.TMR2ON // bit 2
3566 #define T2OUTPS0 T2CONbits.T2OUTPS0 // bit 3
3567 #define T2OUTPS1 T2CONbits.T2OUTPS1 // bit 4
3568 #define T2OUTPS2 T2CONbits.T2OUTPS2 // bit 5
3569 #define T2OUTPS3 T2CONbits.T2OUTPS3 // bit 6
3571 #define TRISA0 TRISAbits.TRISA0 // bit 0
3572 #define TRISA1 TRISAbits.TRISA1 // bit 1
3573 #define TRISA2 TRISAbits.TRISA2 // bit 2
3574 #define TRISA3 TRISAbits.TRISA3 // bit 3
3575 #define TRISA4 TRISAbits.TRISA4 // bit 4
3576 #define TRISA5 TRISAbits.TRISA5 // bit 5
3578 #define TRISC0 TRISCbits.TRISC0 // bit 0
3579 #define TRISC1 TRISCbits.TRISC1 // bit 1
3580 #define TRISC2 TRISCbits.TRISC2 // bit 2
3581 #define TRISC3 TRISCbits.TRISC3 // bit 3
3582 #define TRISC4 TRISCbits.TRISC4 // bit 4
3583 #define TRISC5 TRISCbits.TRISC5 // bit 5
3585 #define TX9D TXSTAbits.TX9D // bit 0
3586 #define TRMT TXSTAbits.TRMT // bit 1
3587 #define BRGH TXSTAbits.BRGH // bit 2
3588 #define SENDB TXSTAbits.SENDB // bit 3
3589 #define SYNC TXSTAbits.SYNC // bit 4
3590 #define TXEN TXSTAbits.TXEN // bit 5
3591 #define TX9 TXSTAbits.TX9 // bit 6
3592 #define CSRC TXSTAbits.CSRC // bit 7
3594 #define SWDTEN WDTCONbits.SWDTEN // bit 0
3595 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1
3596 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2
3597 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3
3598 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4
3599 #define WDTPS4 WDTCONbits.WDTPS4 // bit 5
3601 #define WPUA0 WPUAbits.WPUA0 // bit 0
3602 #define WPUA1 WPUAbits.WPUA1 // bit 1
3603 #define WPUA2 WPUAbits.WPUA2 // bit 2
3604 #define WPUA3 WPUAbits.WPUA3 // bit 3
3605 #define WPUA4 WPUAbits.WPUA4 // bit 4
3606 #define WPUA5 WPUAbits.WPUA5 // bit 5
3608 #define WPUC0 WPUCbits.WPUC0 // bit 0
3609 #define WPUC1 WPUCbits.WPUC1 // bit 1
3610 #define WPUC2 WPUCbits.WPUC2 // bit 2
3611 #define WPUC3 WPUCbits.WPUC3 // bit 3
3612 #define WPUC4 WPUCbits.WPUC4 // bit 4
3613 #define WPUC5 WPUCbits.WPUC5 // bit 5
3615 #endif // #ifndef NO_BIT_DEFINES
3617 #endif // #ifndef __PIC16F1823_H__