7a41ce198861acc1e926043a77dffe2b9ed73780
[fw/sdcc] / device / include / mcs51 / P89LPC901.h
1 /*--------------------------------------------------------------------------\r
2 P89LPC901.H\r
3 (English)\r
4 This header allows to use the microcontroler Philips P89LPC901\r
5 with the compiler SDCC.\r
6 \r
7 Copyright (c) 2005 Omar Espinosa--e-mail: opiedrahita2003 AT yahoo.com.\r
8 \r
9    This library is free software; you can redistribute it and/or\r
10    modify it under the terms of the GNU Lesser General Public\r
11    License as published by the Free Software Foundation; either\r
12    version 2.1 of the License, or (at your option) any later version.\r
13 \r
14    This library is distributed in the hope that it will be useful,\r
15    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
17    Lesser General Public License for more details.\r
18 \r
19    You should have received a copy of the GNU Lesser General Public\r
20    License along with this library; if not, write to the Free Software\r
21    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA\r
22 \r
23 (Spanish-EspaƱol)\r
24 Archivo encabezador para el ucontrolador Philips P89LPC901.\r
25 Derechos de copy (DC) 2005.  OMAR ESPINOSA P.  E-mail: opiedrahita2003 AT yahoo.com\r
26 Uso libre\r
27 --------------------------------------------------------------------------*/\r
28 \r
29 #ifndef __REG901_H__\r
30 #define __REG901_H__\r
31 \r
32 /*  BYTE Registers  */\r
33 __sfr __at (0x80) P0       ;\r
34 __sfr __at (0x84) P0M1     ;\r
35 __sfr __at (0x85) P0M2     ;\r
36 \r
37 __sfr __at (0x90) P1       ;\r
38 __sfr __at (0x91) P1M1     ;\r
39 __sfr __at (0x92) P1M2     ;\r
40 \r
41 __sfr __at (0xB0) P3       ;\r
42 __sfr __at (0xB1) P3M1     ;\r
43 __sfr __at (0xB2) P3M2     ;\r
44 //------------------\r
45 __sfr __at (0xD0) PSW      ;\r
46 __sfr __at (0xE0) ACC      ;\r
47 __sfr __at (0xF0) B        ;\r
48 __sfr __at (0x81) SP       ;\r
49 __sfr __at (0x82) DPL      ;\r
50 __sfr __at (0x83) DPH      ;\r
51 //------------------\r
52 __sfr __at (0xA2) AUXR1    ;\r
53 __sfr __at (0xAC) CMP1     ;\r
54 __sfr __at (0x95) DIVM     ;\r
55 \r
56 __sfr __at (0xE7) FMADRH   ;\r
57 __sfr __at (0xE6) FMADRL   ;\r
58 __sfr __at (0xE4) FMCON    ;\r
59 __sfr __at (0xE5) FMDATA   ;\r
60 \r
61 __sfr __at (0xA8) IEN0     ;\r
62 __sfr __at (0xE8) IEN1     ;\r
63 \r
64 __sfr __at (0xB8) IP0      ;\r
65 __sfr __at (0xB7) IP0H     ;\r
66 __sfr __at (0xF8) IP1      ;\r
67 __sfr __at (0xF7) IP1H     ;\r
68 \r
69 __sfr __at (0x94) KBCON    ;\r
70 __sfr __at (0x86) KBMASK   ;\r
71 __sfr __at (0x93) KBPATN   ;\r
72 \r
73 __sfr __at (0x87) PCON     ;\r
74 __sfr __at (0xB5) PCONA    ;\r
75 __sfr __at (0xB6) PCONB    ;\r
76 \r
77 __sfr __at (0xF6) PT0AD    ;\r
78 __sfr __at (0xDF) RSTSRC   ;\r
79 \r
80 __sfr __at (0xD1) RTCCON   ;\r
81 __sfr __at (0xD2) RTCH     ;\r
82 __sfr __at (0xD3) RTCL     ;\r
83 \r
84 __sfr __at (0x8F) TAMOD    ;\r
85 __sfr __at (0x88) TCON     ;\r
86 __sfr __at (0x8A) TL0      ;\r
87 __sfr __at (0x8B) TL1      ;\r
88 __sfr __at (0x8C) TH0      ;\r
89 __sfr __at (0x8D) TH1      ;\r
90 __sfr __at (0x89) TMOD     ;\r
91 __sfr __at (0x96) TRIM     ;\r
92 \r
93 __sfr __at (0xA7) WDCON    ;\r
94 __sfr __at (0xC1) WDL      ;\r
95 __sfr __at (0xC2) WFEED1   ;\r
96 __sfr __at (0xC3) WFEED2   ;\r
97 \r
98 \r
99 /*  BIT Registers  */\r
100 /*  PSW   */\r
101 __sbit __at (0xD7)    PSW_7;\r
102 __sbit __at (0xD6)    PSW_6;\r
103 __sbit __at (0xD5)    PSW_5;\r
104 __sbit __at (0xD4)    PSW_4;\r
105 __sbit __at (0xD3)    PSW_3;\r
106 __sbit __at (0xD2)    PSW_2;\r
107 __sbit __at (0xD1)    PSW_1;\r
108 __sbit __at (0xD0)    PSW_0;\r
109 \r
110 #define  CY      PSW_7\r
111 #define  AC      PSW_6\r
112 #define  F0      PSW_5\r
113 #define  RS1     PSW_4\r
114 #define  RS0     PSW_3\r
115 #define  OV      PSW_2\r
116 #define  F1      PSW_1\r
117 #define  P       PSW_0\r
118 \r
119 /*  TCON  */\r
120 __sbit __at (0x8F)    TCON_7;\r
121 __sbit __at (0x8E)    TCON_6;\r
122 __sbit __at (0x8D)    TCON_5;\r
123 __sbit __at (0x8C)    TCON_4;\r
124 \r
125 #define TF1      TCON_7\r
126 #define TR1      TCON_6\r
127 #define TF0      TCON_5\r
128 #define TR0      TCON_4\r
129 \r
130 /*  IEN0   */\r
131 __sbit __at (0xAF)    IEN0_7;\r
132 __sbit __at (0xAE)    IEN0_6;\r
133 __sbit __at (0xAD)    IEN0_5;\r
134 __sbit __at (0xAB)    IEN0_3;\r
135 __sbit __at (0xA9)    IEN0_1;\r
136 \r
137 #define EA       IEN0_7\r
138 #define EWDRT    IEN0_6\r
139 #define EBO      IEN0_5\r
140 #define ET1      IEN0_3\r
141 #define ET0      IEN0_1\r
142 \r
143 /*  IEN1   */\r
144 __sbit __at (0xEA)    IEN1_2;\r
145 __sbit __at (0xE9)    IEN1_1;\r
146 \r
147 #define EC       IEN1_2\r
148 #define EKBI     IEN1_1\r
149 \r
150 /*  IP0   */\r
151 __sbit __at (0xBE)    IP0_6;\r
152 __sbit __at (0xBD)    IP0_5;\r
153 __sbit __at (0xBB)    IP0_3;\r
154 __sbit __at (0xB9)    IP0_1;\r
155 \r
156 #define PWDRT    IP0_6\r
157 #define PB0      IP0_5\r
158 #define PT1      IP0_3\r
159 #define PT0      IP0_1\r
160 \r
161 /*  P0  */\r
162 __sbit __at (0x85)    P0_5;\r
163 __sbit __at (0x84)    P0_4;\r
164 \r
165 #define KB5      P0_5\r
166 #define CMPREF   P0_5\r
167 #define KB4      P0_4\r
168 #define CIN1A    P0_4\r
169 \r
170 /*  P1  */\r
171 __sbit __at (0x95)    P1_5;\r
172 __sbit __at (0x92)    P1_2;\r
173 \r
174 #define RST      P1_5\r
175 #define T0       P1_2\r
176 \r
177 /*  P3  */\r
178 __sbit __at (0xB1)    P3_1;\r
179 __sbit __at (0xB0)    P3_0;\r
180 \r
181 #define XTAL1    P3_1\r
182 #define XTAL2    P3_0\r
183 \r
184 #endif\r