struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16f690.h
blob19c304f60fc8c84cf0e99755d33aa4797128683d
1 /*
2 * This declarations of the PIC16F690 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:22:57 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 __PIC16F690_H__
26 #define __PIC16F690_H__
28 //==============================================================================
30 // Register Addresses
32 //==============================================================================
34 #ifndef NO_ADDR_DEFINES
36 #define INDF_ADDR 0x0000
37 #define TMR0_ADDR 0x0001
38 #define PCL_ADDR 0x0002
39 #define STATUS_ADDR 0x0003
40 #define FSR_ADDR 0x0004
41 #define PORTA_ADDR 0x0005
42 #define PORTB_ADDR 0x0006
43 #define PORTC_ADDR 0x0007
44 #define PCLATH_ADDR 0x000A
45 #define INTCON_ADDR 0x000B
46 #define PIR1_ADDR 0x000C
47 #define PIR2_ADDR 0x000D
48 #define TMR1_ADDR 0x000E
49 #define TMR1L_ADDR 0x000E
50 #define TMR1H_ADDR 0x000F
51 #define T1CON_ADDR 0x0010
52 #define TMR2_ADDR 0x0011
53 #define T2CON_ADDR 0x0012
54 #define SSPBUF_ADDR 0x0013
55 #define SSPCON_ADDR 0x0014
56 #define CCPR_ADDR 0x0015
57 #define CCPR1L_ADDR 0x0015
58 #define CCPR1H_ADDR 0x0016
59 #define CCP1CON_ADDR 0x0017
60 #define RCSTA_ADDR 0x0018
61 #define TXREG_ADDR 0x0019
62 #define RCREG_ADDR 0x001A
63 #define PWM1CON_ADDR 0x001C
64 #define ECCPAS_ADDR 0x001D
65 #define ADRESH_ADDR 0x001E
66 #define ADCON0_ADDR 0x001F
67 #define OPTION_REG_ADDR 0x0081
68 #define TRISA_ADDR 0x0085
69 #define TRISB_ADDR 0x0086
70 #define TRISC_ADDR 0x0087
71 #define PIE1_ADDR 0x008C
72 #define PIE2_ADDR 0x008D
73 #define PCON_ADDR 0x008E
74 #define OSCCON_ADDR 0x008F
75 #define OSCTUNE_ADDR 0x0090
76 #define PR2_ADDR 0x0092
77 #define MSK_ADDR 0x0093
78 #define SSPADD_ADDR 0x0093
79 #define SSPMSK_ADDR 0x0093
80 #define SSPSTAT_ADDR 0x0094
81 #define WPU_ADDR 0x0095
82 #define WPUA_ADDR 0x0095
83 #define IOC_ADDR 0x0096
84 #define IOCA_ADDR 0x0096
85 #define WDTCON_ADDR 0x0097
86 #define TXSTA_ADDR 0x0098
87 #define SPBRG_ADDR 0x0099
88 #define SPBRGH_ADDR 0x009A
89 #define BAUDCTL_ADDR 0x009B
90 #define ADRESL_ADDR 0x009E
91 #define ADCON1_ADDR 0x009F
92 #define EEDAT_ADDR 0x010C
93 #define EEDATA_ADDR 0x010C
94 #define EEADR_ADDR 0x010D
95 #define EEDATH_ADDR 0x010E
96 #define EEADRH_ADDR 0x010F
97 #define WPUB_ADDR 0x0115
98 #define IOCB_ADDR 0x0116
99 #define VRCON_ADDR 0x0118
100 #define CM1CON0_ADDR 0x0119
101 #define CM2CON0_ADDR 0x011A
102 #define CM2CON1_ADDR 0x011B
103 #define ANSEL_ADDR 0x011E
104 #define ANSELH_ADDR 0x011F
105 #define EECON1_ADDR 0x018C
106 #define EECON2_ADDR 0x018D
107 #define PSTRCON_ADDR 0x019D
108 #define SRCON_ADDR 0x019E
110 #endif // #ifndef NO_ADDR_DEFINES
112 //==============================================================================
114 // Register Definitions
116 //==============================================================================
118 extern __at(0x0000) __sfr INDF;
119 extern __at(0x0001) __sfr TMR0;
120 extern __at(0x0002) __sfr PCL;
122 //==============================================================================
123 // STATUS Bits
125 extern __at(0x0003) __sfr STATUS;
127 typedef union
129 struct
131 unsigned C : 1;
132 unsigned DC : 1;
133 unsigned Z : 1;
134 unsigned NOT_PD : 1;
135 unsigned NOT_TO : 1;
136 unsigned RP0 : 1;
137 unsigned RP1 : 1;
138 unsigned IRP : 1;
141 struct
143 unsigned : 5;
144 unsigned RP : 2;
145 unsigned : 1;
147 } __STATUSbits_t;
149 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
151 #define _C 0x01
152 #define _DC 0x02
153 #define _Z 0x04
154 #define _NOT_PD 0x08
155 #define _NOT_TO 0x10
156 #define _RP0 0x20
157 #define _RP1 0x40
158 #define _IRP 0x80
160 //==============================================================================
162 extern __at(0x0004) __sfr FSR;
164 //==============================================================================
165 // PORTA Bits
167 extern __at(0x0005) __sfr PORTA;
169 typedef union
171 struct
173 unsigned RA0 : 1;
174 unsigned RA1 : 1;
175 unsigned RA2 : 1;
176 unsigned RA3 : 1;
177 unsigned RA4 : 1;
178 unsigned RA5 : 1;
179 unsigned : 1;
180 unsigned : 1;
183 struct
185 unsigned RA : 6;
186 unsigned : 2;
188 } __PORTAbits_t;
190 extern __at(0x0005) volatile __PORTAbits_t PORTAbits;
192 #define _RA0 0x01
193 #define _RA1 0x02
194 #define _RA2 0x04
195 #define _RA3 0x08
196 #define _RA4 0x10
197 #define _RA5 0x20
199 //==============================================================================
202 //==============================================================================
203 // PORTB Bits
205 extern __at(0x0006) __sfr PORTB;
207 typedef struct
209 unsigned : 1;
210 unsigned : 1;
211 unsigned : 1;
212 unsigned : 1;
213 unsigned RB4 : 1;
214 unsigned RB5 : 1;
215 unsigned RB6 : 1;
216 unsigned RB7 : 1;
217 } __PORTBbits_t;
219 extern __at(0x0006) volatile __PORTBbits_t PORTBbits;
221 #define _RB4 0x10
222 #define _RB5 0x20
223 #define _RB6 0x40
224 #define _RB7 0x80
226 //==============================================================================
229 //==============================================================================
230 // PORTC Bits
232 extern __at(0x0007) __sfr PORTC;
234 typedef struct
236 unsigned RC0 : 1;
237 unsigned RC1 : 1;
238 unsigned RC2 : 1;
239 unsigned RC3 : 1;
240 unsigned RC4 : 1;
241 unsigned RC5 : 1;
242 unsigned RC6 : 1;
243 unsigned RC7 : 1;
244 } __PORTCbits_t;
246 extern __at(0x0007) volatile __PORTCbits_t PORTCbits;
248 #define _RC0 0x01
249 #define _RC1 0x02
250 #define _RC2 0x04
251 #define _RC3 0x08
252 #define _RC4 0x10
253 #define _RC5 0x20
254 #define _RC6 0x40
255 #define _RC7 0x80
257 //==============================================================================
259 extern __at(0x000A) __sfr PCLATH;
261 //==============================================================================
262 // INTCON Bits
264 extern __at(0x000B) __sfr INTCON;
266 typedef struct
268 unsigned RABIF : 1;
269 unsigned INTF : 1;
270 unsigned T0IF : 1;
271 unsigned RABIE : 1;
272 unsigned INTE : 1;
273 unsigned T0IE : 1;
274 unsigned PEIE : 1;
275 unsigned GIE : 1;
276 } __INTCONbits_t;
278 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
280 #define _RABIF 0x01
281 #define _INTF 0x02
282 #define _T0IF 0x04
283 #define _RABIE 0x08
284 #define _INTE 0x10
285 #define _T0IE 0x20
286 #define _PEIE 0x40
287 #define _GIE 0x80
289 //==============================================================================
292 //==============================================================================
293 // PIR1 Bits
295 extern __at(0x000C) __sfr PIR1;
297 typedef union
299 struct
301 unsigned TMR1IF : 1;
302 unsigned TMR2IF : 1;
303 unsigned CCP1IF : 1;
304 unsigned SSPIF : 1;
305 unsigned TXIF : 1;
306 unsigned RCIF : 1;
307 unsigned ADIF : 1;
308 unsigned : 1;
311 struct
313 unsigned T1IF : 1;
314 unsigned T2IF : 1;
315 unsigned : 1;
316 unsigned : 1;
317 unsigned : 1;
318 unsigned : 1;
319 unsigned : 1;
320 unsigned : 1;
322 } __PIR1bits_t;
324 extern __at(0x000C) volatile __PIR1bits_t PIR1bits;
326 #define _TMR1IF 0x01
327 #define _T1IF 0x01
328 #define _TMR2IF 0x02
329 #define _T2IF 0x02
330 #define _CCP1IF 0x04
331 #define _SSPIF 0x08
332 #define _TXIF 0x10
333 #define _RCIF 0x20
334 #define _ADIF 0x40
336 //==============================================================================
339 //==============================================================================
340 // PIR2 Bits
342 extern __at(0x000D) __sfr PIR2;
344 typedef struct
346 unsigned : 1;
347 unsigned : 1;
348 unsigned : 1;
349 unsigned : 1;
350 unsigned EEIF : 1;
351 unsigned C1IF : 1;
352 unsigned C2IF : 1;
353 unsigned OSFIF : 1;
354 } __PIR2bits_t;
356 extern __at(0x000D) volatile __PIR2bits_t PIR2bits;
358 #define _EEIF 0x10
359 #define _C1IF 0x20
360 #define _C2IF 0x40
361 #define _OSFIF 0x80
363 //==============================================================================
365 extern __at(0x000E) __sfr TMR1;
366 extern __at(0x000E) __sfr TMR1L;
367 extern __at(0x000F) __sfr TMR1H;
369 //==============================================================================
370 // T1CON Bits
372 extern __at(0x0010) __sfr T1CON;
374 typedef union
376 struct
378 unsigned TMR1ON : 1;
379 unsigned TMR1CS : 1;
380 unsigned NOT_T1SYNC : 1;
381 unsigned T1OSCEN : 1;
382 unsigned T1CKPS0 : 1;
383 unsigned T1CKPS1 : 1;
384 unsigned TMR1GE : 1;
385 unsigned T1GINV : 1;
388 struct
390 unsigned : 4;
391 unsigned T1CKPS : 2;
392 unsigned : 2;
394 } __T1CONbits_t;
396 extern __at(0x0010) volatile __T1CONbits_t T1CONbits;
398 #define _TMR1ON 0x01
399 #define _TMR1CS 0x02
400 #define _NOT_T1SYNC 0x04
401 #define _T1OSCEN 0x08
402 #define _T1CKPS0 0x10
403 #define _T1CKPS1 0x20
404 #define _TMR1GE 0x40
405 #define _T1GINV 0x80
407 //==============================================================================
409 extern __at(0x0011) __sfr TMR2;
411 //==============================================================================
412 // T2CON Bits
414 extern __at(0x0012) __sfr T2CON;
416 typedef union
418 struct
420 unsigned T2CKPS0 : 1;
421 unsigned T2CKPS1 : 1;
422 unsigned TMR2ON : 1;
423 unsigned TOUTPS0 : 1;
424 unsigned TOUTPS1 : 1;
425 unsigned TOUTPS2 : 1;
426 unsigned TOUTPS3 : 1;
427 unsigned : 1;
430 struct
432 unsigned T2CKPS : 2;
433 unsigned : 6;
436 struct
438 unsigned : 3;
439 unsigned TOUTPS : 4;
440 unsigned : 1;
442 } __T2CONbits_t;
444 extern __at(0x0012) volatile __T2CONbits_t T2CONbits;
446 #define _T2CKPS0 0x01
447 #define _T2CKPS1 0x02
448 #define _TMR2ON 0x04
449 #define _TOUTPS0 0x08
450 #define _TOUTPS1 0x10
451 #define _TOUTPS2 0x20
452 #define _TOUTPS3 0x40
454 //==============================================================================
456 extern __at(0x0013) __sfr SSPBUF;
458 //==============================================================================
459 // SSPCON Bits
461 extern __at(0x0014) __sfr SSPCON;
463 typedef union
465 struct
467 unsigned SSPM0 : 1;
468 unsigned SSPM1 : 1;
469 unsigned SSPM2 : 1;
470 unsigned SSPM3 : 1;
471 unsigned CKP : 1;
472 unsigned SSPEN : 1;
473 unsigned SSPOV : 1;
474 unsigned WCOL : 1;
477 struct
479 unsigned SSPM : 4;
480 unsigned : 4;
482 } __SSPCONbits_t;
484 extern __at(0x0014) volatile __SSPCONbits_t SSPCONbits;
486 #define _SSPM0 0x01
487 #define _SSPM1 0x02
488 #define _SSPM2 0x04
489 #define _SSPM3 0x08
490 #define _CKP 0x10
491 #define _SSPEN 0x20
492 #define _SSPOV 0x40
493 #define _WCOL 0x80
495 //==============================================================================
497 extern __at(0x0015) __sfr CCPR;
498 extern __at(0x0015) __sfr CCPR1L;
499 extern __at(0x0016) __sfr CCPR1H;
501 //==============================================================================
502 // CCP1CON Bits
504 extern __at(0x0017) __sfr CCP1CON;
506 typedef union
508 struct
510 unsigned CCP1M0 : 1;
511 unsigned CCP1M1 : 1;
512 unsigned CCP1M2 : 1;
513 unsigned CCP1M3 : 1;
514 unsigned DC1B0 : 1;
515 unsigned DC1B1 : 1;
516 unsigned P1M0 : 1;
517 unsigned P1M1 : 1;
520 struct
522 unsigned CCP1M : 4;
523 unsigned : 4;
526 struct
528 unsigned : 4;
529 unsigned DC1B : 2;
530 unsigned : 2;
533 struct
535 unsigned : 6;
536 unsigned P1M : 2;
538 } __CCP1CONbits_t;
540 extern __at(0x0017) volatile __CCP1CONbits_t CCP1CONbits;
542 #define _CCP1M0 0x01
543 #define _CCP1M1 0x02
544 #define _CCP1M2 0x04
545 #define _CCP1M3 0x08
546 #define _DC1B0 0x10
547 #define _DC1B1 0x20
548 #define _P1M0 0x40
549 #define _P1M1 0x80
551 //==============================================================================
554 //==============================================================================
555 // RCSTA Bits
557 extern __at(0x0018) __sfr RCSTA;
559 typedef struct
561 unsigned RX9D : 1;
562 unsigned OERR : 1;
563 unsigned FERR : 1;
564 unsigned ADDEN : 1;
565 unsigned CREN : 1;
566 unsigned SREN : 1;
567 unsigned RX9 : 1;
568 unsigned SPEN : 1;
569 } __RCSTAbits_t;
571 extern __at(0x0018) volatile __RCSTAbits_t RCSTAbits;
573 #define _RX9D 0x01
574 #define _OERR 0x02
575 #define _FERR 0x04
576 #define _ADDEN 0x08
577 #define _CREN 0x10
578 #define _SREN 0x20
579 #define _RX9 0x40
580 #define _SPEN 0x80
582 //==============================================================================
584 extern __at(0x0019) __sfr TXREG;
585 extern __at(0x001A) __sfr RCREG;
587 //==============================================================================
588 // PWM1CON Bits
590 extern __at(0x001C) __sfr PWM1CON;
592 typedef union
594 struct
596 unsigned PDC0 : 1;
597 unsigned PDC1 : 1;
598 unsigned PDC2 : 1;
599 unsigned PDC3 : 1;
600 unsigned PDC4 : 1;
601 unsigned PDC5 : 1;
602 unsigned PDC6 : 1;
603 unsigned PRSEN : 1;
606 struct
608 unsigned PDC : 7;
609 unsigned : 1;
611 } __PWM1CONbits_t;
613 extern __at(0x001C) volatile __PWM1CONbits_t PWM1CONbits;
615 #define _PDC0 0x01
616 #define _PDC1 0x02
617 #define _PDC2 0x04
618 #define _PDC3 0x08
619 #define _PDC4 0x10
620 #define _PDC5 0x20
621 #define _PDC6 0x40
622 #define _PRSEN 0x80
624 //==============================================================================
627 //==============================================================================
628 // ECCPAS Bits
630 extern __at(0x001D) __sfr ECCPAS;
632 typedef union
634 struct
636 unsigned PSSBD0 : 1;
637 unsigned PSSBD1 : 1;
638 unsigned PSSAC0 : 1;
639 unsigned PSSAC1 : 1;
640 unsigned ECCPAS0 : 1;
641 unsigned ECCPAS1 : 1;
642 unsigned ECCPAS2 : 1;
643 unsigned ECCPASE : 1;
646 struct
648 unsigned PSSBD : 2;
649 unsigned : 6;
652 struct
654 unsigned : 2;
655 unsigned PSSAC : 2;
656 unsigned : 4;
659 struct
661 unsigned : 4;
662 unsigned ECCPAS : 3;
663 unsigned : 1;
665 } __ECCPASbits_t;
667 extern __at(0x001D) volatile __ECCPASbits_t ECCPASbits;
669 #define _PSSBD0 0x01
670 #define _PSSBD1 0x02
671 #define _PSSAC0 0x04
672 #define _PSSAC1 0x08
673 #define _ECCPAS0 0x10
674 #define _ECCPAS1 0x20
675 #define _ECCPAS2 0x40
676 #define _ECCPASE 0x80
678 //==============================================================================
680 extern __at(0x001E) __sfr ADRESH;
682 //==============================================================================
683 // ADCON0 Bits
685 extern __at(0x001F) __sfr ADCON0;
687 typedef union
689 struct
691 unsigned ADON : 1;
692 unsigned GO_NOT_DONE : 1;
693 unsigned CHS0 : 1;
694 unsigned CHS1 : 1;
695 unsigned CHS2 : 1;
696 unsigned CHS3 : 1;
697 unsigned VCFG : 1;
698 unsigned ADFM : 1;
701 struct
703 unsigned : 1;
704 unsigned GO : 1;
705 unsigned : 1;
706 unsigned : 1;
707 unsigned : 1;
708 unsigned : 1;
709 unsigned : 1;
710 unsigned : 1;
713 struct
715 unsigned : 1;
716 unsigned NOT_DONE : 1;
717 unsigned : 1;
718 unsigned : 1;
719 unsigned : 1;
720 unsigned : 1;
721 unsigned : 1;
722 unsigned : 1;
725 struct
727 unsigned : 1;
728 unsigned GO_DONE : 1;
729 unsigned : 1;
730 unsigned : 1;
731 unsigned : 1;
732 unsigned : 1;
733 unsigned : 1;
734 unsigned : 1;
737 struct
739 unsigned : 2;
740 unsigned CHS : 4;
741 unsigned : 2;
743 } __ADCON0bits_t;
745 extern __at(0x001F) volatile __ADCON0bits_t ADCON0bits;
747 #define _ADON 0x01
748 #define _GO_NOT_DONE 0x02
749 #define _GO 0x02
750 #define _NOT_DONE 0x02
751 #define _GO_DONE 0x02
752 #define _CHS0 0x04
753 #define _CHS1 0x08
754 #define _CHS2 0x10
755 #define _CHS3 0x20
756 #define _VCFG 0x40
757 #define _ADFM 0x80
759 //==============================================================================
762 //==============================================================================
763 // OPTION_REG Bits
765 extern __at(0x0081) __sfr OPTION_REG;
767 typedef union
769 struct
771 unsigned PS0 : 1;
772 unsigned PS1 : 1;
773 unsigned PS2 : 1;
774 unsigned PSA : 1;
775 unsigned T0SE : 1;
776 unsigned T0CS : 1;
777 unsigned INTEDG : 1;
778 unsigned NOT_RABPU : 1;
781 struct
783 unsigned PS : 3;
784 unsigned : 5;
786 } __OPTION_REGbits_t;
788 extern __at(0x0081) volatile __OPTION_REGbits_t OPTION_REGbits;
790 #define _PS0 0x01
791 #define _PS1 0x02
792 #define _PS2 0x04
793 #define _PSA 0x08
794 #define _T0SE 0x10
795 #define _T0CS 0x20
796 #define _INTEDG 0x40
797 #define _NOT_RABPU 0x80
799 //==============================================================================
802 //==============================================================================
803 // TRISA Bits
805 extern __at(0x0085) __sfr TRISA;
807 typedef union
809 struct
811 unsigned TRISA0 : 1;
812 unsigned TRISA1 : 1;
813 unsigned TRISA2 : 1;
814 unsigned TRISA3 : 1;
815 unsigned TRISA4 : 1;
816 unsigned TRISA5 : 1;
817 unsigned : 1;
818 unsigned : 1;
821 struct
823 unsigned TRISA : 6;
824 unsigned : 2;
826 } __TRISAbits_t;
828 extern __at(0x0085) volatile __TRISAbits_t TRISAbits;
830 #define _TRISA0 0x01
831 #define _TRISA1 0x02
832 #define _TRISA2 0x04
833 #define _TRISA3 0x08
834 #define _TRISA4 0x10
835 #define _TRISA5 0x20
837 //==============================================================================
840 //==============================================================================
841 // TRISB Bits
843 extern __at(0x0086) __sfr TRISB;
845 typedef struct
847 unsigned : 1;
848 unsigned : 1;
849 unsigned : 1;
850 unsigned : 1;
851 unsigned TRISB4 : 1;
852 unsigned TRISB5 : 1;
853 unsigned TRISB6 : 1;
854 unsigned TRISB7 : 1;
855 } __TRISBbits_t;
857 extern __at(0x0086) volatile __TRISBbits_t TRISBbits;
859 #define _TRISB4 0x10
860 #define _TRISB5 0x20
861 #define _TRISB6 0x40
862 #define _TRISB7 0x80
864 //==============================================================================
867 //==============================================================================
868 // TRISC Bits
870 extern __at(0x0087) __sfr TRISC;
872 typedef struct
874 unsigned TRISC0 : 1;
875 unsigned TRISC1 : 1;
876 unsigned TRISC2 : 1;
877 unsigned TRISC3 : 1;
878 unsigned TRISC4 : 1;
879 unsigned TRISC5 : 1;
880 unsigned TRISC6 : 1;
881 unsigned TRISC7 : 1;
882 } __TRISCbits_t;
884 extern __at(0x0087) volatile __TRISCbits_t TRISCbits;
886 #define _TRISC0 0x01
887 #define _TRISC1 0x02
888 #define _TRISC2 0x04
889 #define _TRISC3 0x08
890 #define _TRISC4 0x10
891 #define _TRISC5 0x20
892 #define _TRISC6 0x40
893 #define _TRISC7 0x80
895 //==============================================================================
898 //==============================================================================
899 // PIE1 Bits
901 extern __at(0x008C) __sfr PIE1;
903 typedef union
905 struct
907 unsigned TMR1IE : 1;
908 unsigned TMR2IE : 1;
909 unsigned CCP1IE : 1;
910 unsigned SSPIE : 1;
911 unsigned TXIE : 1;
912 unsigned RCIE : 1;
913 unsigned ADIE : 1;
914 unsigned : 1;
917 struct
919 unsigned T1IE : 1;
920 unsigned T2IE : 1;
921 unsigned : 1;
922 unsigned : 1;
923 unsigned : 1;
924 unsigned : 1;
925 unsigned : 1;
926 unsigned : 1;
928 } __PIE1bits_t;
930 extern __at(0x008C) volatile __PIE1bits_t PIE1bits;
932 #define _TMR1IE 0x01
933 #define _T1IE 0x01
934 #define _TMR2IE 0x02
935 #define _T2IE 0x02
936 #define _CCP1IE 0x04
937 #define _SSPIE 0x08
938 #define _TXIE 0x10
939 #define _RCIE 0x20
940 #define _ADIE 0x40
942 //==============================================================================
945 //==============================================================================
946 // PIE2 Bits
948 extern __at(0x008D) __sfr PIE2;
950 typedef struct
952 unsigned : 1;
953 unsigned : 1;
954 unsigned : 1;
955 unsigned : 1;
956 unsigned EEIE : 1;
957 unsigned C1IE : 1;
958 unsigned C2IE : 1;
959 unsigned OSFIE : 1;
960 } __PIE2bits_t;
962 extern __at(0x008D) volatile __PIE2bits_t PIE2bits;
964 #define _EEIE 0x10
965 #define _C1IE 0x20
966 #define _C2IE 0x40
967 #define _OSFIE 0x80
969 //==============================================================================
972 //==============================================================================
973 // PCON Bits
975 extern __at(0x008E) __sfr PCON;
977 typedef struct
979 unsigned NOT_BOR : 1;
980 unsigned NOT_POR : 1;
981 unsigned : 1;
982 unsigned : 1;
983 unsigned SBOREN : 1;
984 unsigned ULPWUE : 1;
985 unsigned : 1;
986 unsigned : 1;
987 } __PCONbits_t;
989 extern __at(0x008E) volatile __PCONbits_t PCONbits;
991 #define _NOT_BOR 0x01
992 #define _NOT_POR 0x02
993 #define _SBOREN 0x10
994 #define _ULPWUE 0x20
996 //==============================================================================
999 //==============================================================================
1000 // OSCCON Bits
1002 extern __at(0x008F) __sfr OSCCON;
1004 typedef union
1006 struct
1008 unsigned SCS : 1;
1009 unsigned LTS : 1;
1010 unsigned HTS : 1;
1011 unsigned OSTS : 1;
1012 unsigned IRCF0 : 1;
1013 unsigned IRCF1 : 1;
1014 unsigned IRCF2 : 1;
1015 unsigned : 1;
1018 struct
1020 unsigned : 4;
1021 unsigned IRCF : 3;
1022 unsigned : 1;
1024 } __OSCCONbits_t;
1026 extern __at(0x008F) volatile __OSCCONbits_t OSCCONbits;
1028 #define _SCS 0x01
1029 #define _LTS 0x02
1030 #define _HTS 0x04
1031 #define _OSTS 0x08
1032 #define _IRCF0 0x10
1033 #define _IRCF1 0x20
1034 #define _IRCF2 0x40
1036 //==============================================================================
1039 //==============================================================================
1040 // OSCTUNE Bits
1042 extern __at(0x0090) __sfr OSCTUNE;
1044 typedef union
1046 struct
1048 unsigned TUN0 : 1;
1049 unsigned TUN1 : 1;
1050 unsigned TUN2 : 1;
1051 unsigned TUN3 : 1;
1052 unsigned TUN4 : 1;
1053 unsigned : 1;
1054 unsigned : 1;
1055 unsigned : 1;
1058 struct
1060 unsigned TUN : 5;
1061 unsigned : 3;
1063 } __OSCTUNEbits_t;
1065 extern __at(0x0090) volatile __OSCTUNEbits_t OSCTUNEbits;
1067 #define _TUN0 0x01
1068 #define _TUN1 0x02
1069 #define _TUN2 0x04
1070 #define _TUN3 0x08
1071 #define _TUN4 0x10
1073 //==============================================================================
1075 extern __at(0x0092) __sfr PR2;
1077 //==============================================================================
1078 // MSK Bits
1080 extern __at(0x0093) __sfr MSK;
1082 typedef struct
1084 unsigned MSK0 : 1;
1085 unsigned MSK1 : 1;
1086 unsigned MSK2 : 1;
1087 unsigned MSK3 : 1;
1088 unsigned MSK4 : 1;
1089 unsigned MSK5 : 1;
1090 unsigned MSK6 : 1;
1091 unsigned MSK7 : 1;
1092 } __MSKbits_t;
1094 extern __at(0x0093) volatile __MSKbits_t MSKbits;
1096 #define _MSK0 0x01
1097 #define _MSK1 0x02
1098 #define _MSK2 0x04
1099 #define _MSK3 0x08
1100 #define _MSK4 0x10
1101 #define _MSK5 0x20
1102 #define _MSK6 0x40
1103 #define _MSK7 0x80
1105 //==============================================================================
1107 extern __at(0x0093) __sfr SSPADD;
1109 //==============================================================================
1110 // SSPMSK Bits
1112 extern __at(0x0093) __sfr SSPMSK;
1114 typedef struct
1116 unsigned MSK0 : 1;
1117 unsigned MSK1 : 1;
1118 unsigned MSK2 : 1;
1119 unsigned MSK3 : 1;
1120 unsigned MSK4 : 1;
1121 unsigned MSK5 : 1;
1122 unsigned MSK6 : 1;
1123 unsigned MSK7 : 1;
1124 } __SSPMSKbits_t;
1126 extern __at(0x0093) volatile __SSPMSKbits_t SSPMSKbits;
1128 #define _SSPMSK_MSK0 0x01
1129 #define _SSPMSK_MSK1 0x02
1130 #define _SSPMSK_MSK2 0x04
1131 #define _SSPMSK_MSK3 0x08
1132 #define _SSPMSK_MSK4 0x10
1133 #define _SSPMSK_MSK5 0x20
1134 #define _SSPMSK_MSK6 0x40
1135 #define _SSPMSK_MSK7 0x80
1137 //==============================================================================
1140 //==============================================================================
1141 // SSPSTAT Bits
1143 extern __at(0x0094) __sfr SSPSTAT;
1145 typedef union
1147 struct
1149 unsigned BF : 1;
1150 unsigned UA : 1;
1151 unsigned R_NOT_W : 1;
1152 unsigned S : 1;
1153 unsigned P : 1;
1154 unsigned D_NOT_A : 1;
1155 unsigned CKE : 1;
1156 unsigned SMP : 1;
1159 struct
1161 unsigned : 1;
1162 unsigned : 1;
1163 unsigned R : 1;
1164 unsigned I2C_START : 1;
1165 unsigned I2C_STOP : 1;
1166 unsigned D : 1;
1167 unsigned : 1;
1168 unsigned : 1;
1171 struct
1173 unsigned : 1;
1174 unsigned : 1;
1175 unsigned I2C_READ : 1;
1176 unsigned : 1;
1177 unsigned : 1;
1178 unsigned I2C_DATA : 1;
1179 unsigned : 1;
1180 unsigned : 1;
1183 struct
1185 unsigned : 1;
1186 unsigned : 1;
1187 unsigned NOT_W : 1;
1188 unsigned : 1;
1189 unsigned : 1;
1190 unsigned NOT_A : 1;
1191 unsigned : 1;
1192 unsigned : 1;
1195 struct
1197 unsigned : 1;
1198 unsigned : 1;
1199 unsigned NOT_WRITE : 1;
1200 unsigned : 1;
1201 unsigned : 1;
1202 unsigned NOT_ADDRESS : 1;
1203 unsigned : 1;
1204 unsigned : 1;
1207 struct
1209 unsigned : 1;
1210 unsigned : 1;
1211 unsigned R_W : 1;
1212 unsigned : 1;
1213 unsigned : 1;
1214 unsigned D_A : 1;
1215 unsigned : 1;
1216 unsigned : 1;
1219 struct
1221 unsigned : 1;
1222 unsigned : 1;
1223 unsigned READ_WRITE : 1;
1224 unsigned : 1;
1225 unsigned : 1;
1226 unsigned DATA_ADDRESS : 1;
1227 unsigned : 1;
1228 unsigned : 1;
1230 } __SSPSTATbits_t;
1232 extern __at(0x0094) volatile __SSPSTATbits_t SSPSTATbits;
1234 #define _BF 0x01
1235 #define _UA 0x02
1236 #define _R_NOT_W 0x04
1237 #define _R 0x04
1238 #define _I2C_READ 0x04
1239 #define _NOT_W 0x04
1240 #define _NOT_WRITE 0x04
1241 #define _R_W 0x04
1242 #define _READ_WRITE 0x04
1243 #define _S 0x08
1244 #define _I2C_START 0x08
1245 #define _P 0x10
1246 #define _I2C_STOP 0x10
1247 #define _D_NOT_A 0x20
1248 #define _D 0x20
1249 #define _I2C_DATA 0x20
1250 #define _NOT_A 0x20
1251 #define _NOT_ADDRESS 0x20
1252 #define _D_A 0x20
1253 #define _DATA_ADDRESS 0x20
1254 #define _CKE 0x40
1255 #define _SMP 0x80
1257 //==============================================================================
1260 //==============================================================================
1261 // WPU Bits
1263 extern __at(0x0095) __sfr WPU;
1265 typedef union
1267 struct
1269 unsigned WPUA0 : 1;
1270 unsigned WPUA1 : 1;
1271 unsigned WPUA2 : 1;
1272 unsigned : 1;
1273 unsigned WPUA4 : 1;
1274 unsigned WPUA5 : 1;
1275 unsigned : 1;
1276 unsigned : 1;
1279 struct
1281 unsigned WPU0 : 1;
1282 unsigned WPU1 : 1;
1283 unsigned WPU2 : 1;
1284 unsigned : 1;
1285 unsigned WPU4 : 1;
1286 unsigned WPU5 : 1;
1287 unsigned : 1;
1288 unsigned : 1;
1290 } __WPUbits_t;
1292 extern __at(0x0095) volatile __WPUbits_t WPUbits;
1294 #define _WPUA0 0x01
1295 #define _WPU0 0x01
1296 #define _WPUA1 0x02
1297 #define _WPU1 0x02
1298 #define _WPUA2 0x04
1299 #define _WPU2 0x04
1300 #define _WPUA4 0x10
1301 #define _WPU4 0x10
1302 #define _WPUA5 0x20
1303 #define _WPU5 0x20
1305 //==============================================================================
1308 //==============================================================================
1309 // WPUA Bits
1311 extern __at(0x0095) __sfr WPUA;
1313 typedef union
1315 struct
1317 unsigned WPUA0 : 1;
1318 unsigned WPUA1 : 1;
1319 unsigned WPUA2 : 1;
1320 unsigned : 1;
1321 unsigned WPUA4 : 1;
1322 unsigned WPUA5 : 1;
1323 unsigned : 1;
1324 unsigned : 1;
1327 struct
1329 unsigned WPU0 : 1;
1330 unsigned WPU1 : 1;
1331 unsigned WPU2 : 1;
1332 unsigned : 1;
1333 unsigned WPU4 : 1;
1334 unsigned WPU5 : 1;
1335 unsigned : 1;
1336 unsigned : 1;
1338 } __WPUAbits_t;
1340 extern __at(0x0095) volatile __WPUAbits_t WPUAbits;
1342 #define _WPUA_WPUA0 0x01
1343 #define _WPUA_WPU0 0x01
1344 #define _WPUA_WPUA1 0x02
1345 #define _WPUA_WPU1 0x02
1346 #define _WPUA_WPUA2 0x04
1347 #define _WPUA_WPU2 0x04
1348 #define _WPUA_WPUA4 0x10
1349 #define _WPUA_WPU4 0x10
1350 #define _WPUA_WPUA5 0x20
1351 #define _WPUA_WPU5 0x20
1353 //==============================================================================
1356 //==============================================================================
1357 // IOC Bits
1359 extern __at(0x0096) __sfr IOC;
1361 typedef union
1363 struct
1365 unsigned IOCA0 : 1;
1366 unsigned IOCA1 : 1;
1367 unsigned IOCA2 : 1;
1368 unsigned IOCA3 : 1;
1369 unsigned IOCA4 : 1;
1370 unsigned IOCA5 : 1;
1371 unsigned : 1;
1372 unsigned : 1;
1375 struct
1377 unsigned IOC0 : 1;
1378 unsigned IOC1 : 1;
1379 unsigned IOC2 : 1;
1380 unsigned IOC3 : 1;
1381 unsigned IOC4 : 1;
1382 unsigned IOC5 : 1;
1383 unsigned : 1;
1384 unsigned : 1;
1387 struct
1389 unsigned IOC : 6;
1390 unsigned : 2;
1393 struct
1395 unsigned IOCA : 6;
1396 unsigned : 2;
1398 } __IOCbits_t;
1400 extern __at(0x0096) volatile __IOCbits_t IOCbits;
1402 #define _IOCA0 0x01
1403 #define _IOC0 0x01
1404 #define _IOCA1 0x02
1405 #define _IOC1 0x02
1406 #define _IOCA2 0x04
1407 #define _IOC2 0x04
1408 #define _IOCA3 0x08
1409 #define _IOC3 0x08
1410 #define _IOCA4 0x10
1411 #define _IOC4 0x10
1412 #define _IOCA5 0x20
1413 #define _IOC5 0x20
1415 //==============================================================================
1418 //==============================================================================
1419 // IOCA Bits
1421 extern __at(0x0096) __sfr IOCA;
1423 typedef union
1425 struct
1427 unsigned IOCA0 : 1;
1428 unsigned IOCA1 : 1;
1429 unsigned IOCA2 : 1;
1430 unsigned IOCA3 : 1;
1431 unsigned IOCA4 : 1;
1432 unsigned IOCA5 : 1;
1433 unsigned : 1;
1434 unsigned : 1;
1437 struct
1439 unsigned IOC0 : 1;
1440 unsigned IOC1 : 1;
1441 unsigned IOC2 : 1;
1442 unsigned IOC3 : 1;
1443 unsigned IOC4 : 1;
1444 unsigned IOC5 : 1;
1445 unsigned : 1;
1446 unsigned : 1;
1449 struct
1451 unsigned IOCA : 6;
1452 unsigned : 2;
1455 struct
1457 unsigned IOC : 6;
1458 unsigned : 2;
1460 } __IOCAbits_t;
1462 extern __at(0x0096) volatile __IOCAbits_t IOCAbits;
1464 #define _IOCA_IOCA0 0x01
1465 #define _IOCA_IOC0 0x01
1466 #define _IOCA_IOCA1 0x02
1467 #define _IOCA_IOC1 0x02
1468 #define _IOCA_IOCA2 0x04
1469 #define _IOCA_IOC2 0x04
1470 #define _IOCA_IOCA3 0x08
1471 #define _IOCA_IOC3 0x08
1472 #define _IOCA_IOCA4 0x10
1473 #define _IOCA_IOC4 0x10
1474 #define _IOCA_IOCA5 0x20
1475 #define _IOCA_IOC5 0x20
1477 //==============================================================================
1480 //==============================================================================
1481 // WDTCON Bits
1483 extern __at(0x0097) __sfr WDTCON;
1485 typedef union
1487 struct
1489 unsigned SWDTEN : 1;
1490 unsigned WDTPS0 : 1;
1491 unsigned WDTPS1 : 1;
1492 unsigned WDTPS2 : 1;
1493 unsigned WDTPS3 : 1;
1494 unsigned : 1;
1495 unsigned : 1;
1496 unsigned : 1;
1499 struct
1501 unsigned : 1;
1502 unsigned WDTPS : 4;
1503 unsigned : 3;
1505 } __WDTCONbits_t;
1507 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
1509 #define _SWDTEN 0x01
1510 #define _WDTPS0 0x02
1511 #define _WDTPS1 0x04
1512 #define _WDTPS2 0x08
1513 #define _WDTPS3 0x10
1515 //==============================================================================
1518 //==============================================================================
1519 // TXSTA Bits
1521 extern __at(0x0098) __sfr TXSTA;
1523 typedef union
1525 struct
1527 unsigned TX9D : 1;
1528 unsigned TRMT : 1;
1529 unsigned BRGH : 1;
1530 unsigned SENDB : 1;
1531 unsigned SYNC : 1;
1532 unsigned TXEN : 1;
1533 unsigned TX9 : 1;
1534 unsigned CSRC : 1;
1537 struct
1539 unsigned : 1;
1540 unsigned : 1;
1541 unsigned : 1;
1542 unsigned SENB : 1;
1543 unsigned : 1;
1544 unsigned : 1;
1545 unsigned : 1;
1546 unsigned : 1;
1548 } __TXSTAbits_t;
1550 extern __at(0x0098) volatile __TXSTAbits_t TXSTAbits;
1552 #define _TX9D 0x01
1553 #define _TRMT 0x02
1554 #define _BRGH 0x04
1555 #define _SENDB 0x08
1556 #define _SENB 0x08
1557 #define _SYNC 0x10
1558 #define _TXEN 0x20
1559 #define _TX9 0x40
1560 #define _CSRC 0x80
1562 //==============================================================================
1565 //==============================================================================
1566 // SPBRG Bits
1568 extern __at(0x0099) __sfr SPBRG;
1570 typedef struct
1572 unsigned BRG0 : 1;
1573 unsigned BRG1 : 1;
1574 unsigned BRG2 : 1;
1575 unsigned BRG3 : 1;
1576 unsigned BRG4 : 1;
1577 unsigned BRG5 : 1;
1578 unsigned BRG6 : 1;
1579 unsigned BRG7 : 1;
1580 } __SPBRGbits_t;
1582 extern __at(0x0099) volatile __SPBRGbits_t SPBRGbits;
1584 #define _BRG0 0x01
1585 #define _BRG1 0x02
1586 #define _BRG2 0x04
1587 #define _BRG3 0x08
1588 #define _BRG4 0x10
1589 #define _BRG5 0x20
1590 #define _BRG6 0x40
1591 #define _BRG7 0x80
1593 //==============================================================================
1596 //==============================================================================
1597 // SPBRGH Bits
1599 extern __at(0x009A) __sfr SPBRGH;
1601 typedef struct
1603 unsigned BRG8 : 1;
1604 unsigned BRG9 : 1;
1605 unsigned BRG10 : 1;
1606 unsigned BRG11 : 1;
1607 unsigned BRG12 : 1;
1608 unsigned BRG13 : 1;
1609 unsigned BRG14 : 1;
1610 unsigned BRG15 : 1;
1611 } __SPBRGHbits_t;
1613 extern __at(0x009A) volatile __SPBRGHbits_t SPBRGHbits;
1615 #define _BRG8 0x01
1616 #define _BRG9 0x02
1617 #define _BRG10 0x04
1618 #define _BRG11 0x08
1619 #define _BRG12 0x10
1620 #define _BRG13 0x20
1621 #define _BRG14 0x40
1622 #define _BRG15 0x80
1624 //==============================================================================
1627 //==============================================================================
1628 // BAUDCTL Bits
1630 extern __at(0x009B) __sfr BAUDCTL;
1632 #define BAUDCON BAUDCTL
1634 typedef struct
1636 unsigned ABDEN : 1;
1637 unsigned WUE : 1;
1638 unsigned : 1;
1639 unsigned BRG16 : 1;
1640 unsigned SCKP : 1;
1641 unsigned : 1;
1642 unsigned RCIDL : 1;
1643 unsigned ABDOVF : 1;
1644 } __BAUDCTLbits_t;
1646 extern __at(0x009B) volatile __BAUDCTLbits_t BAUDCTLbits;
1648 #define BAUDCONbits BAUDCTLbits
1650 #define _ABDEN 0x01
1651 #define _WUE 0x02
1652 #define _BRG16 0x08
1653 #define _SCKP 0x10
1654 #define _RCIDL 0x40
1655 #define _ABDOVF 0x80
1657 //==============================================================================
1659 extern __at(0x009E) __sfr ADRESL;
1661 //==============================================================================
1662 // ADCON1 Bits
1664 extern __at(0x009F) __sfr ADCON1;
1666 typedef union
1668 struct
1670 unsigned : 1;
1671 unsigned : 1;
1672 unsigned : 1;
1673 unsigned : 1;
1674 unsigned ADCS0 : 1;
1675 unsigned ADCS1 : 1;
1676 unsigned ADCS2 : 1;
1677 unsigned : 1;
1680 struct
1682 unsigned : 4;
1683 unsigned ADCS : 3;
1684 unsigned : 1;
1686 } __ADCON1bits_t;
1688 extern __at(0x009F) volatile __ADCON1bits_t ADCON1bits;
1690 #define _ADCS0 0x10
1691 #define _ADCS1 0x20
1692 #define _ADCS2 0x40
1694 //==============================================================================
1696 extern __at(0x010C) __sfr EEDAT;
1697 extern __at(0x010C) __sfr EEDATA;
1698 extern __at(0x010D) __sfr EEADR;
1699 extern __at(0x010E) __sfr EEDATH;
1700 extern __at(0x010F) __sfr EEADRH;
1702 //==============================================================================
1703 // WPUB Bits
1705 extern __at(0x0115) __sfr WPUB;
1707 typedef struct
1709 unsigned : 1;
1710 unsigned : 1;
1711 unsigned : 1;
1712 unsigned : 1;
1713 unsigned WPUB4 : 1;
1714 unsigned WPUB5 : 1;
1715 unsigned WPUB6 : 1;
1716 unsigned WPUB7 : 1;
1717 } __WPUBbits_t;
1719 extern __at(0x0115) volatile __WPUBbits_t WPUBbits;
1721 #define _WPUB4 0x10
1722 #define _WPUB5 0x20
1723 #define _WPUB6 0x40
1724 #define _WPUB7 0x80
1726 //==============================================================================
1729 //==============================================================================
1730 // IOCB Bits
1732 extern __at(0x0116) __sfr IOCB;
1734 typedef struct
1736 unsigned : 1;
1737 unsigned : 1;
1738 unsigned : 1;
1739 unsigned : 1;
1740 unsigned IOCB4 : 1;
1741 unsigned IOCB5 : 1;
1742 unsigned IOCB6 : 1;
1743 unsigned IOCB7 : 1;
1744 } __IOCBbits_t;
1746 extern __at(0x0116) volatile __IOCBbits_t IOCBbits;
1748 #define _IOCB4 0x10
1749 #define _IOCB5 0x20
1750 #define _IOCB6 0x40
1751 #define _IOCB7 0x80
1753 //==============================================================================
1756 //==============================================================================
1757 // VRCON Bits
1759 extern __at(0x0118) __sfr VRCON;
1761 typedef union
1763 struct
1765 unsigned VR0 : 1;
1766 unsigned VR1 : 1;
1767 unsigned VR2 : 1;
1768 unsigned VR3 : 1;
1769 unsigned VP6EN : 1;
1770 unsigned VRR : 1;
1771 unsigned C2VREN : 1;
1772 unsigned C1VREN : 1;
1775 struct
1777 unsigned VR : 4;
1778 unsigned : 4;
1780 } __VRCONbits_t;
1782 extern __at(0x0118) volatile __VRCONbits_t VRCONbits;
1784 #define _VR0 0x01
1785 #define _VR1 0x02
1786 #define _VR2 0x04
1787 #define _VR3 0x08
1788 #define _VP6EN 0x10
1789 #define _VRR 0x20
1790 #define _C2VREN 0x40
1791 #define _C1VREN 0x80
1793 //==============================================================================
1796 //==============================================================================
1797 // CM1CON0 Bits
1799 extern __at(0x0119) __sfr CM1CON0;
1801 typedef union
1803 struct
1805 unsigned C1CH0 : 1;
1806 unsigned C1CH1 : 1;
1807 unsigned C1R : 1;
1808 unsigned : 1;
1809 unsigned C1POL : 1;
1810 unsigned C1OE : 1;
1811 unsigned C1OUT : 1;
1812 unsigned C1ON : 1;
1815 struct
1817 unsigned C1CH : 2;
1818 unsigned : 6;
1820 } __CM1CON0bits_t;
1822 extern __at(0x0119) volatile __CM1CON0bits_t CM1CON0bits;
1824 #define _C1CH0 0x01
1825 #define _C1CH1 0x02
1826 #define _C1R 0x04
1827 #define _C1POL 0x10
1828 #define _C1OE 0x20
1829 #define _C1OUT 0x40
1830 #define _C1ON 0x80
1832 //==============================================================================
1835 //==============================================================================
1836 // CM2CON0 Bits
1838 extern __at(0x011A) __sfr CM2CON0;
1840 typedef union
1842 struct
1844 unsigned C2CH0 : 1;
1845 unsigned C2CH1 : 1;
1846 unsigned C2R : 1;
1847 unsigned : 1;
1848 unsigned C2POL : 1;
1849 unsigned C2OE : 1;
1850 unsigned C2OUT : 1;
1851 unsigned C2ON : 1;
1854 struct
1856 unsigned C2CH : 2;
1857 unsigned : 6;
1859 } __CM2CON0bits_t;
1861 extern __at(0x011A) volatile __CM2CON0bits_t CM2CON0bits;
1863 #define _C2CH0 0x01
1864 #define _C2CH1 0x02
1865 #define _C2R 0x04
1866 #define _C2POL 0x10
1867 #define _C2OE 0x20
1868 #define _C2OUT 0x40
1869 #define _C2ON 0x80
1871 //==============================================================================
1874 //==============================================================================
1875 // CM2CON1 Bits
1877 extern __at(0x011B) __sfr CM2CON1;
1879 typedef struct
1881 unsigned C2SYNC : 1;
1882 unsigned T1GSS : 1;
1883 unsigned : 1;
1884 unsigned : 1;
1885 unsigned : 1;
1886 unsigned : 1;
1887 unsigned MC2OUT : 1;
1888 unsigned MC1OUT : 1;
1889 } __CM2CON1bits_t;
1891 extern __at(0x011B) volatile __CM2CON1bits_t CM2CON1bits;
1893 #define _C2SYNC 0x01
1894 #define _T1GSS 0x02
1895 #define _MC2OUT 0x40
1896 #define _MC1OUT 0x80
1898 //==============================================================================
1901 //==============================================================================
1902 // ANSEL Bits
1904 extern __at(0x011E) __sfr ANSEL;
1906 typedef struct
1908 unsigned ANS0 : 1;
1909 unsigned ANS1 : 1;
1910 unsigned ANS2 : 1;
1911 unsigned ANS3 : 1;
1912 unsigned ANS4 : 1;
1913 unsigned ANS5 : 1;
1914 unsigned ANS6 : 1;
1915 unsigned ANS7 : 1;
1916 } __ANSELbits_t;
1918 extern __at(0x011E) volatile __ANSELbits_t ANSELbits;
1920 #define _ANS0 0x01
1921 #define _ANS1 0x02
1922 #define _ANS2 0x04
1923 #define _ANS3 0x08
1924 #define _ANS4 0x10
1925 #define _ANS5 0x20
1926 #define _ANS6 0x40
1927 #define _ANS7 0x80
1929 //==============================================================================
1932 //==============================================================================
1933 // ANSELH Bits
1935 extern __at(0x011F) __sfr ANSELH;
1937 typedef struct
1939 unsigned ANS8 : 1;
1940 unsigned ANS9 : 1;
1941 unsigned ANS10 : 1;
1942 unsigned ANS11 : 1;
1943 unsigned : 1;
1944 unsigned : 1;
1945 unsigned : 1;
1946 unsigned : 1;
1947 } __ANSELHbits_t;
1949 extern __at(0x011F) volatile __ANSELHbits_t ANSELHbits;
1951 #define _ANS8 0x01
1952 #define _ANS9 0x02
1953 #define _ANS10 0x04
1954 #define _ANS11 0x08
1956 //==============================================================================
1959 //==============================================================================
1960 // EECON1 Bits
1962 extern __at(0x018C) __sfr EECON1;
1964 typedef struct
1966 unsigned RD : 1;
1967 unsigned WR : 1;
1968 unsigned WREN : 1;
1969 unsigned WRERR : 1;
1970 unsigned : 1;
1971 unsigned : 1;
1972 unsigned : 1;
1973 unsigned EEPGD : 1;
1974 } __EECON1bits_t;
1976 extern __at(0x018C) volatile __EECON1bits_t EECON1bits;
1978 #define _RD 0x01
1979 #define _WR 0x02
1980 #define _WREN 0x04
1981 #define _WRERR 0x08
1982 #define _EEPGD 0x80
1984 //==============================================================================
1986 extern __at(0x018D) __sfr EECON2;
1988 //==============================================================================
1989 // PSTRCON Bits
1991 extern __at(0x019D) __sfr PSTRCON;
1993 typedef struct
1995 unsigned STRA : 1;
1996 unsigned STRB : 1;
1997 unsigned STRC : 1;
1998 unsigned STRD : 1;
1999 unsigned STRSYNC : 1;
2000 unsigned : 1;
2001 unsigned : 1;
2002 unsigned : 1;
2003 } __PSTRCONbits_t;
2005 extern __at(0x019D) volatile __PSTRCONbits_t PSTRCONbits;
2007 #define _STRA 0x01
2008 #define _STRB 0x02
2009 #define _STRC 0x04
2010 #define _STRD 0x08
2011 #define _STRSYNC 0x10
2013 //==============================================================================
2016 //==============================================================================
2017 // SRCON Bits
2019 extern __at(0x019E) __sfr SRCON;
2021 typedef union
2023 struct
2025 unsigned : 1;
2026 unsigned : 1;
2027 unsigned PULSR : 1;
2028 unsigned PULSS : 1;
2029 unsigned C2REN : 1;
2030 unsigned C1SEN : 1;
2031 unsigned SR0 : 1;
2032 unsigned SR1 : 1;
2035 struct
2037 unsigned : 6;
2038 unsigned SR : 2;
2040 } __SRCONbits_t;
2042 extern __at(0x019E) volatile __SRCONbits_t SRCONbits;
2044 #define _PULSR 0x04
2045 #define _PULSS 0x08
2046 #define _C2REN 0x10
2047 #define _C1SEN 0x20
2048 #define _SR0 0x40
2049 #define _SR1 0x80
2051 //==============================================================================
2054 //==============================================================================
2056 // Configuration Bits
2058 //==============================================================================
2060 #define _CONFIG 0x2007
2062 //----------------------------- CONFIG Options -------------------------------
2064 #define _FOSC_LP 0x3FF8 // LP oscillator: Low-power crystal on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN.
2065 #define _LP_OSC 0x3FF8 // LP oscillator: Low-power crystal on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN.
2066 #define _FOSC_XT 0x3FF9 // XT oscillator: Crystal/resonator on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN.
2067 #define _XT_OSC 0x3FF9 // XT oscillator: Crystal/resonator on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN.
2068 #define _FOSC_HS 0x3FFA // HS oscillator: High-speed crystal/resonator on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN.
2069 #define _HS_OSC 0x3FFA // HS oscillator: High-speed crystal/resonator on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN.
2070 #define _FOSC_EC 0x3FFB // EC: I/O function on RA4/OSC2/CLKOUT pin, CLKIN on RA5/OSC1/CLKIN.
2071 #define _EC_OSC 0x3FFB // EC: I/O function on RA4/OSC2/CLKOUT pin, CLKIN on RA5/OSC1/CLKIN.
2072 #define _FOSC_INTRCIO 0x3FFC // INTOSCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN.
2073 #define _INTRC_OSC_NOCLKOUT 0x3FFC // INTOSCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN.
2074 #define _INTOSCIO 0x3FFC // INTOSCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN.
2075 #define _FOSC_INTRCCLK 0x3FFD // INTOSC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN.
2076 #define _INTRC_OSC_CLKOUT 0x3FFD // INTOSC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN.
2077 #define _INTOSC 0x3FFD // INTOSC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN.
2078 #define _FOSC_EXTRCIO 0x3FFE // RCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN.
2079 #define _EXTRC_OSC_NOCLKOUT 0x3FFE // RCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN.
2080 #define _EXTRCIO 0x3FFE // RCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN.
2081 #define _FOSC_EXTRCCLK 0x3FFF // RC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN.
2082 #define _EXTRC_OSC_CLKOUT 0x3FFF // RC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN.
2083 #define _EXTRC 0x3FFF // RC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN.
2084 #define _WDTE_OFF 0x3FF7 // WDT disabled and can be enabled by SWDTEN bit of the WDTCON register.
2085 #define _WDT_OFF 0x3FF7 // WDT disabled and can be enabled by SWDTEN bit of the WDTCON register.
2086 #define _WDTE_ON 0x3FFF // WDT enabled.
2087 #define _WDT_ON 0x3FFF // WDT enabled.
2088 #define _PWRTE_ON 0x3FEF // PWRT enabled.
2089 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
2090 #define _MCLRE_OFF 0x3FDF // MCLR pin function is digital input, MCLR internally tied to VDD.
2091 #define _MCLRE_ON 0x3FFF // MCLR pin function is MCLR.
2092 #define _CP_ON 0x3FBF // Program memory code protection is enabled.
2093 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
2094 #define _CPD_ON 0x3F7F // Data memory code protection is enabled.
2095 #define _CPD_OFF 0x3FFF // Data memory code protection is disabled.
2096 #define _BOREN_OFF 0x3CFF // BOR disabled.
2097 #define _BOD_OFF 0x3CFF // BOR disabled.
2098 #define _BOR_OFF 0x3CFF // BOR disabled.
2099 #define _BOREN_SBODEN 0x3DFF // BOR controlled by SBOREN bit of the PCON register.
2100 #define _BOD_SBODEN 0x3DFF // BOR controlled by SBOREN bit of the PCON register.
2101 #define _BOR_SBODEN 0x3DFF // BOR controlled by SBOREN bit of the PCON register.
2102 #define _BOREN_NSLEEP 0x3EFF // BOR enabled during operation and disabled in Sleep.
2103 #define _BOD_NSLEEP 0x3EFF // BOR enabled during operation and disabled in Sleep.
2104 #define _BOR_NSLEEP 0x3EFF // BOR enabled during operation and disabled in Sleep.
2105 #define _BOREN_ON 0x3FFF // BOR enabled.
2106 #define _BOD_ON 0x3FFF // BOR enabled.
2107 #define _BOR_ON 0x3FFF // BOR enabled.
2108 #define _IESO_OFF 0x3BFF // Internal External Switchover mode is disabled.
2109 #define _IESO_ON 0x3FFF // Internal External Switchover mode is enabled.
2110 #define _FCMEN_OFF 0x37FF // Fail-Safe Clock Monitor is disabled.
2111 #define _FCMEN_ON 0x3FFF // Fail-Safe Clock Monitor is enabled.
2113 //==============================================================================
2115 #define _DEVID1 0x2006
2117 #define _IDLOC0 0x2000
2118 #define _IDLOC1 0x2001
2119 #define _IDLOC2 0x2002
2120 #define _IDLOC3 0x2003
2122 //==============================================================================
2124 #ifndef NO_BIT_DEFINES
2126 #define ADON ADCON0bits.ADON // bit 0
2127 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1, shadows bit in ADCON0bits
2128 #define GO ADCON0bits.GO // bit 1, shadows bit in ADCON0bits
2129 #define NOT_DONE ADCON0bits.NOT_DONE // bit 1, shadows bit in ADCON0bits
2130 #define GO_DONE ADCON0bits.GO_DONE // bit 1, shadows bit in ADCON0bits
2131 #define CHS0 ADCON0bits.CHS0 // bit 2
2132 #define CHS1 ADCON0bits.CHS1 // bit 3
2133 #define CHS2 ADCON0bits.CHS2 // bit 4
2134 #define CHS3 ADCON0bits.CHS3 // bit 5
2135 #define VCFG ADCON0bits.VCFG // bit 6
2136 #define ADFM ADCON0bits.ADFM // bit 7
2138 #define ADCS0 ADCON1bits.ADCS0 // bit 4
2139 #define ADCS1 ADCON1bits.ADCS1 // bit 5
2140 #define ADCS2 ADCON1bits.ADCS2 // bit 6
2142 #define ANS0 ANSELbits.ANS0 // bit 0
2143 #define ANS1 ANSELbits.ANS1 // bit 1
2144 #define ANS2 ANSELbits.ANS2 // bit 2
2145 #define ANS3 ANSELbits.ANS3 // bit 3
2146 #define ANS4 ANSELbits.ANS4 // bit 4
2147 #define ANS5 ANSELbits.ANS5 // bit 5
2148 #define ANS6 ANSELbits.ANS6 // bit 6
2149 #define ANS7 ANSELbits.ANS7 // bit 7
2151 #define ANS8 ANSELHbits.ANS8 // bit 0
2152 #define ANS9 ANSELHbits.ANS9 // bit 1
2153 #define ANS10 ANSELHbits.ANS10 // bit 2
2154 #define ANS11 ANSELHbits.ANS11 // bit 3
2156 #define ABDEN BAUDCTLbits.ABDEN // bit 0
2157 #define WUE BAUDCTLbits.WUE // bit 1
2158 #define BRG16 BAUDCTLbits.BRG16 // bit 3
2159 #define SCKP BAUDCTLbits.SCKP // bit 4
2160 #define RCIDL BAUDCTLbits.RCIDL // bit 6
2161 #define ABDOVF BAUDCTLbits.ABDOVF // bit 7
2163 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
2164 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
2165 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
2166 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
2167 #define DC1B0 CCP1CONbits.DC1B0 // bit 4
2168 #define DC1B1 CCP1CONbits.DC1B1 // bit 5
2169 #define P1M0 CCP1CONbits.P1M0 // bit 6
2170 #define P1M1 CCP1CONbits.P1M1 // bit 7
2172 #define C1CH0 CM1CON0bits.C1CH0 // bit 0
2173 #define C1CH1 CM1CON0bits.C1CH1 // bit 1
2174 #define C1R CM1CON0bits.C1R // bit 2
2175 #define C1POL CM1CON0bits.C1POL // bit 4
2176 #define C1OE CM1CON0bits.C1OE // bit 5
2177 #define C1OUT CM1CON0bits.C1OUT // bit 6
2178 #define C1ON CM1CON0bits.C1ON // bit 7
2180 #define C2CH0 CM2CON0bits.C2CH0 // bit 0
2181 #define C2CH1 CM2CON0bits.C2CH1 // bit 1
2182 #define C2R CM2CON0bits.C2R // bit 2
2183 #define C2POL CM2CON0bits.C2POL // bit 4
2184 #define C2OE CM2CON0bits.C2OE // bit 5
2185 #define C2OUT CM2CON0bits.C2OUT // bit 6
2186 #define C2ON CM2CON0bits.C2ON // bit 7
2188 #define C2SYNC CM2CON1bits.C2SYNC // bit 0
2189 #define T1GSS CM2CON1bits.T1GSS // bit 1
2190 #define MC2OUT CM2CON1bits.MC2OUT // bit 6
2191 #define MC1OUT CM2CON1bits.MC1OUT // bit 7
2193 #define PSSBD0 ECCPASbits.PSSBD0 // bit 0
2194 #define PSSBD1 ECCPASbits.PSSBD1 // bit 1
2195 #define PSSAC0 ECCPASbits.PSSAC0 // bit 2
2196 #define PSSAC1 ECCPASbits.PSSAC1 // bit 3
2197 #define ECCPAS0 ECCPASbits.ECCPAS0 // bit 4
2198 #define ECCPAS1 ECCPASbits.ECCPAS1 // bit 5
2199 #define ECCPAS2 ECCPASbits.ECCPAS2 // bit 6
2200 #define ECCPASE ECCPASbits.ECCPASE // bit 7
2202 #define RD EECON1bits.RD // bit 0
2203 #define WR EECON1bits.WR // bit 1
2204 #define WREN EECON1bits.WREN // bit 2
2205 #define WRERR EECON1bits.WRERR // bit 3
2206 #define EEPGD EECON1bits.EEPGD // bit 7
2208 #define RABIF INTCONbits.RABIF // bit 0
2209 #define INTF INTCONbits.INTF // bit 1
2210 #define T0IF INTCONbits.T0IF // bit 2
2211 #define RABIE INTCONbits.RABIE // bit 3
2212 #define INTE INTCONbits.INTE // bit 4
2213 #define T0IE INTCONbits.T0IE // bit 5
2214 #define PEIE INTCONbits.PEIE // bit 6
2215 #define GIE INTCONbits.GIE // bit 7
2217 #define IOCA0 IOCbits.IOCA0 // bit 0, shadows bit in IOCbits
2218 #define IOC0 IOCbits.IOC0 // bit 0, shadows bit in IOCbits
2219 #define IOCA1 IOCbits.IOCA1 // bit 1, shadows bit in IOCbits
2220 #define IOC1 IOCbits.IOC1 // bit 1, shadows bit in IOCbits
2221 #define IOCA2 IOCbits.IOCA2 // bit 2, shadows bit in IOCbits
2222 #define IOC2 IOCbits.IOC2 // bit 2, shadows bit in IOCbits
2223 #define IOCA3 IOCbits.IOCA3 // bit 3, shadows bit in IOCbits
2224 #define IOC3 IOCbits.IOC3 // bit 3, shadows bit in IOCbits
2225 #define IOCA4 IOCbits.IOCA4 // bit 4, shadows bit in IOCbits
2226 #define IOC4 IOCbits.IOC4 // bit 4, shadows bit in IOCbits
2227 #define IOCA5 IOCbits.IOCA5 // bit 5, shadows bit in IOCbits
2228 #define IOC5 IOCbits.IOC5 // bit 5, shadows bit in IOCbits
2230 #define IOCB4 IOCBbits.IOCB4 // bit 4
2231 #define IOCB5 IOCBbits.IOCB5 // bit 5
2232 #define IOCB6 IOCBbits.IOCB6 // bit 6
2233 #define IOCB7 IOCBbits.IOCB7 // bit 7
2235 #define MSK0 MSKbits.MSK0 // bit 0
2236 #define MSK1 MSKbits.MSK1 // bit 1
2237 #define MSK2 MSKbits.MSK2 // bit 2
2238 #define MSK3 MSKbits.MSK3 // bit 3
2239 #define MSK4 MSKbits.MSK4 // bit 4
2240 #define MSK5 MSKbits.MSK5 // bit 5
2241 #define MSK6 MSKbits.MSK6 // bit 6
2242 #define MSK7 MSKbits.MSK7 // bit 7
2244 #define PS0 OPTION_REGbits.PS0 // bit 0
2245 #define PS1 OPTION_REGbits.PS1 // bit 1
2246 #define PS2 OPTION_REGbits.PS2 // bit 2
2247 #define PSA OPTION_REGbits.PSA // bit 3
2248 #define T0SE OPTION_REGbits.T0SE // bit 4
2249 #define T0CS OPTION_REGbits.T0CS // bit 5
2250 #define INTEDG OPTION_REGbits.INTEDG // bit 6
2251 #define NOT_RABPU OPTION_REGbits.NOT_RABPU // bit 7
2253 #define SCS OSCCONbits.SCS // bit 0
2254 #define LTS OSCCONbits.LTS // bit 1
2255 #define HTS OSCCONbits.HTS // bit 2
2256 #define OSTS OSCCONbits.OSTS // bit 3
2257 #define IRCF0 OSCCONbits.IRCF0 // bit 4
2258 #define IRCF1 OSCCONbits.IRCF1 // bit 5
2259 #define IRCF2 OSCCONbits.IRCF2 // bit 6
2261 #define TUN0 OSCTUNEbits.TUN0 // bit 0
2262 #define TUN1 OSCTUNEbits.TUN1 // bit 1
2263 #define TUN2 OSCTUNEbits.TUN2 // bit 2
2264 #define TUN3 OSCTUNEbits.TUN3 // bit 3
2265 #define TUN4 OSCTUNEbits.TUN4 // bit 4
2267 #define NOT_BOR PCONbits.NOT_BOR // bit 0
2268 #define NOT_POR PCONbits.NOT_POR // bit 1
2269 #define SBOREN PCONbits.SBOREN // bit 4
2270 #define ULPWUE PCONbits.ULPWUE // bit 5
2272 #define TMR1IE PIE1bits.TMR1IE // bit 0, shadows bit in PIE1bits
2273 #define T1IE PIE1bits.T1IE // bit 0, shadows bit in PIE1bits
2274 #define TMR2IE PIE1bits.TMR2IE // bit 1, shadows bit in PIE1bits
2275 #define T2IE PIE1bits.T2IE // bit 1, shadows bit in PIE1bits
2276 #define CCP1IE PIE1bits.CCP1IE // bit 2
2277 #define SSPIE PIE1bits.SSPIE // bit 3
2278 #define TXIE PIE1bits.TXIE // bit 4
2279 #define RCIE PIE1bits.RCIE // bit 5
2280 #define ADIE PIE1bits.ADIE // bit 6
2282 #define EEIE PIE2bits.EEIE // bit 4
2283 #define C1IE PIE2bits.C1IE // bit 5
2284 #define C2IE PIE2bits.C2IE // bit 6
2285 #define OSFIE PIE2bits.OSFIE // bit 7
2287 #define TMR1IF PIR1bits.TMR1IF // bit 0, shadows bit in PIR1bits
2288 #define T1IF PIR1bits.T1IF // bit 0, shadows bit in PIR1bits
2289 #define TMR2IF PIR1bits.TMR2IF // bit 1, shadows bit in PIR1bits
2290 #define T2IF PIR1bits.T2IF // bit 1, shadows bit in PIR1bits
2291 #define CCP1IF PIR1bits.CCP1IF // bit 2
2292 #define SSPIF PIR1bits.SSPIF // bit 3
2293 #define TXIF PIR1bits.TXIF // bit 4
2294 #define RCIF PIR1bits.RCIF // bit 5
2295 #define ADIF PIR1bits.ADIF // bit 6
2297 #define EEIF PIR2bits.EEIF // bit 4
2298 #define C1IF PIR2bits.C1IF // bit 5
2299 #define C2IF PIR2bits.C2IF // bit 6
2300 #define OSFIF PIR2bits.OSFIF // bit 7
2302 #define RA0 PORTAbits.RA0 // bit 0
2303 #define RA1 PORTAbits.RA1 // bit 1
2304 #define RA2 PORTAbits.RA2 // bit 2
2305 #define RA3 PORTAbits.RA3 // bit 3
2306 #define RA4 PORTAbits.RA4 // bit 4
2307 #define RA5 PORTAbits.RA5 // bit 5
2309 #define RB4 PORTBbits.RB4 // bit 4
2310 #define RB5 PORTBbits.RB5 // bit 5
2311 #define RB6 PORTBbits.RB6 // bit 6
2312 #define RB7 PORTBbits.RB7 // bit 7
2314 #define RC0 PORTCbits.RC0 // bit 0
2315 #define RC1 PORTCbits.RC1 // bit 1
2316 #define RC2 PORTCbits.RC2 // bit 2
2317 #define RC3 PORTCbits.RC3 // bit 3
2318 #define RC4 PORTCbits.RC4 // bit 4
2319 #define RC5 PORTCbits.RC5 // bit 5
2320 #define RC6 PORTCbits.RC6 // bit 6
2321 #define RC7 PORTCbits.RC7 // bit 7
2323 #define STRA PSTRCONbits.STRA // bit 0
2324 #define STRB PSTRCONbits.STRB // bit 1
2325 #define STRC PSTRCONbits.STRC // bit 2
2326 #define STRD PSTRCONbits.STRD // bit 3
2327 #define STRSYNC PSTRCONbits.STRSYNC // bit 4
2329 #define PDC0 PWM1CONbits.PDC0 // bit 0
2330 #define PDC1 PWM1CONbits.PDC1 // bit 1
2331 #define PDC2 PWM1CONbits.PDC2 // bit 2
2332 #define PDC3 PWM1CONbits.PDC3 // bit 3
2333 #define PDC4 PWM1CONbits.PDC4 // bit 4
2334 #define PDC5 PWM1CONbits.PDC5 // bit 5
2335 #define PDC6 PWM1CONbits.PDC6 // bit 6
2336 #define PRSEN PWM1CONbits.PRSEN // bit 7
2338 #define RX9D RCSTAbits.RX9D // bit 0
2339 #define OERR RCSTAbits.OERR // bit 1
2340 #define FERR RCSTAbits.FERR // bit 2
2341 #define ADDEN RCSTAbits.ADDEN // bit 3
2342 #define CREN RCSTAbits.CREN // bit 4
2343 #define SREN RCSTAbits.SREN // bit 5
2344 #define RX9 RCSTAbits.RX9 // bit 6
2345 #define SPEN RCSTAbits.SPEN // bit 7
2347 #define BRG0 SPBRGbits.BRG0 // bit 0
2348 #define BRG1 SPBRGbits.BRG1 // bit 1
2349 #define BRG2 SPBRGbits.BRG2 // bit 2
2350 #define BRG3 SPBRGbits.BRG3 // bit 3
2351 #define BRG4 SPBRGbits.BRG4 // bit 4
2352 #define BRG5 SPBRGbits.BRG5 // bit 5
2353 #define BRG6 SPBRGbits.BRG6 // bit 6
2354 #define BRG7 SPBRGbits.BRG7 // bit 7
2356 #define BRG8 SPBRGHbits.BRG8 // bit 0
2357 #define BRG9 SPBRGHbits.BRG9 // bit 1
2358 #define BRG10 SPBRGHbits.BRG10 // bit 2
2359 #define BRG11 SPBRGHbits.BRG11 // bit 3
2360 #define BRG12 SPBRGHbits.BRG12 // bit 4
2361 #define BRG13 SPBRGHbits.BRG13 // bit 5
2362 #define BRG14 SPBRGHbits.BRG14 // bit 6
2363 #define BRG15 SPBRGHbits.BRG15 // bit 7
2365 #define PULSR SRCONbits.PULSR // bit 2
2366 #define PULSS SRCONbits.PULSS // bit 3
2367 #define C2REN SRCONbits.C2REN // bit 4
2368 #define C1SEN SRCONbits.C1SEN // bit 5
2369 #define SR0 SRCONbits.SR0 // bit 6
2370 #define SR1 SRCONbits.SR1 // bit 7
2372 #define SSPM0 SSPCONbits.SSPM0 // bit 0
2373 #define SSPM1 SSPCONbits.SSPM1 // bit 1
2374 #define SSPM2 SSPCONbits.SSPM2 // bit 2
2375 #define SSPM3 SSPCONbits.SSPM3 // bit 3
2376 #define CKP SSPCONbits.CKP // bit 4
2377 #define SSPEN SSPCONbits.SSPEN // bit 5
2378 #define SSPOV SSPCONbits.SSPOV // bit 6
2379 #define WCOL SSPCONbits.WCOL // bit 7
2381 #define BF SSPSTATbits.BF // bit 0
2382 #define UA SSPSTATbits.UA // bit 1
2383 #define R_NOT_W SSPSTATbits.R_NOT_W // bit 2, shadows bit in SSPSTATbits
2384 #define R SSPSTATbits.R // bit 2, shadows bit in SSPSTATbits
2385 #define I2C_READ SSPSTATbits.I2C_READ // bit 2, shadows bit in SSPSTATbits
2386 #define NOT_W SSPSTATbits.NOT_W // bit 2, shadows bit in SSPSTATbits
2387 #define NOT_WRITE SSPSTATbits.NOT_WRITE // bit 2, shadows bit in SSPSTATbits
2388 #define R_W SSPSTATbits.R_W // bit 2, shadows bit in SSPSTATbits
2389 #define READ_WRITE SSPSTATbits.READ_WRITE // bit 2, shadows bit in SSPSTATbits
2390 #define S SSPSTATbits.S // bit 3, shadows bit in SSPSTATbits
2391 #define I2C_START SSPSTATbits.I2C_START // bit 3, shadows bit in SSPSTATbits
2392 #define P SSPSTATbits.P // bit 4, shadows bit in SSPSTATbits
2393 #define I2C_STOP SSPSTATbits.I2C_STOP // bit 4, shadows bit in SSPSTATbits
2394 #define D_NOT_A SSPSTATbits.D_NOT_A // bit 5, shadows bit in SSPSTATbits
2395 #define D SSPSTATbits.D // bit 5, shadows bit in SSPSTATbits
2396 #define I2C_DATA SSPSTATbits.I2C_DATA // bit 5, shadows bit in SSPSTATbits
2397 #define NOT_A SSPSTATbits.NOT_A // bit 5, shadows bit in SSPSTATbits
2398 #define NOT_ADDRESS SSPSTATbits.NOT_ADDRESS // bit 5, shadows bit in SSPSTATbits
2399 #define D_A SSPSTATbits.D_A // bit 5, shadows bit in SSPSTATbits
2400 #define DATA_ADDRESS SSPSTATbits.DATA_ADDRESS // bit 5, shadows bit in SSPSTATbits
2401 #define CKE SSPSTATbits.CKE // bit 6
2402 #define SMP SSPSTATbits.SMP // bit 7
2404 #define C STATUSbits.C // bit 0
2405 #define DC STATUSbits.DC // bit 1
2406 #define Z STATUSbits.Z // bit 2
2407 #define NOT_PD STATUSbits.NOT_PD // bit 3
2408 #define NOT_TO STATUSbits.NOT_TO // bit 4
2409 #define RP0 STATUSbits.RP0 // bit 5
2410 #define RP1 STATUSbits.RP1 // bit 6
2411 #define IRP STATUSbits.IRP // bit 7
2413 #define TMR1ON T1CONbits.TMR1ON // bit 0
2414 #define TMR1CS T1CONbits.TMR1CS // bit 1
2415 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2
2416 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
2417 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
2418 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
2419 #define TMR1GE T1CONbits.TMR1GE // bit 6
2420 #define T1GINV T1CONbits.T1GINV // bit 7
2422 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
2423 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
2424 #define TMR2ON T2CONbits.TMR2ON // bit 2
2425 #define TOUTPS0 T2CONbits.TOUTPS0 // bit 3
2426 #define TOUTPS1 T2CONbits.TOUTPS1 // bit 4
2427 #define TOUTPS2 T2CONbits.TOUTPS2 // bit 5
2428 #define TOUTPS3 T2CONbits.TOUTPS3 // bit 6
2430 #define TRISA0 TRISAbits.TRISA0 // bit 0
2431 #define TRISA1 TRISAbits.TRISA1 // bit 1
2432 #define TRISA2 TRISAbits.TRISA2 // bit 2
2433 #define TRISA3 TRISAbits.TRISA3 // bit 3
2434 #define TRISA4 TRISAbits.TRISA4 // bit 4
2435 #define TRISA5 TRISAbits.TRISA5 // bit 5
2437 #define TRISB4 TRISBbits.TRISB4 // bit 4
2438 #define TRISB5 TRISBbits.TRISB5 // bit 5
2439 #define TRISB6 TRISBbits.TRISB6 // bit 6
2440 #define TRISB7 TRISBbits.TRISB7 // bit 7
2442 #define TRISC0 TRISCbits.TRISC0 // bit 0
2443 #define TRISC1 TRISCbits.TRISC1 // bit 1
2444 #define TRISC2 TRISCbits.TRISC2 // bit 2
2445 #define TRISC3 TRISCbits.TRISC3 // bit 3
2446 #define TRISC4 TRISCbits.TRISC4 // bit 4
2447 #define TRISC5 TRISCbits.TRISC5 // bit 5
2448 #define TRISC6 TRISCbits.TRISC6 // bit 6
2449 #define TRISC7 TRISCbits.TRISC7 // bit 7
2451 #define TX9D TXSTAbits.TX9D // bit 0
2452 #define TRMT TXSTAbits.TRMT // bit 1
2453 #define BRGH TXSTAbits.BRGH // bit 2
2454 #define SENDB TXSTAbits.SENDB // bit 3, shadows bit in TXSTAbits
2455 #define SENB TXSTAbits.SENB // bit 3, shadows bit in TXSTAbits
2456 #define SYNC TXSTAbits.SYNC // bit 4
2457 #define TXEN TXSTAbits.TXEN // bit 5
2458 #define TX9 TXSTAbits.TX9 // bit 6
2459 #define CSRC TXSTAbits.CSRC // bit 7
2461 #define VR0 VRCONbits.VR0 // bit 0
2462 #define VR1 VRCONbits.VR1 // bit 1
2463 #define VR2 VRCONbits.VR2 // bit 2
2464 #define VR3 VRCONbits.VR3 // bit 3
2465 #define VP6EN VRCONbits.VP6EN // bit 4
2466 #define VRR VRCONbits.VRR // bit 5
2467 #define C2VREN VRCONbits.C2VREN // bit 6
2468 #define C1VREN VRCONbits.C1VREN // bit 7
2470 #define SWDTEN WDTCONbits.SWDTEN // bit 0
2471 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1
2472 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2
2473 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3
2474 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4
2476 #define WPUA0 WPUbits.WPUA0 // bit 0, shadows bit in WPUbits
2477 #define WPU0 WPUbits.WPU0 // bit 0, shadows bit in WPUbits
2478 #define WPUA1 WPUbits.WPUA1 // bit 1, shadows bit in WPUbits
2479 #define WPU1 WPUbits.WPU1 // bit 1, shadows bit in WPUbits
2480 #define WPUA2 WPUbits.WPUA2 // bit 2, shadows bit in WPUbits
2481 #define WPU2 WPUbits.WPU2 // bit 2, shadows bit in WPUbits
2482 #define WPUA4 WPUbits.WPUA4 // bit 4, shadows bit in WPUbits
2483 #define WPU4 WPUbits.WPU4 // bit 4, shadows bit in WPUbits
2484 #define WPUA5 WPUbits.WPUA5 // bit 5, shadows bit in WPUbits
2485 #define WPU5 WPUbits.WPU5 // bit 5, shadows bit in WPUbits
2487 #define WPUB4 WPUBbits.WPUB4 // bit 4
2488 #define WPUB5 WPUBbits.WPUB5 // bit 5
2489 #define WPUB6 WPUBbits.WPUB6 // bit 6
2490 #define WPUB7 WPUBbits.WPUB7 // bit 7
2492 #endif // #ifndef NO_BIT_DEFINES
2494 #endif // #ifndef __PIC16F690_H__