Imported Upstream version 2.9.0
[debian/cc1111] / device / include / pic / pic16c926.h
1 //
2 // Register Declarations for Microchip 16C926 Processor
3 //
4 //
5 // This header file was automatically generated by:
6 //
7 //      inc2h.pl V4783
8 //
9 //      Copyright (c) 2002, Kevin L. Pauba, All Rights Reserved
10 //
11 //      SDCC is licensed under the GNU Public license (GPL) v2.  Note that
12 //      this license covers the code to the compiler and other executables,
13 //      but explicitly does not cover any code or objects generated by sdcc.
14 //      We have not yet decided on a license for the run time libraries, but
15 //      it will not put any requirements on code linked against it. See:
16 // 
17 //      http://www.gnu.org/copyleft/gpl/html
18 //
19 //      See http://sdcc.sourceforge.net/ for the latest information on sdcc.
20 //
21 // 
22 #ifndef P16C926_H
23 #define P16C926_H
24
25 //
26 // Register addresses.
27 //
28 #define INDF_ADDR       0x0000
29 #define TMR0_ADDR       0x0001
30 #define PCL_ADDR        0x0002
31 #define STATUS_ADDR     0x0003
32 #define FSR_ADDR        0x0004
33 #define PORTA_ADDR      0x0005
34 #define PORTB_ADDR      0x0006
35 #define PORTC_ADDR      0x0007
36 #define PORTD_ADDR      0x0008
37 #define PORTE_ADDR      0x0009
38 #define PCLATH_ADDR     0x000A
39 #define INTCON_ADDR     0x000B
40 #define PIR1_ADDR       0x000C
41 #define TMR1L_ADDR      0x000E
42 #define TMR1H_ADDR      0x000F
43 #define T1CON_ADDR      0x0010
44 #define TMR2_ADDR       0x0011
45 #define T2CON_ADDR      0x0012
46 #define SSPBUF_ADDR     0x0013
47 #define SSPCON_ADDR     0x0014
48 #define CCPR1L_ADDR     0x0015
49 #define CCPR1H_ADDR     0x0016
50 #define CCP1CON_ADDR    0x0017
51 #define ADRESH_ADDR     0x001E
52 #define ADCON0_ADDR     0x001F
53 #define OPTION_REG_ADDR 0x0081
54 #define TRISA_ADDR      0x0085
55 #define TRISB_ADDR      0x0086
56 #define TRISC_ADDR      0x0087
57 #define TRISD_ADDR      0x0088
58 #define TRISE_ADDR      0x0089
59 #define PIE1_ADDR       0x008C
60 #define PCON_ADDR       0x008E
61 #define PR2_ADDR        0x0092
62 #define SSPADD_ADDR     0x0093
63 #define SSPSTAT_ADDR    0x0094
64 #define ADRESL_ADDR     0x009E
65 #define ADCON1_ADDR     0x009F
66 #define PORTF_ADDR      0x0107
67 #define PORTG_ADDR      0x0108
68 #define PMCON1_ADDR     0x010C
69 #define LCDSE_ADDR      0x010D
70 #define LCDPS_ADDR      0x010E
71 #define LCDCON_ADDR     0x010F
72 #define LCDD00_ADDR     0x0110
73 #define LCDD01_ADDR     0x0111
74 #define LCDD02_ADDR     0x0112
75 #define LCDD03_ADDR     0x0113
76 #define LCDD04_ADDR     0x0114
77 #define LCDD05_ADDR     0x0115
78 #define LCDD06_ADDR     0x0116
79 #define LCDD07_ADDR     0x0117
80 #define LCDD08_ADDR     0x0118
81 #define LCDD09_ADDR     0x0119
82 #define LCDD10_ADDR     0x011A
83 #define LCDD11_ADDR     0x011B
84 #define LCDD12_ADDR     0x011C
85 #define LCDD13_ADDR     0x011D
86 #define LCDD14_ADDR     0x011E
87 #define LCDD15_ADDR     0x011F
88 #define TRISF_ADDR      0x0187
89 #define TRISG_ADDR      0x0188
90 #define PMDATA_ADDR     0x018C
91 #define PMDATH_ADDR     0x018D
92 #define PMADR_ADDR      0x018E
93 #define PMADRH_ADDR     0x018F
94
95 //
96 // Memory organization.
97 //
98
99
100
101 //         LIST
102 // P16C926.INC  Standard Header File, Version 1.02   Microchip Technology, Inc.
103 //         NOLIST
104
105 // This header file defines configurations, registers, and other useful bits of
106 // information for the PIC16C926 microcontroller.  These names are taken to match 
107 // the data sheets as closely as possible.  
108
109 // Note that the processor must be selected before this file is 
110 // included.  The processor may be selected the following ways:
111
112 //       1. Command line switch:
113 //               C:\ MPASM MYFILE.ASM /PIC16C926
114 //       2. LIST directive in the source file
115 //               LIST   P=PIC16C926
116 //       3. Processor Type entry in the MPASM full-screen interface
117
118 //==========================================================================
119 //
120 //       Revision History
121 //
122 //==========================================================================
123
124 //Rev:   Date:    Reason:
125
126 //1.00   10/11/00 Initial Release
127 //1.01   02/27/01 Changes to reflect design changes to data memory map:
128 //                1.) Locations of PMDATA and PMCON1 swapped.
129 //                2.) Locations of PMDATH and PMADR swapped.
130 //1.02   03/02/01 PORTF, PORTG, TRISF, and TRISG addresses corrected.
131 //1.03   03/06/01 RD bit in PMCON1 defined.
132 //1.04   03/12/01 Locations of PMDATH and PMADR restored to before v1.01.
133 //1.05  10/19/01 Locations of PMDATH and PMADR restored to before v1.04.
134 //1.06  06/03/01 Values for _CP_ALL, _CP_75, _CP_50, and _BODEN_OFF corrected.
135
136 //==========================================================================
137 //
138 //       Verify Processor
139 //
140 //==========================================================================
141
142 //        IFNDEF __16C926
143 //            MESSG "Processor-header file mismatch.  Verify selected processor."
144 //         ENDIF
145
146 //==========================================================================
147 //
148 //       Register Definitions
149 //
150 //==========================================================================
151
152 #define W                    0x0000
153 #define F                    0x0001
154
155 //----- Register Files------------------------------------------------------
156
157 extern __sfr  __at (INDF_ADDR)                    INDF;
158 extern __sfr  __at (TMR0_ADDR)                    TMR0;
159 extern __sfr  __at (PCL_ADDR)                     PCL;
160 extern __sfr  __at (STATUS_ADDR)                  STATUS;
161 extern __sfr  __at (FSR_ADDR)                     FSR;
162 extern __sfr  __at (PORTA_ADDR)                   PORTA;
163 extern __sfr  __at (PORTB_ADDR)                   PORTB;
164 extern __sfr  __at (PORTC_ADDR)                   PORTC;
165 extern __sfr  __at (PORTD_ADDR)                   PORTD;
166 extern __sfr  __at (PORTE_ADDR)                   PORTE;
167 extern __sfr  __at (PCLATH_ADDR)                  PCLATH;
168 extern __sfr  __at (INTCON_ADDR)                  INTCON;
169 extern __sfr  __at (PIR1_ADDR)                    PIR1;
170 extern __sfr  __at (TMR1L_ADDR)                   TMR1L;
171 extern __sfr  __at (TMR1H_ADDR)                   TMR1H;
172 extern __sfr  __at (T1CON_ADDR)                   T1CON;
173 extern __sfr  __at (TMR2_ADDR)                    TMR2;
174 extern __sfr  __at (T2CON_ADDR)                   T2CON;
175 extern __sfr  __at (SSPBUF_ADDR)                  SSPBUF;
176 extern __sfr  __at (SSPCON_ADDR)                  SSPCON;
177 extern __sfr  __at (CCPR1L_ADDR)                  CCPR1L;
178 extern __sfr  __at (CCPR1H_ADDR)                  CCPR1H;
179 extern __sfr  __at (CCP1CON_ADDR)                 CCP1CON;
180 extern __sfr  __at (ADRESH_ADDR)                  ADRESH;
181 extern __sfr  __at (ADCON0_ADDR)                  ADCON0;
182
183 extern __sfr  __at (OPTION_REG_ADDR)              OPTION_REG;
184 extern __sfr  __at (TRISA_ADDR)                   TRISA;
185 extern __sfr  __at (TRISB_ADDR)                   TRISB;
186 extern __sfr  __at (TRISC_ADDR)                   TRISC;
187 extern __sfr  __at (TRISD_ADDR)                   TRISD;
188 extern __sfr  __at (TRISE_ADDR)                   TRISE;
189 extern __sfr  __at (PIE1_ADDR)                    PIE1;
190 extern __sfr  __at (PCON_ADDR)                    PCON;
191 extern __sfr  __at (PR2_ADDR)                     PR2;
192 extern __sfr  __at (SSPADD_ADDR)                  SSPADD;
193 extern __sfr  __at (SSPSTAT_ADDR)                 SSPSTAT;
194 extern __sfr  __at (ADRESL_ADDR)                  ADRESL;
195 extern __sfr  __at (ADCON1_ADDR)                  ADCON1;
196
197 extern __sfr  __at (PORTF_ADDR)                   PORTF;
198 extern __sfr  __at (PORTG_ADDR)                   PORTG;
199 extern __sfr  __at (PMCON1_ADDR)                  PMCON1;
200 extern __sfr  __at (LCDSE_ADDR)                   LCDSE;
201 extern __sfr  __at (LCDPS_ADDR)                   LCDPS;
202 extern __sfr  __at (LCDCON_ADDR)                  LCDCON;
203 extern __sfr  __at (LCDD00_ADDR)                  LCDD00;
204 extern __sfr  __at (LCDD01_ADDR)                  LCDD01;
205 extern __sfr  __at (LCDD02_ADDR)                  LCDD02;
206 extern __sfr  __at (LCDD03_ADDR)                  LCDD03;
207 extern __sfr  __at (LCDD04_ADDR)                  LCDD04;
208 extern __sfr  __at (LCDD05_ADDR)                  LCDD05;
209 extern __sfr  __at (LCDD06_ADDR)                  LCDD06;
210 extern __sfr  __at (LCDD07_ADDR)                  LCDD07;
211 extern __sfr  __at (LCDD08_ADDR)                  LCDD08;
212 extern __sfr  __at (LCDD09_ADDR)                  LCDD09;
213 extern __sfr  __at (LCDD10_ADDR)                  LCDD10;
214 extern __sfr  __at (LCDD11_ADDR)                  LCDD11;
215 extern __sfr  __at (LCDD12_ADDR)                  LCDD12;
216 extern __sfr  __at (LCDD13_ADDR)                  LCDD13;
217 extern __sfr  __at (LCDD14_ADDR)                  LCDD14;
218 extern __sfr  __at (LCDD15_ADDR)                  LCDD15;
219
220 extern __sfr  __at (TRISF_ADDR)                   TRISF;
221 extern __sfr  __at (TRISG_ADDR)                   TRISG;
222 extern __sfr  __at (PMDATA_ADDR)                  PMDATA;
223 extern __sfr  __at (PMDATH_ADDR)                  PMDATH;
224 extern __sfr  __at (PMADR_ADDR)                   PMADR;
225 extern __sfr  __at (PMADRH_ADDR)                  PMADRH;
226
227
228 //----- STATUS Bits --------------------------------------------------------
229
230
231 //----- INTCON Bits --------------------------------------------------------
232
233
234 //----- PIR1 Bits ----------------------------------------------------------
235
236
237 //----- T1CON Bits ---------------------------------------------------------
238
239
240 //----- T2CON Bits ---------------------------------------------------------
241
242
243 //----- SSPCON Bits --------------------------------------------------------
244
245
246 //----- CCP1CON Bits -------------------------------------------------------
247
248
249 //----- ADCON0 Bits --------------------------------------------------------
250
251
252 //----- ADCON1 Bits --------------------------------------------------------
253
254
255
256 //----- OPTION Bits --------------------------------------------------------
257
258
259 //----- TRISE Bits ---------------------------------------------------------
260
261
262 //----- PIE1 Bits ----------------------------------------------------------
263
264
265 //----- PCON Bits ----------------------------------------------------------
266
267
268 //----- SSPSTAT Bits -------------------------------------------------------
269
270
271 //----- ADCON1 Bits --------------------------------------------------------
272
273
274 //----- LCDSE Bits ---------------------------------------------------------
275
276
277 //----- LCDPS Bits ---------------------------------------------------------
278
279
280 //----- LCDCON Bits --------------------------------------------------------
281
282
283 //----- PMCON1 Bits --------------------------------------------------------
284
285 //==========================================================================
286 //
287 //       RAM Definition
288 //
289 //==========================================================================
290
291 //         __MAXRAM H'1FF'
292 //         __BADRAM H'0D', H'18'-H'1D'
293 //         __BADRAM H'8D', H'8F'-H'91', H'95'-H'9D'
294 //         __BADRAM H'105', H'109'
295 //         __BADRAM H'185', H'189', H'190'-H'19F'
296
297 //==========================================================================
298 //
299 //       Configuration Bits
300 //
301 //==========================================================================
302
303 #define _CP_ALL              0x3FCF
304 #define _CP_75               0x3FDF
305 #define _CP_50               0x3FEF
306 #define _CP_OFF              0x3FFF
307 #define _BODEN_OFF           0x3FBF
308 #define _BODEN_ON            0x3FFF
309 #define _PWRTE_OFF           0x3FFF
310 #define _PWRTE_ON            0x3FF7
311 #define _WDT_ON              0x3FFF
312 #define _WDT_OFF             0x3FFB
313 #define _LP_OSC              0x3FFC
314 #define _XT_OSC              0x3FFD
315 #define _HS_OSC              0x3FFE
316 #define _RC_OSC              0x3FFF
317
318 //         LIST
319
320 // ----- ADCON0 bits --------------------
321 typedef union {
322   struct {
323     unsigned char ADON:1;
324     unsigned char :1;
325     unsigned char GO:1;
326     unsigned char CHS0:1;
327     unsigned char CHS1:1;
328     unsigned char CHS2:1;
329     unsigned char ADCS0:1;
330     unsigned char ADCS1:1;
331   };
332   struct {
333     unsigned char :1;
334     unsigned char :1;
335     unsigned char NOT_DONE:1;
336     unsigned char :1;
337     unsigned char :1;
338     unsigned char :1;
339     unsigned char :1;
340     unsigned char :1;
341   };
342   struct {
343     unsigned char :1;
344     unsigned char :1;
345     unsigned char GO_DONE:1;
346     unsigned char :1;
347     unsigned char :1;
348     unsigned char :1;
349     unsigned char :1;
350     unsigned char :1;
351   };
352 } __ADCON0_bits_t;
353 extern volatile __ADCON0_bits_t __at(ADCON0_ADDR) ADCON0_bits;
354
355 #ifndef NO_BIT_DEFINES
356 #define ADON                 ADCON0_bits.ADON
357 #define GO                   ADCON0_bits.GO
358 #define NOT_DONE             ADCON0_bits.NOT_DONE
359 #define GO_DONE              ADCON0_bits.GO_DONE
360 #define CHS0                 ADCON0_bits.CHS0
361 #define CHS1                 ADCON0_bits.CHS1
362 #define CHS2                 ADCON0_bits.CHS2
363 #define ADCS0                ADCON0_bits.ADCS0
364 #define ADCS1                ADCON0_bits.ADCS1
365 #endif /* NO_BIT_DEFINES */
366
367 // ----- ADCON1 bits --------------------
368 typedef union {
369   struct {
370     unsigned char PCFG0:1;
371     unsigned char PCFG1:1;
372     unsigned char PCFG2:1;
373     unsigned char PCFG3:1;
374     unsigned char :1;
375     unsigned char :1;
376     unsigned char :1;
377     unsigned char ADFM:1;
378   };
379 } __ADCON1_bits_t;
380 extern volatile __ADCON1_bits_t __at(ADCON1_ADDR) ADCON1_bits;
381
382 #ifndef NO_BIT_DEFINES
383 #define PCFG0                ADCON1_bits.PCFG0
384 #define PCFG1                ADCON1_bits.PCFG1
385 #define PCFG2                ADCON1_bits.PCFG2
386 #define PCFG3                ADCON1_bits.PCFG3
387 #define ADFM                 ADCON1_bits.ADFM
388 #endif /* NO_BIT_DEFINES */
389
390 // ----- CCP1CON bits --------------------
391 typedef union {
392   struct {
393     unsigned char CCP1M0:1;
394     unsigned char CCP1M1:1;
395     unsigned char CCP1M2:1;
396     unsigned char CCP1M3:1;
397     unsigned char CCP1Y:1;
398     unsigned char CCP1X:1;
399     unsigned char :1;
400     unsigned char :1;
401   };
402 } __CCP1CON_bits_t;
403 extern volatile __CCP1CON_bits_t __at(CCP1CON_ADDR) CCP1CON_bits;
404
405 #ifndef NO_BIT_DEFINES
406 #define CCP1M0               CCP1CON_bits.CCP1M0
407 #define CCP1M1               CCP1CON_bits.CCP1M1
408 #define CCP1M2               CCP1CON_bits.CCP1M2
409 #define CCP1M3               CCP1CON_bits.CCP1M3
410 #define CCP1Y                CCP1CON_bits.CCP1Y
411 #define CCP1X                CCP1CON_bits.CCP1X
412 #endif /* NO_BIT_DEFINES */
413
414 // ----- INTCON bits --------------------
415 typedef union {
416   struct {
417     unsigned char RBIF:1;
418     unsigned char INTF:1;
419     unsigned char T0IF:1;
420     unsigned char RBIE:1;
421     unsigned char INTE:1;
422     unsigned char T0IE:1;
423     unsigned char PEIE:1;
424     unsigned char GIE:1;
425   };
426 } __INTCON_bits_t;
427 extern volatile __INTCON_bits_t __at(INTCON_ADDR) INTCON_bits;
428
429 #ifndef NO_BIT_DEFINES
430 #define RBIF                 INTCON_bits.RBIF
431 #define INTF                 INTCON_bits.INTF
432 #define T0IF                 INTCON_bits.T0IF
433 #define RBIE                 INTCON_bits.RBIE
434 #define INTE                 INTCON_bits.INTE
435 #define T0IE                 INTCON_bits.T0IE
436 #define PEIE                 INTCON_bits.PEIE
437 #define GIE                  INTCON_bits.GIE
438 #endif /* NO_BIT_DEFINES */
439
440 // ----- LCDCON bits --------------------
441 typedef union {
442   struct {
443     unsigned char LMUX0:1;
444     unsigned char LMUX1:1;
445     unsigned char CS0:1;
446     unsigned char CS1:1;
447     unsigned char BIAS:1;
448     unsigned char WERR:1;
449     unsigned char SLPEN:1;
450     unsigned char LCDEN:1;
451   };
452 } __LCDCON_bits_t;
453 extern volatile __LCDCON_bits_t __at(LCDCON_ADDR) LCDCON_bits;
454
455 #ifndef NO_BIT_DEFINES
456 #define LMUX0                LCDCON_bits.LMUX0
457 #define LMUX1                LCDCON_bits.LMUX1
458 #define CS0                  LCDCON_bits.CS0
459 #define CS1                  LCDCON_bits.CS1
460 #define BIAS                 LCDCON_bits.BIAS
461 #define WERR                 LCDCON_bits.WERR
462 #define SLPEN                LCDCON_bits.SLPEN
463 #define LCDEN                LCDCON_bits.LCDEN
464 #endif /* NO_BIT_DEFINES */
465
466 // ----- LCDPS bits --------------------
467 typedef union {
468   struct {
469     unsigned char LP0:1;
470     unsigned char LP1:1;
471     unsigned char LP2:1;
472     unsigned char LP3:1;
473     unsigned char :1;
474     unsigned char :1;
475     unsigned char :1;
476     unsigned char :1;
477   };
478 } __LCDPS_bits_t;
479 extern volatile __LCDPS_bits_t __at(LCDPS_ADDR) LCDPS_bits;
480
481 #ifndef NO_BIT_DEFINES
482 #define LP0                  LCDPS_bits.LP0
483 #define LP1                  LCDPS_bits.LP1
484 #define LP2                  LCDPS_bits.LP2
485 #define LP3                  LCDPS_bits.LP3
486 #endif /* NO_BIT_DEFINES */
487
488 // ----- LCDSE bits --------------------
489 typedef union {
490   struct {
491     unsigned char SE0:1;
492     unsigned char SE5:1;
493     unsigned char SE9:1;
494     unsigned char SE12:1;
495     unsigned char SE16:1;
496     unsigned char SE20:1;
497     unsigned char SE27:1;
498     unsigned char SE29:1;
499   };
500 } __LCDSE_bits_t;
501 extern volatile __LCDSE_bits_t __at(LCDSE_ADDR) LCDSE_bits;
502
503 #ifndef NO_BIT_DEFINES
504 #define SE0                  LCDSE_bits.SE0
505 #define SE5                  LCDSE_bits.SE5
506 #define SE9                  LCDSE_bits.SE9
507 #define SE12                 LCDSE_bits.SE12
508 #define SE16                 LCDSE_bits.SE16
509 #define SE20                 LCDSE_bits.SE20
510 #define SE27                 LCDSE_bits.SE27
511 #define SE29                 LCDSE_bits.SE29
512 #endif /* NO_BIT_DEFINES */
513
514 // ----- OPTION_REG bits --------------------
515 typedef union {
516   struct {
517     unsigned char PS0:1;
518     unsigned char PS1:1;
519     unsigned char PS2:1;
520     unsigned char PSA:1;
521     unsigned char T0SE:1;
522     unsigned char T0CS:1;
523     unsigned char INTEDG:1;
524     unsigned char NOT_RBPU:1;
525   };
526 } __OPTION_REG_bits_t;
527 extern volatile __OPTION_REG_bits_t __at(OPTION_REG_ADDR) OPTION_REG_bits;
528
529 #ifndef NO_BIT_DEFINES
530 #define PS0                  OPTION_REG_bits.PS0
531 #define PS1                  OPTION_REG_bits.PS1
532 #define PS2                  OPTION_REG_bits.PS2
533 #define PSA                  OPTION_REG_bits.PSA
534 #define T0SE                 OPTION_REG_bits.T0SE
535 #define T0CS                 OPTION_REG_bits.T0CS
536 #define INTEDG               OPTION_REG_bits.INTEDG
537 #define NOT_RBPU             OPTION_REG_bits.NOT_RBPU
538 #endif /* NO_BIT_DEFINES */
539
540 // ----- PCON bits --------------------
541 typedef union {
542   struct {
543     unsigned char NOT_BOR:1;
544     unsigned char NOT_POR:1;
545     unsigned char :1;
546     unsigned char :1;
547     unsigned char :1;
548     unsigned char :1;
549     unsigned char :1;
550     unsigned char :1;
551   };
552 } __PCON_bits_t;
553 extern volatile __PCON_bits_t __at(PCON_ADDR) PCON_bits;
554
555 #ifndef NO_BIT_DEFINES
556 #define NOT_BOR              PCON_bits.NOT_BOR
557 #define NOT_POR              PCON_bits.NOT_POR
558 #endif /* NO_BIT_DEFINES */
559
560 // ----- PIE1 bits --------------------
561 typedef union {
562   struct {
563     unsigned char TMR1IE:1;
564     unsigned char TMR2IE:1;
565     unsigned char CCP1IE:1;
566     unsigned char SSPIE:1;
567     unsigned char :1;
568     unsigned char :1;
569     unsigned char ADIE:1;
570     unsigned char LCDIE:1;
571   };
572 } __PIE1_bits_t;
573 extern volatile __PIE1_bits_t __at(PIE1_ADDR) PIE1_bits;
574
575 #ifndef NO_BIT_DEFINES
576 #define TMR1IE               PIE1_bits.TMR1IE
577 #define TMR2IE               PIE1_bits.TMR2IE
578 #define CCP1IE               PIE1_bits.CCP1IE
579 #define SSPIE                PIE1_bits.SSPIE
580 #define ADIE                 PIE1_bits.ADIE
581 #define LCDIE                PIE1_bits.LCDIE
582 #endif /* NO_BIT_DEFINES */
583
584 // ----- PIR1 bits --------------------
585 typedef union {
586   struct {
587     unsigned char TMR1IF:1;
588     unsigned char TMR2IF:1;
589     unsigned char CCP1IF:1;
590     unsigned char SSPIF:1;
591     unsigned char :1;
592     unsigned char :1;
593     unsigned char ADIF:1;
594     unsigned char LCDIF:1;
595   };
596 } __PIR1_bits_t;
597 extern volatile __PIR1_bits_t __at(PIR1_ADDR) PIR1_bits;
598
599 #ifndef NO_BIT_DEFINES
600 #define TMR1IF               PIR1_bits.TMR1IF
601 #define TMR2IF               PIR1_bits.TMR2IF
602 #define CCP1IF               PIR1_bits.CCP1IF
603 #define SSPIF                PIR1_bits.SSPIF
604 #define ADIF                 PIR1_bits.ADIF
605 #define LCDIF                PIR1_bits.LCDIF
606 #endif /* NO_BIT_DEFINES */
607
608 // ----- PMCON1 bits --------------------
609 typedef union {
610   struct {
611     unsigned char RD:1;
612     unsigned char :1;
613     unsigned char :1;
614     unsigned char :1;
615     unsigned char :1;
616     unsigned char :1;
617     unsigned char :1;
618     unsigned char :1;
619   };
620 } __PMCON1_bits_t;
621 extern volatile __PMCON1_bits_t __at(PMCON1_ADDR) PMCON1_bits;
622
623 #ifndef NO_BIT_DEFINES
624 #define RD                   PMCON1_bits.RD
625 #endif /* NO_BIT_DEFINES */
626
627 // ----- PORTA bits --------------------
628 typedef union {
629   struct {
630     unsigned char RA0:1;
631     unsigned char RA1:1;
632     unsigned char RA2:1;
633     unsigned char RA3:1;
634     unsigned char RA4:1;
635     unsigned char RA5:1;
636     unsigned char :1;
637     unsigned char :1;
638   };
639 } __PORTA_bits_t;
640 extern volatile __PORTA_bits_t __at(PORTA_ADDR) PORTA_bits;
641
642 #ifndef NO_BIT_DEFINES
643 #define RA0                  PORTA_bits.RA0
644 #define RA1                  PORTA_bits.RA1
645 #define RA2                  PORTA_bits.RA2
646 #define RA3                  PORTA_bits.RA3
647 #define RA4                  PORTA_bits.RA4
648 #define RA5                  PORTA_bits.RA5
649 #endif /* NO_BIT_DEFINES */
650
651 // ----- PORTB bits --------------------
652 typedef union {
653   struct {
654     unsigned char RB0:1;
655     unsigned char RB1:1;
656     unsigned char RB2:1;
657     unsigned char RB3:1;
658     unsigned char RB4:1;
659     unsigned char RB5:1;
660     unsigned char RB6:1;
661     unsigned char RB7:1;
662   };
663 } __PORTB_bits_t;
664 extern volatile __PORTB_bits_t __at(PORTB_ADDR) PORTB_bits;
665
666 #ifndef NO_BIT_DEFINES
667 #define RB0                  PORTB_bits.RB0
668 #define RB1                  PORTB_bits.RB1
669 #define RB2                  PORTB_bits.RB2
670 #define RB3                  PORTB_bits.RB3
671 #define RB4                  PORTB_bits.RB4
672 #define RB5                  PORTB_bits.RB5
673 #define RB6                  PORTB_bits.RB6
674 #define RB7                  PORTB_bits.RB7
675 #endif /* NO_BIT_DEFINES */
676
677 // ----- PORTC bits --------------------
678 typedef union {
679   struct {
680     unsigned char RC0:1;
681     unsigned char RC1:1;
682     unsigned char RC2:1;
683     unsigned char RC3:1;
684     unsigned char RC4:1;
685     unsigned char RC5:1;
686     unsigned char RC6:1;
687     unsigned char RC7:1;
688   };
689 } __PORTC_bits_t;
690 extern volatile __PORTC_bits_t __at(PORTC_ADDR) PORTC_bits;
691
692 #ifndef NO_BIT_DEFINES
693 #define RC0                  PORTC_bits.RC0
694 #define RC1                  PORTC_bits.RC1
695 #define RC2                  PORTC_bits.RC2
696 #define RC3                  PORTC_bits.RC3
697 #define RC4                  PORTC_bits.RC4
698 #define RC5                  PORTC_bits.RC5
699 #define RC6                  PORTC_bits.RC6
700 #define RC7                  PORTC_bits.RC7
701 #endif /* NO_BIT_DEFINES */
702
703 // ----- PORTD bits --------------------
704 typedef union {
705   struct {
706     unsigned char RD0:1;
707     unsigned char RD1:1;
708     unsigned char RD2:1;
709     unsigned char RD3:1;
710     unsigned char RD4:1;
711     unsigned char RD5:1;
712     unsigned char RD6:1;
713     unsigned char RD7:1;
714   };
715 } __PORTD_bits_t;
716 extern volatile __PORTD_bits_t __at(PORTD_ADDR) PORTD_bits;
717
718 #ifndef NO_BIT_DEFINES
719 #define RD0                  PORTD_bits.RD0
720 #define RD1                  PORTD_bits.RD1
721 #define RD2                  PORTD_bits.RD2
722 #define RD3                  PORTD_bits.RD3
723 #define RD4                  PORTD_bits.RD4
724 #define RD5                  PORTD_bits.RD5
725 #define RD6                  PORTD_bits.RD6
726 #define RD7                  PORTD_bits.RD7
727 #endif /* NO_BIT_DEFINES */
728
729 // ----- PORTE bits --------------------
730 typedef union {
731   struct {
732     unsigned char RE0:1;
733     unsigned char RE1:1;
734     unsigned char RE2:1;
735     unsigned char :1;
736     unsigned char :1;
737     unsigned char :1;
738     unsigned char :1;
739     unsigned char :1;
740   };
741 } __PORTE_bits_t;
742 extern volatile __PORTE_bits_t __at(PORTE_ADDR) PORTE_bits;
743
744 #ifndef NO_BIT_DEFINES
745 #define RE0                  PORTE_bits.RE0
746 #define RE1                  PORTE_bits.RE1
747 #define RE2                  PORTE_bits.RE2
748 #endif /* NO_BIT_DEFINES */
749
750 // ----- SSPCON bits --------------------
751 typedef union {
752   struct {
753     unsigned char SSPM0:1;
754     unsigned char SSPM1:1;
755     unsigned char SSPM2:1;
756     unsigned char SSPM3:1;
757     unsigned char CKP:1;
758     unsigned char SSPEN:1;
759     unsigned char SSPOV:1;
760     unsigned char WCOL:1;
761   };
762 } __SSPCON_bits_t;
763 extern volatile __SSPCON_bits_t __at(SSPCON_ADDR) SSPCON_bits;
764
765 #ifndef NO_BIT_DEFINES
766 #define SSPM0                SSPCON_bits.SSPM0
767 #define SSPM1                SSPCON_bits.SSPM1
768 #define SSPM2                SSPCON_bits.SSPM2
769 #define SSPM3                SSPCON_bits.SSPM3
770 #define CKP                  SSPCON_bits.CKP
771 #define SSPEN                SSPCON_bits.SSPEN
772 #define SSPOV                SSPCON_bits.SSPOV
773 #define WCOL                 SSPCON_bits.WCOL
774 #endif /* NO_BIT_DEFINES */
775
776 // ----- SSPSTAT bits --------------------
777 typedef union {
778   struct {
779     unsigned char BF:1;
780     unsigned char UA:1;
781     unsigned char R:1;
782     unsigned char S:1;
783     unsigned char P:1;
784     unsigned char D:1;
785     unsigned char CKE:1;
786     unsigned char SMP:1;
787   };
788   struct {
789     unsigned char :1;
790     unsigned char :1;
791     unsigned char I2C_READ:1;
792     unsigned char I2C_START:1;
793     unsigned char I2C_STOP:1;
794     unsigned char I2C_DATA:1;
795     unsigned char :1;
796     unsigned char :1;
797   };
798   struct {
799     unsigned char :1;
800     unsigned char :1;
801     unsigned char NOT_W:1;
802     unsigned char :1;
803     unsigned char :1;
804     unsigned char NOT_A:1;
805     unsigned char :1;
806     unsigned char :1;
807   };
808   struct {
809     unsigned char :1;
810     unsigned char :1;
811     unsigned char NOT_WRITE:1;
812     unsigned char :1;
813     unsigned char :1;
814     unsigned char NOT_ADDRESS:1;
815     unsigned char :1;
816     unsigned char :1;
817   };
818   struct {
819     unsigned char :1;
820     unsigned char :1;
821     unsigned char R_W:1;
822     unsigned char :1;
823     unsigned char :1;
824     unsigned char D_A:1;
825     unsigned char :1;
826     unsigned char :1;
827   };
828   struct {
829     unsigned char :1;
830     unsigned char :1;
831     unsigned char READ_WRITE:1;
832     unsigned char :1;
833     unsigned char :1;
834     unsigned char DATA_ADDRESS:1;
835     unsigned char :1;
836     unsigned char :1;
837   };
838 } __SSPSTAT_bits_t;
839 extern volatile __SSPSTAT_bits_t __at(SSPSTAT_ADDR) SSPSTAT_bits;
840
841 #ifndef NO_BIT_DEFINES
842 #define BF                   SSPSTAT_bits.BF
843 #define UA                   SSPSTAT_bits.UA
844 #define R                    SSPSTAT_bits.R
845 #define I2C_READ             SSPSTAT_bits.I2C_READ
846 #define NOT_W                SSPSTAT_bits.NOT_W
847 #define NOT_WRITE            SSPSTAT_bits.NOT_WRITE
848 #define R_W                  SSPSTAT_bits.R_W
849 #define READ_WRITE           SSPSTAT_bits.READ_WRITE
850 #define S                    SSPSTAT_bits.S
851 #define I2C_START            SSPSTAT_bits.I2C_START
852 #define P                    SSPSTAT_bits.P
853 #define I2C_STOP             SSPSTAT_bits.I2C_STOP
854 #define D                    SSPSTAT_bits.D
855 #define I2C_DATA             SSPSTAT_bits.I2C_DATA
856 #define NOT_A                SSPSTAT_bits.NOT_A
857 #define NOT_ADDRESS          SSPSTAT_bits.NOT_ADDRESS
858 #define D_A                  SSPSTAT_bits.D_A
859 #define DATA_ADDRESS         SSPSTAT_bits.DATA_ADDRESS
860 #define CKE                  SSPSTAT_bits.CKE
861 #define SMP                  SSPSTAT_bits.SMP
862 #endif /* NO_BIT_DEFINES */
863
864 // ----- STATUS bits --------------------
865 typedef union {
866   struct {
867     unsigned char C:1;
868     unsigned char DC:1;
869     unsigned char Z:1;
870     unsigned char NOT_PD:1;
871     unsigned char NOT_TO:1;
872     unsigned char RP0:1;
873     unsigned char RP1:1;
874     unsigned char IRP:1;
875   };
876 } __STATUS_bits_t;
877 extern volatile __STATUS_bits_t __at(STATUS_ADDR) STATUS_bits;
878
879 #ifndef NO_BIT_DEFINES
880 #define C                    STATUS_bits.C
881 #define DC                   STATUS_bits.DC
882 #define Z                    STATUS_bits.Z
883 #define NOT_PD               STATUS_bits.NOT_PD
884 #define NOT_TO               STATUS_bits.NOT_TO
885 #define RP0                  STATUS_bits.RP0
886 #define RP1                  STATUS_bits.RP1
887 #define IRP                  STATUS_bits.IRP
888 #endif /* NO_BIT_DEFINES */
889
890 // ----- T1CON bits --------------------
891 typedef union {
892   struct {
893     unsigned char TMR1ON:1;
894     unsigned char TMR1CS:1;
895     unsigned char NOT_T1SYNC:1;
896     unsigned char T1OSCEN:1;
897     unsigned char T1CKPS0:1;
898     unsigned char T1CKPS1:1;
899     unsigned char :1;
900     unsigned char :1;
901   };
902   struct {
903     unsigned char :1;
904     unsigned char :1;
905     unsigned char T1INSYNC:1;
906     unsigned char :1;
907     unsigned char :1;
908     unsigned char :1;
909     unsigned char :1;
910     unsigned char :1;
911   };
912 } __T1CON_bits_t;
913 extern volatile __T1CON_bits_t __at(T1CON_ADDR) T1CON_bits;
914
915 #ifndef NO_BIT_DEFINES
916 #define TMR1ON               T1CON_bits.TMR1ON
917 #define TMR1CS               T1CON_bits.TMR1CS
918 #define NOT_T1SYNC           T1CON_bits.NOT_T1SYNC
919 #define T1INSYNC             T1CON_bits.T1INSYNC
920 #define T1OSCEN              T1CON_bits.T1OSCEN
921 #define T1CKPS0              T1CON_bits.T1CKPS0
922 #define T1CKPS1              T1CON_bits.T1CKPS1
923 #endif /* NO_BIT_DEFINES */
924
925 // ----- T2CON bits --------------------
926 typedef union {
927   struct {
928     unsigned char T2CKPS0:1;
929     unsigned char T2CKPS1:1;
930     unsigned char TMR2ON:1;
931     unsigned char TOUTPS0:1;
932     unsigned char TOUTPS1:1;
933     unsigned char TOUTPS2:1;
934     unsigned char TOUTPS3:1;
935     unsigned char :1;
936   };
937 } __T2CON_bits_t;
938 extern volatile __T2CON_bits_t __at(T2CON_ADDR) T2CON_bits;
939
940 #ifndef NO_BIT_DEFINES
941 #define T2CKPS0              T2CON_bits.T2CKPS0
942 #define T2CKPS1              T2CON_bits.T2CKPS1
943 #define TMR2ON               T2CON_bits.TMR2ON
944 #define TOUTPS0              T2CON_bits.TOUTPS0
945 #define TOUTPS1              T2CON_bits.TOUTPS1
946 #define TOUTPS2              T2CON_bits.TOUTPS2
947 #define TOUTPS3              T2CON_bits.TOUTPS3
948 #endif /* NO_BIT_DEFINES */
949
950 // ----- TRISA bits --------------------
951 typedef union {
952   struct {
953     unsigned char TRISA0:1;
954     unsigned char TRISA1:1;
955     unsigned char TRISA2:1;
956     unsigned char TRISA3:1;
957     unsigned char TRISA4:1;
958     unsigned char TRISA5:1;
959     unsigned char :1;
960     unsigned char :1;
961   };
962 } __TRISA_bits_t;
963 extern volatile __TRISA_bits_t __at(TRISA_ADDR) TRISA_bits;
964
965 #ifndef NO_BIT_DEFINES
966 #define TRISA0               TRISA_bits.TRISA0
967 #define TRISA1               TRISA_bits.TRISA1
968 #define TRISA2               TRISA_bits.TRISA2
969 #define TRISA3               TRISA_bits.TRISA3
970 #define TRISA4               TRISA_bits.TRISA4
971 #define TRISA5               TRISA_bits.TRISA5
972 #endif /* NO_BIT_DEFINES */
973
974 // ----- TRISB bits --------------------
975 typedef union {
976   struct {
977     unsigned char TRISB0:1;
978     unsigned char TRISB1:1;
979     unsigned char TRISB2:1;
980     unsigned char TRISB3:1;
981     unsigned char TRISB4:1;
982     unsigned char TRISB5:1;
983     unsigned char TRISB6:1;
984     unsigned char TRISB7:1;
985   };
986 } __TRISB_bits_t;
987 extern volatile __TRISB_bits_t __at(TRISB_ADDR) TRISB_bits;
988
989 #ifndef NO_BIT_DEFINES
990 #define TRISB0               TRISB_bits.TRISB0
991 #define TRISB1               TRISB_bits.TRISB1
992 #define TRISB2               TRISB_bits.TRISB2
993 #define TRISB3               TRISB_bits.TRISB3
994 #define TRISB4               TRISB_bits.TRISB4
995 #define TRISB5               TRISB_bits.TRISB5
996 #define TRISB6               TRISB_bits.TRISB6
997 #define TRISB7               TRISB_bits.TRISB7
998 #endif /* NO_BIT_DEFINES */
999
1000 // ----- TRISC bits --------------------
1001 typedef union {
1002   struct {
1003     unsigned char TRISC0:1;
1004     unsigned char TRISC1:1;
1005     unsigned char TRISC2:1;
1006     unsigned char TRISC3:1;
1007     unsigned char TRISC4:1;
1008     unsigned char TRISC5:1;
1009     unsigned char TRISC6:1;
1010     unsigned char TRISC7:1;
1011   };
1012 } __TRISC_bits_t;
1013 extern volatile __TRISC_bits_t __at(TRISC_ADDR) TRISC_bits;
1014
1015 #ifndef NO_BIT_DEFINES
1016 #define TRISC0               TRISC_bits.TRISC0
1017 #define TRISC1               TRISC_bits.TRISC1
1018 #define TRISC2               TRISC_bits.TRISC2
1019 #define TRISC3               TRISC_bits.TRISC3
1020 #define TRISC4               TRISC_bits.TRISC4
1021 #define TRISC5               TRISC_bits.TRISC5
1022 #define TRISC6               TRISC_bits.TRISC6
1023 #define TRISC7               TRISC_bits.TRISC7
1024 #endif /* NO_BIT_DEFINES */
1025
1026 // ----- TRISD bits --------------------
1027 typedef union {
1028   struct {
1029     unsigned char TRISD0:1;
1030     unsigned char TRISD1:1;
1031     unsigned char TRISD2:1;
1032     unsigned char TRISD3:1;
1033     unsigned char TRISD4:1;
1034     unsigned char TRISD5:1;
1035     unsigned char TRISD6:1;
1036     unsigned char TRISD7:1;
1037   };
1038 } __TRISD_bits_t;
1039 extern volatile __TRISD_bits_t __at(TRISD_ADDR) TRISD_bits;
1040
1041 #ifndef NO_BIT_DEFINES
1042 #define TRISD0               TRISD_bits.TRISD0
1043 #define TRISD1               TRISD_bits.TRISD1
1044 #define TRISD2               TRISD_bits.TRISD2
1045 #define TRISD3               TRISD_bits.TRISD3
1046 #define TRISD4               TRISD_bits.TRISD4
1047 #define TRISD5               TRISD_bits.TRISD5
1048 #define TRISD6               TRISD_bits.TRISD6
1049 #define TRISD7               TRISD_bits.TRISD7
1050 #endif /* NO_BIT_DEFINES */
1051
1052 // ----- TRISE bits --------------------
1053 typedef union {
1054   struct {
1055     unsigned char TRISE0:1;
1056     unsigned char TRISE1:1;
1057     unsigned char TRISE2:1;
1058     unsigned char :1;
1059     unsigned char PSPMODE:1;
1060     unsigned char IBOV:1;
1061     unsigned char OBF:1;
1062     unsigned char IBF:1;
1063   };
1064 } __TRISE_bits_t;
1065 extern volatile __TRISE_bits_t __at(TRISE_ADDR) TRISE_bits;
1066
1067 #ifndef NO_BIT_DEFINES
1068 #define TRISE0               TRISE_bits.TRISE0
1069 #define TRISE1               TRISE_bits.TRISE1
1070 #define TRISE2               TRISE_bits.TRISE2
1071 #define PSPMODE              TRISE_bits.PSPMODE
1072 #define IBOV                 TRISE_bits.IBOV
1073 #define OBF                  TRISE_bits.OBF
1074 #define IBF                  TRISE_bits.IBF
1075 #endif /* NO_BIT_DEFINES */
1076
1077 #endif