struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16c63a.h
blobb02d83a449f895fa5b49a3598c97cca3b12362ac
1 /*
2 * This declarations of the PIC16C63A 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:02 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 __PIC16C63A_H__
26 #define __PIC16C63A_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 CCPR1_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 CCPR2_ADDR 0x001B
64 #define CCPR2L_ADDR 0x001B
65 #define CCPR2H_ADDR 0x001C
66 #define CCP2CON_ADDR 0x001D
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 PR2_ADDR 0x0092
75 #define SSPADD_ADDR 0x0093
76 #define SSPSTAT_ADDR 0x0094
77 #define TXSTA_ADDR 0x0098
78 #define SPBRG_ADDR 0x0099
80 #endif // #ifndef NO_ADDR_DEFINES
82 //==============================================================================
84 // Register Definitions
86 //==============================================================================
88 extern __at(0x0000) __sfr INDF;
89 extern __at(0x0001) __sfr TMR0;
90 extern __at(0x0002) __sfr PCL;
92 //==============================================================================
93 // STATUS Bits
95 extern __at(0x0003) __sfr STATUS;
97 typedef union
99 struct
101 unsigned C : 1;
102 unsigned DC : 1;
103 unsigned Z : 1;
104 unsigned NOT_PD : 1;
105 unsigned NOT_TO : 1;
106 unsigned RP0 : 1;
107 unsigned RP1 : 1;
108 unsigned IRP : 1;
111 struct
113 unsigned : 5;
114 unsigned RP : 2;
115 unsigned : 1;
117 } __STATUSbits_t;
119 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
121 #define _C 0x01
122 #define _DC 0x02
123 #define _Z 0x04
124 #define _NOT_PD 0x08
125 #define _NOT_TO 0x10
126 #define _RP0 0x20
127 #define _RP1 0x40
128 #define _IRP 0x80
130 //==============================================================================
132 extern __at(0x0004) __sfr FSR;
134 //==============================================================================
135 // PORTA Bits
137 extern __at(0x0005) __sfr PORTA;
139 typedef union
141 struct
143 unsigned RA0 : 1;
144 unsigned RA1 : 1;
145 unsigned RA2 : 1;
146 unsigned RA3 : 1;
147 unsigned RA4 : 1;
148 unsigned RA5 : 1;
149 unsigned : 1;
150 unsigned : 1;
153 struct
155 unsigned RA : 6;
156 unsigned : 2;
158 } __PORTAbits_t;
160 extern __at(0x0005) volatile __PORTAbits_t PORTAbits;
162 #define _RA0 0x01
163 #define _RA1 0x02
164 #define _RA2 0x04
165 #define _RA3 0x08
166 #define _RA4 0x10
167 #define _RA5 0x20
169 //==============================================================================
172 //==============================================================================
173 // PORTB Bits
175 extern __at(0x0006) __sfr PORTB;
177 typedef struct
179 unsigned RB0 : 1;
180 unsigned RB1 : 1;
181 unsigned RB2 : 1;
182 unsigned RB3 : 1;
183 unsigned RB4 : 1;
184 unsigned RB5 : 1;
185 unsigned RB6 : 1;
186 unsigned RB7 : 1;
187 } __PORTBbits_t;
189 extern __at(0x0006) volatile __PORTBbits_t PORTBbits;
191 #define _RB0 0x01
192 #define _RB1 0x02
193 #define _RB2 0x04
194 #define _RB3 0x08
195 #define _RB4 0x10
196 #define _RB5 0x20
197 #define _RB6 0x40
198 #define _RB7 0x80
200 //==============================================================================
203 //==============================================================================
204 // PORTC Bits
206 extern __at(0x0007) __sfr PORTC;
208 typedef struct
210 unsigned RC0 : 1;
211 unsigned RC1 : 1;
212 unsigned RC2 : 1;
213 unsigned RC3 : 1;
214 unsigned RC4 : 1;
215 unsigned RC5 : 1;
216 unsigned RC6 : 1;
217 unsigned RC7 : 1;
218 } __PORTCbits_t;
220 extern __at(0x0007) volatile __PORTCbits_t PORTCbits;
222 #define _RC0 0x01
223 #define _RC1 0x02
224 #define _RC2 0x04
225 #define _RC3 0x08
226 #define _RC4 0x10
227 #define _RC5 0x20
228 #define _RC6 0x40
229 #define _RC7 0x80
231 //==============================================================================
233 extern __at(0x000A) __sfr PCLATH;
235 //==============================================================================
236 // INTCON Bits
238 extern __at(0x000B) __sfr INTCON;
240 typedef union
242 struct
244 unsigned RBIF : 1;
245 unsigned INTF : 1;
246 unsigned T0IF : 1;
247 unsigned RBIE : 1;
248 unsigned INTE : 1;
249 unsigned T0IE : 1;
250 unsigned PEIE : 1;
251 unsigned GIE : 1;
254 struct
256 unsigned : 1;
257 unsigned : 1;
258 unsigned TMR0IF : 1;
259 unsigned : 1;
260 unsigned : 1;
261 unsigned TMR0IE : 1;
262 unsigned : 1;
263 unsigned : 1;
265 } __INTCONbits_t;
267 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
269 #define _RBIF 0x01
270 #define _INTF 0x02
271 #define _T0IF 0x04
272 #define _TMR0IF 0x04
273 #define _RBIE 0x08
274 #define _INTE 0x10
275 #define _T0IE 0x20
276 #define _TMR0IE 0x20
277 #define _PEIE 0x40
278 #define _GIE 0x80
280 //==============================================================================
283 //==============================================================================
284 // PIR1 Bits
286 extern __at(0x000C) __sfr PIR1;
288 typedef struct
290 unsigned TMR1IF : 1;
291 unsigned TMR2IF : 1;
292 unsigned CCP1IF : 1;
293 unsigned SSPIF : 1;
294 unsigned TXIF : 1;
295 unsigned RCIF : 1;
296 unsigned : 1;
297 unsigned : 1;
298 } __PIR1bits_t;
300 extern __at(0x000C) volatile __PIR1bits_t PIR1bits;
302 #define _TMR1IF 0x01
303 #define _TMR2IF 0x02
304 #define _CCP1IF 0x04
305 #define _SSPIF 0x08
306 #define _TXIF 0x10
307 #define _RCIF 0x20
309 //==============================================================================
312 //==============================================================================
313 // PIR2 Bits
315 extern __at(0x000D) __sfr PIR2;
317 typedef struct
319 unsigned CCP2IF : 1;
320 unsigned : 1;
321 unsigned : 1;
322 unsigned : 1;
323 unsigned : 1;
324 unsigned : 1;
325 unsigned : 1;
326 unsigned : 1;
327 } __PIR2bits_t;
329 extern __at(0x000D) volatile __PIR2bits_t PIR2bits;
331 #define _CCP2IF 0x01
333 //==============================================================================
335 extern __at(0x000E) __sfr TMR1;
336 extern __at(0x000E) __sfr TMR1L;
337 extern __at(0x000F) __sfr TMR1H;
339 //==============================================================================
340 // T1CON Bits
342 extern __at(0x0010) __sfr T1CON;
344 typedef union
346 struct
348 unsigned TMR1ON : 1;
349 unsigned TMR1CS : 1;
350 unsigned NOT_T1SYNC : 1;
351 unsigned T1OSCEN : 1;
352 unsigned T1CKPS0 : 1;
353 unsigned T1CKPS1 : 1;
354 unsigned : 1;
355 unsigned : 1;
358 struct
360 unsigned : 1;
361 unsigned : 1;
362 unsigned T1INSYNC : 1;
363 unsigned : 1;
364 unsigned : 1;
365 unsigned : 1;
366 unsigned : 1;
367 unsigned : 1;
370 struct
372 unsigned : 4;
373 unsigned T1CKPS : 2;
374 unsigned : 2;
376 } __T1CONbits_t;
378 extern __at(0x0010) volatile __T1CONbits_t T1CONbits;
380 #define _TMR1ON 0x01
381 #define _TMR1CS 0x02
382 #define _NOT_T1SYNC 0x04
383 #define _T1INSYNC 0x04
384 #define _T1OSCEN 0x08
385 #define _T1CKPS0 0x10
386 #define _T1CKPS1 0x20
388 //==============================================================================
390 extern __at(0x0011) __sfr TMR2;
392 //==============================================================================
393 // T2CON Bits
395 extern __at(0x0012) __sfr T2CON;
397 typedef union
399 struct
401 unsigned T2CKPS0 : 1;
402 unsigned T2CKPS1 : 1;
403 unsigned TMR2ON : 1;
404 unsigned TOUTPS0 : 1;
405 unsigned TOUTPS1 : 1;
406 unsigned TOUTPS2 : 1;
407 unsigned TOUTPS3 : 1;
408 unsigned : 1;
411 struct
413 unsigned T2CKPS : 2;
414 unsigned : 6;
417 struct
419 unsigned : 3;
420 unsigned TOUTPS : 4;
421 unsigned : 1;
423 } __T2CONbits_t;
425 extern __at(0x0012) volatile __T2CONbits_t T2CONbits;
427 #define _T2CKPS0 0x01
428 #define _T2CKPS1 0x02
429 #define _TMR2ON 0x04
430 #define _TOUTPS0 0x08
431 #define _TOUTPS1 0x10
432 #define _TOUTPS2 0x20
433 #define _TOUTPS3 0x40
435 //==============================================================================
437 extern __at(0x0013) __sfr SSPBUF;
439 //==============================================================================
440 // SSPCON Bits
442 extern __at(0x0014) __sfr SSPCON;
444 typedef union
446 struct
448 unsigned SSPM0 : 1;
449 unsigned SSPM1 : 1;
450 unsigned SSPM2 : 1;
451 unsigned SSPM3 : 1;
452 unsigned CKP : 1;
453 unsigned SSPEN : 1;
454 unsigned SSPOV : 1;
455 unsigned WCOL : 1;
458 struct
460 unsigned SSPM : 4;
461 unsigned : 4;
463 } __SSPCONbits_t;
465 extern __at(0x0014) volatile __SSPCONbits_t SSPCONbits;
467 #define _SSPM0 0x01
468 #define _SSPM1 0x02
469 #define _SSPM2 0x04
470 #define _SSPM3 0x08
471 #define _CKP 0x10
472 #define _SSPEN 0x20
473 #define _SSPOV 0x40
474 #define _WCOL 0x80
476 //==============================================================================
478 extern __at(0x0015) __sfr CCPR1;
479 extern __at(0x0015) __sfr CCPR1L;
480 extern __at(0x0016) __sfr CCPR1H;
482 //==============================================================================
483 // CCP1CON Bits
485 extern __at(0x0017) __sfr CCP1CON;
487 typedef union
489 struct
491 unsigned CCP1M0 : 1;
492 unsigned CCP1M1 : 1;
493 unsigned CCP1M2 : 1;
494 unsigned CCP1M3 : 1;
495 unsigned CCP1Y : 1;
496 unsigned CCP1X : 1;
497 unsigned : 1;
498 unsigned : 1;
501 struct
503 unsigned CCP1M : 4;
504 unsigned : 4;
506 } __CCP1CONbits_t;
508 extern __at(0x0017) volatile __CCP1CONbits_t CCP1CONbits;
510 #define _CCP1M0 0x01
511 #define _CCP1M1 0x02
512 #define _CCP1M2 0x04
513 #define _CCP1M3 0x08
514 #define _CCP1Y 0x10
515 #define _CCP1X 0x20
517 //==============================================================================
520 //==============================================================================
521 // RCSTA Bits
523 extern __at(0x0018) __sfr RCSTA;
525 typedef union
527 struct
529 unsigned RX9D : 1;
530 unsigned OERR : 1;
531 unsigned FERR : 1;
532 unsigned : 1;
533 unsigned CREN : 1;
534 unsigned SREN : 1;
535 unsigned RX9 : 1;
536 unsigned SPEN : 1;
539 struct
541 unsigned RCD8 : 1;
542 unsigned : 1;
543 unsigned : 1;
544 unsigned : 1;
545 unsigned : 1;
546 unsigned : 1;
547 unsigned RC9 : 1;
548 unsigned : 1;
551 struct
553 unsigned : 1;
554 unsigned : 1;
555 unsigned : 1;
556 unsigned : 1;
557 unsigned : 1;
558 unsigned : 1;
559 unsigned NOT_RC8 : 1;
560 unsigned : 1;
563 struct
565 unsigned : 1;
566 unsigned : 1;
567 unsigned : 1;
568 unsigned : 1;
569 unsigned : 1;
570 unsigned : 1;
571 unsigned RC8_9 : 1;
572 unsigned : 1;
574 } __RCSTAbits_t;
576 extern __at(0x0018) volatile __RCSTAbits_t RCSTAbits;
578 #define _RX9D 0x01
579 #define _RCD8 0x01
580 #define _OERR 0x02
581 #define _FERR 0x04
582 #define _CREN 0x10
583 #define _SREN 0x20
584 #define _RX9 0x40
585 #define _RC9 0x40
586 #define _NOT_RC8 0x40
587 #define _RC8_9 0x40
588 #define _SPEN 0x80
590 //==============================================================================
592 extern __at(0x0019) __sfr TXREG;
593 extern __at(0x001A) __sfr RCREG;
594 extern __at(0x001B) __sfr CCPR2;
595 extern __at(0x001B) __sfr CCPR2L;
596 extern __at(0x001C) __sfr CCPR2H;
598 //==============================================================================
599 // CCP2CON Bits
601 extern __at(0x001D) __sfr CCP2CON;
603 typedef union
605 struct
607 unsigned CCP2M0 : 1;
608 unsigned CCP2M1 : 1;
609 unsigned CCP2M2 : 1;
610 unsigned CCP2M3 : 1;
611 unsigned CCP2Y : 1;
612 unsigned CCP2X : 1;
613 unsigned : 1;
614 unsigned : 1;
617 struct
619 unsigned CCP2M : 4;
620 unsigned : 4;
622 } __CCP2CONbits_t;
624 extern __at(0x001D) volatile __CCP2CONbits_t CCP2CONbits;
626 #define _CCP2M0 0x01
627 #define _CCP2M1 0x02
628 #define _CCP2M2 0x04
629 #define _CCP2M3 0x08
630 #define _CCP2Y 0x10
631 #define _CCP2X 0x20
633 //==============================================================================
636 //==============================================================================
637 // OPTION_REG Bits
639 extern __at(0x0081) __sfr OPTION_REG;
641 typedef union
643 struct
645 unsigned PS0 : 1;
646 unsigned PS1 : 1;
647 unsigned PS2 : 1;
648 unsigned PSA : 1;
649 unsigned T0SE : 1;
650 unsigned T0CS : 1;
651 unsigned INTEDG : 1;
652 unsigned NOT_RBPU : 1;
655 struct
657 unsigned PS : 3;
658 unsigned : 5;
660 } __OPTION_REGbits_t;
662 extern __at(0x0081) volatile __OPTION_REGbits_t OPTION_REGbits;
664 #define _PS0 0x01
665 #define _PS1 0x02
666 #define _PS2 0x04
667 #define _PSA 0x08
668 #define _T0SE 0x10
669 #define _T0CS 0x20
670 #define _INTEDG 0x40
671 #define _NOT_RBPU 0x80
673 //==============================================================================
676 //==============================================================================
677 // TRISA Bits
679 extern __at(0x0085) __sfr TRISA;
681 typedef union
683 struct
685 unsigned TRISA0 : 1;
686 unsigned TRISA1 : 1;
687 unsigned TRISA2 : 1;
688 unsigned TRISA3 : 1;
689 unsigned TRISA4 : 1;
690 unsigned TRISA5 : 1;
691 unsigned : 1;
692 unsigned : 1;
695 struct
697 unsigned TRISA : 6;
698 unsigned : 2;
700 } __TRISAbits_t;
702 extern __at(0x0085) volatile __TRISAbits_t TRISAbits;
704 #define _TRISA0 0x01
705 #define _TRISA1 0x02
706 #define _TRISA2 0x04
707 #define _TRISA3 0x08
708 #define _TRISA4 0x10
709 #define _TRISA5 0x20
711 //==============================================================================
714 //==============================================================================
715 // TRISB Bits
717 extern __at(0x0086) __sfr TRISB;
719 typedef struct
721 unsigned TRISB0 : 1;
722 unsigned TRISB1 : 1;
723 unsigned TRISB2 : 1;
724 unsigned TRISB3 : 1;
725 unsigned TRISB4 : 1;
726 unsigned TRISB5 : 1;
727 unsigned TRISB6 : 1;
728 unsigned TRISB7 : 1;
729 } __TRISBbits_t;
731 extern __at(0x0086) volatile __TRISBbits_t TRISBbits;
733 #define _TRISB0 0x01
734 #define _TRISB1 0x02
735 #define _TRISB2 0x04
736 #define _TRISB3 0x08
737 #define _TRISB4 0x10
738 #define _TRISB5 0x20
739 #define _TRISB6 0x40
740 #define _TRISB7 0x80
742 //==============================================================================
745 //==============================================================================
746 // TRISC Bits
748 extern __at(0x0087) __sfr TRISC;
750 typedef struct
752 unsigned TRISC0 : 1;
753 unsigned TRISC1 : 1;
754 unsigned TRISC2 : 1;
755 unsigned TRISC3 : 1;
756 unsigned TRISC4 : 1;
757 unsigned TRISC5 : 1;
758 unsigned TRISC6 : 1;
759 unsigned TRISC7 : 1;
760 } __TRISCbits_t;
762 extern __at(0x0087) volatile __TRISCbits_t TRISCbits;
764 #define _TRISC0 0x01
765 #define _TRISC1 0x02
766 #define _TRISC2 0x04
767 #define _TRISC3 0x08
768 #define _TRISC4 0x10
769 #define _TRISC5 0x20
770 #define _TRISC6 0x40
771 #define _TRISC7 0x80
773 //==============================================================================
776 //==============================================================================
777 // PIE1 Bits
779 extern __at(0x008C) __sfr PIE1;
781 typedef struct
783 unsigned TMR1IE : 1;
784 unsigned TMR2IE : 1;
785 unsigned CCP1IE : 1;
786 unsigned SSPIE : 1;
787 unsigned TXIE : 1;
788 unsigned RCIE : 1;
789 unsigned : 1;
790 unsigned : 1;
791 } __PIE1bits_t;
793 extern __at(0x008C) volatile __PIE1bits_t PIE1bits;
795 #define _TMR1IE 0x01
796 #define _TMR2IE 0x02
797 #define _CCP1IE 0x04
798 #define _SSPIE 0x08
799 #define _TXIE 0x10
800 #define _RCIE 0x20
802 //==============================================================================
805 //==============================================================================
806 // PIE2 Bits
808 extern __at(0x008D) __sfr PIE2;
810 typedef struct
812 unsigned CCP2IE : 1;
813 unsigned : 1;
814 unsigned : 1;
815 unsigned : 1;
816 unsigned : 1;
817 unsigned : 1;
818 unsigned : 1;
819 unsigned : 1;
820 } __PIE2bits_t;
822 extern __at(0x008D) volatile __PIE2bits_t PIE2bits;
824 #define _CCP2IE 0x01
826 //==============================================================================
829 //==============================================================================
830 // PCON Bits
832 extern __at(0x008E) __sfr PCON;
834 typedef union
836 struct
838 unsigned NOT_BOR : 1;
839 unsigned NOT_POR : 1;
840 unsigned : 1;
841 unsigned : 1;
842 unsigned : 1;
843 unsigned : 1;
844 unsigned : 1;
845 unsigned : 1;
848 struct
850 unsigned NOT_BO : 1;
851 unsigned : 1;
852 unsigned : 1;
853 unsigned : 1;
854 unsigned : 1;
855 unsigned : 1;
856 unsigned : 1;
857 unsigned : 1;
859 } __PCONbits_t;
861 extern __at(0x008E) volatile __PCONbits_t PCONbits;
863 #define _NOT_BOR 0x01
864 #define _NOT_BO 0x01
865 #define _NOT_POR 0x02
867 //==============================================================================
869 extern __at(0x0092) __sfr PR2;
870 extern __at(0x0093) __sfr SSPADD;
872 //==============================================================================
873 // SSPSTAT Bits
875 extern __at(0x0094) __sfr SSPSTAT;
877 typedef union
879 struct
881 unsigned BF : 1;
882 unsigned UA : 1;
883 unsigned R_NOT_W : 1;
884 unsigned S : 1;
885 unsigned P : 1;
886 unsigned D_NOT_A : 1;
887 unsigned CKE : 1;
888 unsigned SMP : 1;
891 struct
893 unsigned : 1;
894 unsigned : 1;
895 unsigned R : 1;
896 unsigned I2C_START : 1;
897 unsigned I2C_STOP : 1;
898 unsigned D : 1;
899 unsigned : 1;
900 unsigned : 1;
903 struct
905 unsigned : 1;
906 unsigned : 1;
907 unsigned I2C_READ : 1;
908 unsigned : 1;
909 unsigned : 1;
910 unsigned I2C_DATA : 1;
911 unsigned : 1;
912 unsigned : 1;
915 struct
917 unsigned : 1;
918 unsigned : 1;
919 unsigned R_W : 1;
920 unsigned : 1;
921 unsigned : 1;
922 unsigned D_A : 1;
923 unsigned : 1;
924 unsigned : 1;
927 struct
929 unsigned : 1;
930 unsigned : 1;
931 unsigned READ_WRITE : 1;
932 unsigned : 1;
933 unsigned : 1;
934 unsigned DATA_ADDRESS : 1;
935 unsigned : 1;
936 unsigned : 1;
939 struct
941 unsigned : 1;
942 unsigned : 1;
943 unsigned NOT_W : 1;
944 unsigned : 1;
945 unsigned : 1;
946 unsigned NOT_A : 1;
947 unsigned : 1;
948 unsigned : 1;
951 struct
953 unsigned : 1;
954 unsigned : 1;
955 unsigned NOT_WRITE : 1;
956 unsigned : 1;
957 unsigned : 1;
958 unsigned NOT_ADDRESS : 1;
959 unsigned : 1;
960 unsigned : 1;
962 } __SSPSTATbits_t;
964 extern __at(0x0094) volatile __SSPSTATbits_t SSPSTATbits;
966 #define _BF 0x01
967 #define _UA 0x02
968 #define _R_NOT_W 0x04
969 #define _R 0x04
970 #define _I2C_READ 0x04
971 #define _R_W 0x04
972 #define _READ_WRITE 0x04
973 #define _NOT_W 0x04
974 #define _NOT_WRITE 0x04
975 #define _S 0x08
976 #define _I2C_START 0x08
977 #define _P 0x10
978 #define _I2C_STOP 0x10
979 #define _D_NOT_A 0x20
980 #define _D 0x20
981 #define _I2C_DATA 0x20
982 #define _D_A 0x20
983 #define _DATA_ADDRESS 0x20
984 #define _NOT_A 0x20
985 #define _NOT_ADDRESS 0x20
986 #define _CKE 0x40
987 #define _SMP 0x80
989 //==============================================================================
992 //==============================================================================
993 // TXSTA Bits
995 extern __at(0x0098) __sfr TXSTA;
997 typedef union
999 struct
1001 unsigned TX9D : 1;
1002 unsigned TRMT : 1;
1003 unsigned BRGH : 1;
1004 unsigned : 1;
1005 unsigned SYNC : 1;
1006 unsigned TXEN : 1;
1007 unsigned TX9 : 1;
1008 unsigned CSRC : 1;
1011 struct
1013 unsigned TXD8 : 1;
1014 unsigned : 1;
1015 unsigned : 1;
1016 unsigned : 1;
1017 unsigned : 1;
1018 unsigned : 1;
1019 unsigned NOT_TX8 : 1;
1020 unsigned : 1;
1023 struct
1025 unsigned : 1;
1026 unsigned : 1;
1027 unsigned : 1;
1028 unsigned : 1;
1029 unsigned : 1;
1030 unsigned : 1;
1031 unsigned TX8_9 : 1;
1032 unsigned : 1;
1034 } __TXSTAbits_t;
1036 extern __at(0x0098) volatile __TXSTAbits_t TXSTAbits;
1038 #define _TX9D 0x01
1039 #define _TXD8 0x01
1040 #define _TRMT 0x02
1041 #define _BRGH 0x04
1042 #define _SYNC 0x10
1043 #define _TXEN 0x20
1044 #define _TX9 0x40
1045 #define _NOT_TX8 0x40
1046 #define _TX8_9 0x40
1047 #define _CSRC 0x80
1049 //==============================================================================
1051 extern __at(0x0099) __sfr SPBRG;
1053 //==============================================================================
1055 // Configuration Bits
1057 //==============================================================================
1059 #define _CONFIG1 0x2007
1061 //----------------------------- CONFIG1 Options -------------------------------
1063 #define _FOSC_LP 0x3FFC // LP oscillator.
1064 #define _LP_OSC 0x3FFC // LP oscillator.
1065 #define _FOSC_XT 0x3FFD // XT oscillator.
1066 #define _XT_OSC 0x3FFD // XT oscillator.
1067 #define _FOSC_HS 0x3FFE // HS oscillator.
1068 #define _HS_OSC 0x3FFE // HS oscillator.
1069 #define _FOSC_RC 0x3FFF // RC oscillator.
1070 #define _RC_OSC 0x3FFF // RC oscillator.
1071 #define _WDTE_OFF 0x3FFB // WDT disabled.
1072 #define _WDT_OFF 0x3FFB // WDT disabled.
1073 #define _WDTE_ON 0x3FFF // WDT enabled.
1074 #define _WDT_ON 0x3FFF // WDT enabled.
1075 #define _PWRTE_ON 0x3FF7 // PWRT enabled.
1076 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
1077 #define _CP_ALL 0x00CF // All memory is code protected.
1078 #define _CP_75 0x15DF // 0400h-0FFFh code protected.
1079 #define _CP_50 0x2AEF // 0800h-0FFFh code protected.
1080 #define _CP_OFF 0x3FFF // Code protection off.
1081 #define _BOREN_OFF 0x3FBF // BOR disabled.
1082 #define _BODEN_OFF 0x3FBF // BOR disabled.
1083 #define _BOREN_ON 0x3FFF // BOR enabled.
1084 #define _BODEN_ON 0x3FFF // BOR enabled.
1086 //==============================================================================
1088 #define _IDLOC0 0x2000
1089 #define _IDLOC1 0x2001
1090 #define _IDLOC2 0x2002
1091 #define _IDLOC3 0x2003
1093 //==============================================================================
1095 #ifndef NO_BIT_DEFINES
1097 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
1098 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
1099 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
1100 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
1101 #define CCP1Y CCP1CONbits.CCP1Y // bit 4
1102 #define CCP1X CCP1CONbits.CCP1X // bit 5
1104 #define CCP2M0 CCP2CONbits.CCP2M0 // bit 0
1105 #define CCP2M1 CCP2CONbits.CCP2M1 // bit 1
1106 #define CCP2M2 CCP2CONbits.CCP2M2 // bit 2
1107 #define CCP2M3 CCP2CONbits.CCP2M3 // bit 3
1108 #define CCP2Y CCP2CONbits.CCP2Y // bit 4
1109 #define CCP2X CCP2CONbits.CCP2X // bit 5
1111 #define RBIF INTCONbits.RBIF // bit 0
1112 #define INTF INTCONbits.INTF // bit 1
1113 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
1114 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
1115 #define RBIE INTCONbits.RBIE // bit 3
1116 #define INTE INTCONbits.INTE // bit 4
1117 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
1118 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
1119 #define PEIE INTCONbits.PEIE // bit 6
1120 #define GIE INTCONbits.GIE // bit 7
1122 #define PS0 OPTION_REGbits.PS0 // bit 0
1123 #define PS1 OPTION_REGbits.PS1 // bit 1
1124 #define PS2 OPTION_REGbits.PS2 // bit 2
1125 #define PSA OPTION_REGbits.PSA // bit 3
1126 #define T0SE OPTION_REGbits.T0SE // bit 4
1127 #define T0CS OPTION_REGbits.T0CS // bit 5
1128 #define INTEDG OPTION_REGbits.INTEDG // bit 6
1129 #define NOT_RBPU OPTION_REGbits.NOT_RBPU // bit 7
1131 #define NOT_BOR PCONbits.NOT_BOR // bit 0, shadows bit in PCONbits
1132 #define NOT_BO PCONbits.NOT_BO // bit 0, shadows bit in PCONbits
1133 #define NOT_POR PCONbits.NOT_POR // bit 1
1135 #define TMR1IE PIE1bits.TMR1IE // bit 0
1136 #define TMR2IE PIE1bits.TMR2IE // bit 1
1137 #define CCP1IE PIE1bits.CCP1IE // bit 2
1138 #define SSPIE PIE1bits.SSPIE // bit 3
1139 #define TXIE PIE1bits.TXIE // bit 4
1140 #define RCIE PIE1bits.RCIE // bit 5
1142 #define CCP2IE PIE2bits.CCP2IE // bit 0
1144 #define TMR1IF PIR1bits.TMR1IF // bit 0
1145 #define TMR2IF PIR1bits.TMR2IF // bit 1
1146 #define CCP1IF PIR1bits.CCP1IF // bit 2
1147 #define SSPIF PIR1bits.SSPIF // bit 3
1148 #define TXIF PIR1bits.TXIF // bit 4
1149 #define RCIF PIR1bits.RCIF // bit 5
1151 #define CCP2IF PIR2bits.CCP2IF // bit 0
1153 #define RA0 PORTAbits.RA0 // bit 0
1154 #define RA1 PORTAbits.RA1 // bit 1
1155 #define RA2 PORTAbits.RA2 // bit 2
1156 #define RA3 PORTAbits.RA3 // bit 3
1157 #define RA4 PORTAbits.RA4 // bit 4
1158 #define RA5 PORTAbits.RA5 // bit 5
1160 #define RB0 PORTBbits.RB0 // bit 0
1161 #define RB1 PORTBbits.RB1 // bit 1
1162 #define RB2 PORTBbits.RB2 // bit 2
1163 #define RB3 PORTBbits.RB3 // bit 3
1164 #define RB4 PORTBbits.RB4 // bit 4
1165 #define RB5 PORTBbits.RB5 // bit 5
1166 #define RB6 PORTBbits.RB6 // bit 6
1167 #define RB7 PORTBbits.RB7 // bit 7
1169 #define RC0 PORTCbits.RC0 // bit 0
1170 #define RC1 PORTCbits.RC1 // bit 1
1171 #define RC2 PORTCbits.RC2 // bit 2
1172 #define RC3 PORTCbits.RC3 // bit 3
1173 #define RC4 PORTCbits.RC4 // bit 4
1174 #define RC5 PORTCbits.RC5 // bit 5
1175 #define RC6 PORTCbits.RC6 // bit 6
1176 #define RC7 PORTCbits.RC7 // bit 7
1178 #define RX9D RCSTAbits.RX9D // bit 0, shadows bit in RCSTAbits
1179 #define RCD8 RCSTAbits.RCD8 // bit 0, shadows bit in RCSTAbits
1180 #define OERR RCSTAbits.OERR // bit 1
1181 #define FERR RCSTAbits.FERR // bit 2
1182 #define CREN RCSTAbits.CREN // bit 4
1183 #define SREN RCSTAbits.SREN // bit 5
1184 #define RX9 RCSTAbits.RX9 // bit 6, shadows bit in RCSTAbits
1185 #define RC9 RCSTAbits.RC9 // bit 6, shadows bit in RCSTAbits
1186 #define NOT_RC8 RCSTAbits.NOT_RC8 // bit 6, shadows bit in RCSTAbits
1187 #define RC8_9 RCSTAbits.RC8_9 // bit 6, shadows bit in RCSTAbits
1188 #define SPEN RCSTAbits.SPEN // bit 7
1190 #define SSPM0 SSPCONbits.SSPM0 // bit 0
1191 #define SSPM1 SSPCONbits.SSPM1 // bit 1
1192 #define SSPM2 SSPCONbits.SSPM2 // bit 2
1193 #define SSPM3 SSPCONbits.SSPM3 // bit 3
1194 #define CKP SSPCONbits.CKP // bit 4
1195 #define SSPEN SSPCONbits.SSPEN // bit 5
1196 #define SSPOV SSPCONbits.SSPOV // bit 6
1197 #define WCOL SSPCONbits.WCOL // bit 7
1199 #define BF SSPSTATbits.BF // bit 0
1200 #define UA SSPSTATbits.UA // bit 1
1201 #define R_NOT_W SSPSTATbits.R_NOT_W // bit 2, shadows bit in SSPSTATbits
1202 #define R SSPSTATbits.R // bit 2, shadows bit in SSPSTATbits
1203 #define I2C_READ SSPSTATbits.I2C_READ // bit 2, shadows bit in SSPSTATbits
1204 #define R_W SSPSTATbits.R_W // bit 2, shadows bit in SSPSTATbits
1205 #define READ_WRITE SSPSTATbits.READ_WRITE // bit 2, shadows bit in SSPSTATbits
1206 #define NOT_W SSPSTATbits.NOT_W // bit 2, shadows bit in SSPSTATbits
1207 #define NOT_WRITE SSPSTATbits.NOT_WRITE // bit 2, shadows bit in SSPSTATbits
1208 #define S SSPSTATbits.S // bit 3, shadows bit in SSPSTATbits
1209 #define I2C_START SSPSTATbits.I2C_START // bit 3, shadows bit in SSPSTATbits
1210 #define P SSPSTATbits.P // bit 4, shadows bit in SSPSTATbits
1211 #define I2C_STOP SSPSTATbits.I2C_STOP // bit 4, shadows bit in SSPSTATbits
1212 #define D_NOT_A SSPSTATbits.D_NOT_A // bit 5, shadows bit in SSPSTATbits
1213 #define D SSPSTATbits.D // bit 5, shadows bit in SSPSTATbits
1214 #define I2C_DATA SSPSTATbits.I2C_DATA // bit 5, shadows bit in SSPSTATbits
1215 #define D_A SSPSTATbits.D_A // bit 5, shadows bit in SSPSTATbits
1216 #define DATA_ADDRESS SSPSTATbits.DATA_ADDRESS // bit 5, shadows bit in SSPSTATbits
1217 #define NOT_A SSPSTATbits.NOT_A // bit 5, shadows bit in SSPSTATbits
1218 #define NOT_ADDRESS SSPSTATbits.NOT_ADDRESS // bit 5, shadows bit in SSPSTATbits
1219 #define CKE SSPSTATbits.CKE // bit 6
1220 #define SMP SSPSTATbits.SMP // bit 7
1222 #define C STATUSbits.C // bit 0
1223 #define DC STATUSbits.DC // bit 1
1224 #define Z STATUSbits.Z // bit 2
1225 #define NOT_PD STATUSbits.NOT_PD // bit 3
1226 #define NOT_TO STATUSbits.NOT_TO // bit 4
1227 #define RP0 STATUSbits.RP0 // bit 5
1228 #define RP1 STATUSbits.RP1 // bit 6
1229 #define IRP STATUSbits.IRP // bit 7
1231 #define TMR1ON T1CONbits.TMR1ON // bit 0
1232 #define TMR1CS T1CONbits.TMR1CS // bit 1
1233 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2, shadows bit in T1CONbits
1234 #define T1INSYNC T1CONbits.T1INSYNC // bit 2, shadows bit in T1CONbits
1235 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
1236 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
1237 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
1239 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
1240 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
1241 #define TMR2ON T2CONbits.TMR2ON // bit 2
1242 #define TOUTPS0 T2CONbits.TOUTPS0 // bit 3
1243 #define TOUTPS1 T2CONbits.TOUTPS1 // bit 4
1244 #define TOUTPS2 T2CONbits.TOUTPS2 // bit 5
1245 #define TOUTPS3 T2CONbits.TOUTPS3 // bit 6
1247 #define TRISA0 TRISAbits.TRISA0 // bit 0
1248 #define TRISA1 TRISAbits.TRISA1 // bit 1
1249 #define TRISA2 TRISAbits.TRISA2 // bit 2
1250 #define TRISA3 TRISAbits.TRISA3 // bit 3
1251 #define TRISA4 TRISAbits.TRISA4 // bit 4
1252 #define TRISA5 TRISAbits.TRISA5 // bit 5
1254 #define TRISB0 TRISBbits.TRISB0 // bit 0
1255 #define TRISB1 TRISBbits.TRISB1 // bit 1
1256 #define TRISB2 TRISBbits.TRISB2 // bit 2
1257 #define TRISB3 TRISBbits.TRISB3 // bit 3
1258 #define TRISB4 TRISBbits.TRISB4 // bit 4
1259 #define TRISB5 TRISBbits.TRISB5 // bit 5
1260 #define TRISB6 TRISBbits.TRISB6 // bit 6
1261 #define TRISB7 TRISBbits.TRISB7 // bit 7
1263 #define TRISC0 TRISCbits.TRISC0 // bit 0
1264 #define TRISC1 TRISCbits.TRISC1 // bit 1
1265 #define TRISC2 TRISCbits.TRISC2 // bit 2
1266 #define TRISC3 TRISCbits.TRISC3 // bit 3
1267 #define TRISC4 TRISCbits.TRISC4 // bit 4
1268 #define TRISC5 TRISCbits.TRISC5 // bit 5
1269 #define TRISC6 TRISCbits.TRISC6 // bit 6
1270 #define TRISC7 TRISCbits.TRISC7 // bit 7
1272 #define TX9D TXSTAbits.TX9D // bit 0, shadows bit in TXSTAbits
1273 #define TXD8 TXSTAbits.TXD8 // bit 0, shadows bit in TXSTAbits
1274 #define TRMT TXSTAbits.TRMT // bit 1
1275 #define BRGH TXSTAbits.BRGH // bit 2
1276 #define SYNC TXSTAbits.SYNC // bit 4
1277 #define TXEN TXSTAbits.TXEN // bit 5
1278 #define TX9 TXSTAbits.TX9 // bit 6, shadows bit in TXSTAbits
1279 #define NOT_TX8 TXSTAbits.NOT_TX8 // bit 6, shadows bit in TXSTAbits
1280 #define TX8_9 TXSTAbits.TX8_9 // bit 6, shadows bit in TXSTAbits
1281 #define CSRC TXSTAbits.CSRC // bit 7
1283 #endif // #ifndef NO_BIT_DEFINES
1285 #endif // #ifndef __PIC16C63A_H__