* src/pic/device.h: removed AssignedMemory structure and macros
[fw/sdcc] / device / include / pic / pic16c554.h
1 //
2 // Register Declarations for Microchip 16C554 Processor
3 //
4 //
5 // This header file was automatically generated by:
6 //
7 //      inc2h.pl V1.6
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 P16C554_H
23 #define P16C554_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 OPTION_REG_ADDR 0x0081
38 #define TRISA_ADDR      0x0085
39 #define TRISB_ADDR      0x0086
40 #define PCON_ADDR       0x008E
41
42 //
43 // Memory organization.
44 //
45
46
47
48 //         LIST
49 // P16C554.INC  Standard Header File, Version 1.00    Microchip Technology, Inc.
50 //         NOLIST
51
52 // This header file defines configurations, registers, and other useful bits of
53 // information for the PIC16C554 microcontroller.  These names are taken to match 
54 // the data sheets as closely as possible.  
55
56 // Note that the processor must be selected before this file is 
57 // included.  The processor may be selected the following ways:
58
59 //       1. Command line switch:
60 //               C:\ MPASM MYFILE.ASM /PIC16C554
61 //       2. LIST directive in the source file
62 //               LIST   P=PIC16C554
63 //       3. Processor Type entry in the MPASM full-screen interface
64
65 //==========================================================================
66 //
67 //       Revision History
68 //
69 //==========================================================================
70
71 //Rev:   Date:    Reason:
72
73 //1.00   04/22/96 Initial Creation
74
75 //==========================================================================
76 //
77 //       Verify Processor
78 //
79 //==========================================================================
80
81 //        IFNDEF __16C554
82 //            MESSG "Processor-header file mismatch.  Verify selected processor."
83 //         ENDIF
84
85 //==========================================================================
86 //
87 //       Register Definitions
88 //
89 //==========================================================================
90
91 #define W                    0x0000
92 #define F                    0x0001
93
94 //----- Register Files------------------------------------------------------
95
96 extern __data __at (INDF_ADDR) volatile char      INDF;
97 extern __sfr  __at (TMR0_ADDR)                    TMR0;
98 extern __data __at (PCL_ADDR) volatile char       PCL;
99 extern __sfr  __at (STATUS_ADDR)                  STATUS;
100 extern __sfr  __at (FSR_ADDR)                     FSR;
101 extern __sfr  __at (PORTA_ADDR)                   PORTA;
102 extern __sfr  __at (PORTB_ADDR)                   PORTB;
103 extern __sfr  __at (PCLATH_ADDR)                  PCLATH;
104 extern __sfr  __at (INTCON_ADDR)                  INTCON;
105
106 extern __sfr  __at (OPTION_REG_ADDR)              OPTION_REG;
107 extern __sfr  __at (TRISA_ADDR)                   TRISA;
108 extern __sfr  __at (TRISB_ADDR)                   TRISB;
109 extern __sfr  __at (PCON_ADDR)                    PCON;
110
111 //----- STATUS Bits --------------------------------------------------------
112
113
114 //----- INTCON Bits --------------------------------------------------------
115
116
117 //----- OPTION Bits --------------------------------------------------------
118
119
120 //----- PCON Bits ----------------------------------------------------------
121
122
123 //==========================================================================
124 //
125 //       RAM Definition
126 //
127 //==========================================================================
128
129 //         __MAXRAM H'09F'
130 //         __BADRAM H'07'-H'09', H'0C'-H'1F', H'70'-H'7F'
131 //         __BADRAM H'87'-H'89', H'8C'-H'8D', H'8F'-H'9F'
132
133 //==========================================================================
134 //
135 //       Configuration Bits
136 //
137 //==========================================================================
138
139 #define _CP_ON               0x00CF
140 #define _CP_OFF              0x3FFF
141 #define _PWRTE_OFF           0x3FFF
142 #define _PWRTE_ON            0x3FF7
143 #define _WDT_ON              0x3FFF
144 #define _WDT_OFF             0x3FFB
145 #define _LP_OSC              0x3FFC
146 #define _XT_OSC              0x3FFD
147 #define _HS_OSC              0x3FFE
148 #define _RC_OSC              0x3FFF
149
150 //         LIST
151
152 // ----- INTCON bits --------------------
153 typedef union {
154   struct {
155     unsigned char RBIF:1;
156     unsigned char INTF:1;
157     unsigned char T0IF:1;
158     unsigned char RBIE:1;
159     unsigned char INTE:1;
160     unsigned char T0IE:1;
161     unsigned char :1;
162     unsigned char GIE:1;
163   };
164 } __INTCON_bits_t;
165 extern volatile __INTCON_bits_t __at(INTCON_ADDR) INTCON_bits;
166
167 #define RBIF                 INTCON_bits.RBIF
168 #define INTF                 INTCON_bits.INTF
169 #define T0IF                 INTCON_bits.T0IF
170 #define RBIE                 INTCON_bits.RBIE
171 #define INTE                 INTCON_bits.INTE
172 #define T0IE                 INTCON_bits.T0IE
173 #define GIE                  INTCON_bits.GIE
174
175 // ----- OPTION_REG bits --------------------
176 typedef union {
177   struct {
178     unsigned char PS0:1;
179     unsigned char PS1:1;
180     unsigned char PS2:1;
181     unsigned char PSA:1;
182     unsigned char T0SE:1;
183     unsigned char T0CS:1;
184     unsigned char INTEDG:1;
185     unsigned char NOT_RBPU:1;
186   };
187 } __OPTION_REG_bits_t;
188 extern volatile __OPTION_REG_bits_t __at(OPTION_REG_ADDR) OPTION_REG_bits;
189
190 #define PS0                  OPTION_REG_bits.PS0
191 #define PS1                  OPTION_REG_bits.PS1
192 #define PS2                  OPTION_REG_bits.PS2
193 #define PSA                  OPTION_REG_bits.PSA
194 #define T0SE                 OPTION_REG_bits.T0SE
195 #define T0CS                 OPTION_REG_bits.T0CS
196 #define INTEDG               OPTION_REG_bits.INTEDG
197 #define NOT_RBPU             OPTION_REG_bits.NOT_RBPU
198
199 // ----- PCON bits --------------------
200 typedef union {
201   struct {
202     unsigned char :1;
203     unsigned char NOT_POR:1;
204     unsigned char :1;
205     unsigned char :1;
206     unsigned char :1;
207     unsigned char :1;
208     unsigned char :1;
209     unsigned char :1;
210   };
211 } __PCON_bits_t;
212 extern volatile __PCON_bits_t __at(PCON_ADDR) PCON_bits;
213
214 #define NOT_POR              PCON_bits.NOT_POR
215
216 // ----- STATUS bits --------------------
217 typedef union {
218   struct {
219     unsigned char C:1;
220     unsigned char DC:1;
221     unsigned char Z:1;
222     unsigned char NOT_PD:1;
223     unsigned char NOT_TO:1;
224     unsigned char RP0:1;
225     unsigned char RP1:1;
226     unsigned char IRP:1;
227   };
228 } __STATUS_bits_t;
229 extern volatile __STATUS_bits_t __at(STATUS_ADDR) STATUS_bits;
230
231 #define C                    STATUS_bits.C
232 #define DC                   STATUS_bits.DC
233 #define Z                    STATUS_bits.Z
234 #define NOT_PD               STATUS_bits.NOT_PD
235 #define NOT_TO               STATUS_bits.NOT_TO
236 #define RP0                  STATUS_bits.RP0
237 #define RP1                  STATUS_bits.RP1
238 #define IRP                  STATUS_bits.IRP
239
240 #endif