Imported Upstream version 2.9.0
[debian/cc1111] / device / include / mcs51 / at89s53.h
1 /*-------------------------------------------------------------------------
2    Register Declarations for the Atmel AT89S53 Processor
3
4    Written By -  Jesus Calvino-Fraga / jesusc at ece.ubc.ca (March 2005)
5
6    This library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    This library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with this library; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19
20    In other words, you are welcome to use, share and improve this program.
21    You are forbidden to forbid anyone else to use, share and improve
22    what you give them.   Help stamp out software-hoarding!
23 -------------------------------------------------------------------------*/
24
25 #ifndef REG_AT89S53_H
26 #define REG_AT89S53_H
27
28 #include <8052.h>     /* load difinitions for the 8052 core */
29
30 #ifdef REG8052_H
31 #undef REG8052_H
32 #endif
33
34 /* define AT89S53 specific registers only */
35 __sfr __at (0x84) DP1L;     /* Data Pointer 1 Low Byte */
36 __sfr __at (0x85) DP1H;     /* Data Pointer 1 High Byte */
37 __sfr __at (0x86) SPDR;     /* SPI Data Register */
38 __sfr __at (0xAA) SPSR;     /* SPI Status Register */
39 __sfr __at (0x96) WMCON;    /* Watchdog and Memory Control Register */
40 __sfr __at (0xD5) SPCR;     /* SPI Control Register */
41
42 /*------------------------------------------------
43 SPSR (0xAA) Bit Values - Reset Value = 0000.0000
44 ------------------------------------------------*/
45 #define WCOL_   0x40    /* SPI Write Collision Flag: 1=Collision */
46 #define SPIF_   0x80    /* SPI Interrupt Flag */
47
48 /*------------------------------------------------
49 WMCON (0x96) Bit Values
50 ------------------------------------------------*/
51 #define WDTEN_   0x01
52
53 #define WDTRST_  0x02   /* Watchdog Timer Reset and EEPROM Ready,/Busy Flag*/
54 #define EERDY_   0x02   /* Watchdog Timer Reset and EEPROM Ready,/Busy Flag */
55
56 #define DPS_     0x04   /* Data Pointer Select: 0=DP0, 1=DP1 */
57 #define EEMEN_   0x08   /* Internal EEPROM Access Enable: 1=Enabled */
58 #define EEMWE_   0x10   /* Internal EEPROM Write Enable: 1=Enabled */
59 #define PS0_     0x20   /* Prescaler bit 0 for the Watchdog Timer */
60 #define PS1_     0x40   /* Prescaler bit 1 for the Watchdog Timer */
61 #define PS2_     0x80   /* Prescaler bit 2 for the Watchdog Timer */
62                         /* 000 =   16ms Timeout */
63                         /* 001 =   32ms Timeout */
64                         /* 010 =   64ms Timeout */
65                         /* 011 =  128ms Timeout */
66                         /* 100 =  256ms Timeout */
67                         /* 101 =  512ms Timeout */
68                         /* 110 = 1024ms Timeout */
69                         /* 111 = 2048ms Timeout */
70
71 /*------------------------------------------------
72 SPCR (0xD5) Bit Values - Reset Value = 0000.01XX
73 ------------------------------------------------*/
74 #define SPR0_   0x01    /* SPI Clock Rate Select bit 0 */
75 #define SPR1_   0x02    /* SPI Clock Rate Select bit 1 */
76                         /* 00 = Fosc / 4   */
77                         /* 01 = Fosc / 16  */
78                         /* 10 = Fosc / 64  */
79                         /* 11 = Fosc / 128 */
80
81 #define CPHA_   0x04    /* SPI Clock Phase */
82 #define CPOL_   0x08    /* SPI Clock Polarity */
83 #define MSTR_   0x10    /* SPI Master/Slave Select: 0=Slave, 1=Master */
84 #define DORD_   0x20    /* SPI Data Order: 0=MSB First, 1=LSB First */
85 #define SPE_    0x40    /* SPI Enable: 0=Disabled, 1=Enabled */
86 #define SPIE_   0x80    /* SPI Interrupt Enable: 0=Disabled, 1=Enabled */
87
88 #endif /*REG_AT89S53_H*/