a4ba728db8a72c8f8c8d5e1350b3e65b4fa67218
[fw/sdcc] / device / include / pic / pic16c432.h
1 //
2 // Register Declarations for Microchip 16C432 Processor
3 //
4 //
5 // This header file was automatically generated by:
6 //
7 //      inc2h.pl V4585
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 P16C432_H
23 #define P16C432_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 PCLATH_ADDR     0x000A
36 #define INTCON_ADDR     0x000B
37 #define PIR1_ADDR       0x000C
38 #define CMCON_ADDR      0x001F
39 #define OPTION_REG_ADDR 0x0081
40 #define TRISA_ADDR      0x0085
41 #define TRISB_ADDR      0x0086
42 #define PIE1_ADDR       0x008C
43 #define PCON_ADDR       0x008E
44 #define LINPRT_ADDR     0x0090
45 #define VRCON_ADDR      0x009F
46
47 //
48 // Memory organization.
49 //
50
51
52
53 //         LIST
54 // P16C432.INC  Standard Header File, Version 1.00    Microchip Technology, Inc.
55 //         NOLIST
56
57 // This header file defines configurations, registers, and other useful bits of
58 // information for the PIC16C432 microcontroller.  These names are taken to match 
59 // the data sheets as closely as possible.  
60
61 // Note that the processor must be selected before this file is 
62 // included.  The processor may be selected the following ways:
63
64 //       1. Command line switch:
65 //               C:\ MPASM MYFILE.ASM /PIC16C432
66 //       2. LIST directive in the source file
67 //               LIST   P=PIC16C432
68 //       3. Processor Type entry in the MPASM full-screen interface
69
70 //==========================================================================
71 //
72 //       Revision History
73 //
74 //==========================================================================
75
76 //Rev:   Date:        Reason:
77
78 //1.00   31 Aug 2000  Initial Release
79 //1.10  28 Mar 2001  Corrected definition of LINTX
80
81 //==========================================================================
82 //
83 //       Verify Processor
84 //
85 //==========================================================================
86
87 //        IFNDEF __16C432
88 //            MESSG "Processor-header file mismatch.  Verify selected processor."
89 //         ENDIF
90
91 //==========================================================================
92 //
93 //       Register Definitions
94 //
95 //==========================================================================
96
97 #define W                    0x0000
98 #define F                    0x0001
99
100 //----- Register Files------------------------------------------------------
101
102 extern __sfr  __at (INDF_ADDR)                    INDF;
103 extern __sfr  __at (TMR0_ADDR)                    TMR0;
104 extern __sfr  __at (PCL_ADDR)                     PCL;
105 extern __sfr  __at (STATUS_ADDR)                  STATUS;
106 extern __sfr  __at (FSR_ADDR)                     FSR;
107 extern __sfr  __at (PORTA_ADDR)                   PORTA;
108 extern __sfr  __at (PORTB_ADDR)                   PORTB;
109 extern __sfr  __at (PCLATH_ADDR)                  PCLATH;
110 extern __sfr  __at (INTCON_ADDR)                  INTCON;
111 extern __sfr  __at (PIR1_ADDR)                    PIR1;
112 extern __sfr  __at (CMCON_ADDR)                   CMCON;
113
114 extern __sfr  __at (OPTION_REG_ADDR)              OPTION_REG;
115 extern __sfr  __at (TRISA_ADDR)                   TRISA;
116 extern __sfr  __at (TRISB_ADDR)                   TRISB;
117 extern __sfr  __at (PIE1_ADDR)                    PIE1;
118 extern __sfr  __at (PCON_ADDR)                    PCON;
119 extern __sfr  __at (LINPRT_ADDR)                  LINPRT;
120 extern __sfr  __at (VRCON_ADDR)                   VRCON;
121
122 //----- STATUS Bits --------------------------------------------------------
123
124
125 //----- INTCON Bits --------------------------------------------------------
126
127
128 //----- PORTA Bits --------------------------------------------------------
129
130 //----- PIR1 Bits ----------------------------------------------------------
131
132
133 //----- CMCON Bits ---------------------------------------------------------
134
135
136 //----- OPTION Bits --------------------------------------------------------
137
138
139 //----- PIE1 Bits ----------------------------------------------------------
140
141
142 //----- PCON Bits ----------------------------------------------------------
143
144
145 //----- VRCON Bits ---------------------------------------------------------
146
147
148 //----- LINPRT Bits ----------------------------------------------------------
149
150
151 //==========================================================================
152 //
153 //       RAM Definition
154 //
155 //==========================================================================
156
157 //         __MAXRAM H'0FF'
158 //         __BADRAM H'07'-H'09', H'0D'-H'1E'
159 //         __BADRAM H'87'-H'89', H'8D', H'8F', H'91'-H'9E'
160 //         __BADRAM H'C0'-H'EF'
161
162 //==========================================================================
163 //
164 //       Configuration Bits
165 //
166 //==========================================================================
167
168 #define _BODEN_ON            0x3FFF
169 #define _BODEN_OFF           0x3FBF
170 #define _CP_ALL              0x00CF
171 #define _CP_75               0x15DF
172 #define _CP_50               0x2AEF
173 #define _CP_OFF              0x3FFF
174 #define _PWRTE_OFF           0x3FFF
175 #define _PWRTE_ON            0x3FF7
176 #define _WDT_ON              0x3FFF
177 #define _WDT_OFF             0x3FFB
178 #define _LP_OSC              0x3FFC
179 #define _XT_OSC              0x3FFD
180 #define _HS_OSC              0x3FFE
181 #define _RC_OSC              0x3FFF
182
183 //         LIST
184
185 // ----- CMCON bits --------------------
186 typedef union {
187   struct {
188     unsigned char CM0:1;
189     unsigned char CM1:1;
190     unsigned char CM2:1;
191     unsigned char CIS:1;
192     unsigned char :1;
193     unsigned char :1;
194     unsigned char C1OUT:1;
195     unsigned char C2OUT:1;
196   };
197 } __CMCON_bits_t;
198 extern volatile __CMCON_bits_t __at(CMCON_ADDR) CMCON_bits;
199
200 #define CM0                  CMCON_bits.CM0
201 #define CM1                  CMCON_bits.CM1
202 #define CM2                  CMCON_bits.CM2
203 #define CIS                  CMCON_bits.CIS
204 #define C1OUT                CMCON_bits.C1OUT
205 #define C2OUT                CMCON_bits.C2OUT
206
207 // ----- INTCON bits --------------------
208 typedef union {
209   struct {
210     unsigned char RBIF:1;
211     unsigned char INTF:1;
212     unsigned char T0IF:1;
213     unsigned char RBIE:1;
214     unsigned char INTE:1;
215     unsigned char T0IE:1;
216     unsigned char PEIE:1;
217     unsigned char GIE:1;
218   };
219 } __INTCON_bits_t;
220 extern volatile __INTCON_bits_t __at(INTCON_ADDR) INTCON_bits;
221
222 #define RBIF                 INTCON_bits.RBIF
223 #define INTF                 INTCON_bits.INTF
224 #define T0IF                 INTCON_bits.T0IF
225 #define RBIE                 INTCON_bits.RBIE
226 #define INTE                 INTCON_bits.INTE
227 #define T0IE                 INTCON_bits.T0IE
228 #define PEIE                 INTCON_bits.PEIE
229 #define GIE                  INTCON_bits.GIE
230
231 // ----- LINPRT bits --------------------
232 typedef union {
233   struct {
234     unsigned char LINVDD:1;
235     unsigned char :1;
236     unsigned char LINTX:1;
237     unsigned char :1;
238     unsigned char :1;
239     unsigned char :1;
240     unsigned char :1;
241     unsigned char :1;
242   };
243 } __LINPRT_bits_t;
244 extern volatile __LINPRT_bits_t __at(LINPRT_ADDR) LINPRT_bits;
245
246 #define LINVDD               LINPRT_bits.LINVDD
247 #define LINTX                LINPRT_bits.LINTX
248
249 // ----- OPTION_REG bits --------------------
250 typedef union {
251   struct {
252     unsigned char PS0:1;
253     unsigned char PS1:1;
254     unsigned char PS2:1;
255     unsigned char PSA:1;
256     unsigned char T0SE:1;
257     unsigned char T0CS:1;
258     unsigned char INTEDG:1;
259     unsigned char NOT_RBPU:1;
260   };
261 } __OPTION_REG_bits_t;
262 extern volatile __OPTION_REG_bits_t __at(OPTION_REG_ADDR) OPTION_REG_bits;
263
264 #define PS0                  OPTION_REG_bits.PS0
265 #define PS1                  OPTION_REG_bits.PS1
266 #define PS2                  OPTION_REG_bits.PS2
267 #define PSA                  OPTION_REG_bits.PSA
268 #define T0SE                 OPTION_REG_bits.T0SE
269 #define T0CS                 OPTION_REG_bits.T0CS
270 #define INTEDG               OPTION_REG_bits.INTEDG
271 #define NOT_RBPU             OPTION_REG_bits.NOT_RBPU
272
273 // ----- PCON bits --------------------
274 typedef union {
275   struct {
276     unsigned char NOT_BO:1;
277     unsigned char NOT_POR:1;
278     unsigned char :1;
279     unsigned char :1;
280     unsigned char :1;
281     unsigned char :1;
282     unsigned char :1;
283     unsigned char :1;
284   };
285   struct {
286     unsigned char NOT_BOR:1;
287     unsigned char :1;
288     unsigned char :1;
289     unsigned char :1;
290     unsigned char :1;
291     unsigned char :1;
292     unsigned char :1;
293     unsigned char :1;
294   };
295 } __PCON_bits_t;
296 extern volatile __PCON_bits_t __at(PCON_ADDR) PCON_bits;
297
298 #define NOT_BO               PCON_bits.NOT_BO
299 #define NOT_BOR              PCON_bits.NOT_BOR
300 #define NOT_POR              PCON_bits.NOT_POR
301
302 // ----- PIE1 bits --------------------
303 typedef union {
304   struct {
305     unsigned char :1;
306     unsigned char :1;
307     unsigned char :1;
308     unsigned char :1;
309     unsigned char :1;
310     unsigned char :1;
311     unsigned char CMIE:1;
312     unsigned char :1;
313   };
314 } __PIE1_bits_t;
315 extern volatile __PIE1_bits_t __at(PIE1_ADDR) PIE1_bits;
316
317 #define CMIE                 PIE1_bits.CMIE
318
319 // ----- PIR1 bits --------------------
320 typedef union {
321   struct {
322     unsigned char :1;
323     unsigned char :1;
324     unsigned char :1;
325     unsigned char :1;
326     unsigned char :1;
327     unsigned char :1;
328     unsigned char CMIF:1;
329     unsigned char :1;
330   };
331 } __PIR1_bits_t;
332 extern volatile __PIR1_bits_t __at(PIR1_ADDR) PIR1_bits;
333
334 #define CMIF                 PIR1_bits.CMIF
335
336 // ----- PORTA bits --------------------
337 typedef union {
338   struct {
339     unsigned char :1;
340     unsigned char LINRX:1;
341     unsigned char :1;
342     unsigned char :1;
343     unsigned char :1;
344     unsigned char :1;
345     unsigned char :1;
346     unsigned char :1;
347   };
348 } __PORTA_bits_t;
349 extern volatile __PORTA_bits_t __at(PORTA_ADDR) PORTA_bits;
350
351 #define LINRX                PORTA_bits.LINRX
352
353 // ----- PORTB bits --------------------
354 typedef union {
355   struct {
356     unsigned char RB0:1;
357     unsigned char RB1:1;
358     unsigned char RB2:1;
359     unsigned char RB3:1;
360     unsigned char RB4:1;
361     unsigned char RB5:1;
362     unsigned char RB6:1;
363     unsigned char RB7:1;
364   };
365 } __PORTB_bits_t;
366 extern volatile __PORTB_bits_t __at(PORTB_ADDR) PORTB_bits;
367
368 #define RB0                  PORTB_bits.RB0
369 #define RB1                  PORTB_bits.RB1
370 #define RB2                  PORTB_bits.RB2
371 #define RB3                  PORTB_bits.RB3
372 #define RB4                  PORTB_bits.RB4
373 #define RB5                  PORTB_bits.RB5
374 #define RB6                  PORTB_bits.RB6
375 #define RB7                  PORTB_bits.RB7
376
377 // ----- STATUS bits --------------------
378 typedef union {
379   struct {
380     unsigned char C:1;
381     unsigned char DC:1;
382     unsigned char Z:1;
383     unsigned char NOT_PD:1;
384     unsigned char NOT_TO:1;
385     unsigned char RP0:1;
386     unsigned char RP1:1;
387     unsigned char IRP:1;
388   };
389 } __STATUS_bits_t;
390 extern volatile __STATUS_bits_t __at(STATUS_ADDR) STATUS_bits;
391
392 #define C                    STATUS_bits.C
393 #define DC                   STATUS_bits.DC
394 #define Z                    STATUS_bits.Z
395 #define NOT_PD               STATUS_bits.NOT_PD
396 #define NOT_TO               STATUS_bits.NOT_TO
397 #define RP0                  STATUS_bits.RP0
398 #define RP1                  STATUS_bits.RP1
399 #define IRP                  STATUS_bits.IRP
400
401 // ----- TRISB bits --------------------
402 typedef union {
403   struct {
404     unsigned char TRISB0:1;
405     unsigned char TRISB1:1;
406     unsigned char TRISB2:1;
407     unsigned char TRISB3:1;
408     unsigned char TRISB4:1;
409     unsigned char TRISB5:1;
410     unsigned char TRISB6:1;
411     unsigned char TRISB7:1;
412   };
413 } __TRISB_bits_t;
414 extern volatile __TRISB_bits_t __at(TRISB_ADDR) TRISB_bits;
415
416 #define TRISB0               TRISB_bits.TRISB0
417 #define TRISB1               TRISB_bits.TRISB1
418 #define TRISB2               TRISB_bits.TRISB2
419 #define TRISB3               TRISB_bits.TRISB3
420 #define TRISB4               TRISB_bits.TRISB4
421 #define TRISB5               TRISB_bits.TRISB5
422 #define TRISB6               TRISB_bits.TRISB6
423 #define TRISB7               TRISB_bits.TRISB7
424
425 // ----- VRCON bits --------------------
426 typedef union {
427   struct {
428     unsigned char VR0:1;
429     unsigned char VR1:1;
430     unsigned char VR2:1;
431     unsigned char VR3:1;
432     unsigned char :1;
433     unsigned char VRR:1;
434     unsigned char VROE:1;
435     unsigned char VREN:1;
436   };
437 } __VRCON_bits_t;
438 extern volatile __VRCON_bits_t __at(VRCON_ADDR) VRCON_bits;
439
440 #define VR0                  VRCON_bits.VR0
441 #define VR1                  VRCON_bits.VR1
442 #define VR2                  VRCON_bits.VR2
443 #define VR3                  VRCON_bits.VR3
444 #define VRR                  VRCON_bits.VRR
445 #define VROE                 VRCON_bits.VROE
446 #define VREN                 VRCON_bits.VREN
447
448 #endif