OpenCores
URL https://opencores.org/ocsvn/openmsp430/openmsp430/trunk

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src-c/] [sandbox/] [omsp_system.h] - Blame information for rev 211

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 141 olivier.gi
/*===========================================================================*/
2
/* Copyright (C) 2001 Authors                                                */
3
/*                                                                           */
4
/* This source file may be used and distributed without restriction provided */
5
/* that this copyright statement is not removed from the file and that any   */
6
/* derivative work contains the original copyright notice and the associated */
7
/* disclaimer.                                                               */
8
/*                                                                           */
9
/* This source file is free software; you can redistribute it and/or modify  */
10
/* it under the terms of the GNU Lesser General Public License as published  */
11
/* by the Free Software Foundation; either version 2.1 of the License, or    */
12
/* (at your option) any later version.                                       */
13
/*                                                                           */
14
/* This source is distributed in the hope that it will be useful, but WITHOUT*/
15
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     */
16
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public       */
17
/* License for more details.                                                 */
18
/*                                                                           */
19
/* You should have received a copy of the GNU Lesser General Public License  */
20
/* along with this source; if not, write to the Free Software Foundation,    */
21
/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA        */
22
/*                                                                           */
23
/*===========================================================================*/
24
/*                          OMSP_SYSTEM HEADER FILE                          */
25
/*---------------------------------------------------------------------------*/
26
/*                                                                           */
27
/* Author(s):                                                                */
28
/*             - Olivier Girard,    olgirard@gmail.com                       */
29
/*                                                                           */
30
/*---------------------------------------------------------------------------*/
31
/* $Rev: 19 $                                                                */
32
/* $LastChangedBy: olivier.girard $                                          */
33
/* $LastChangedDate: 2009-08-04 23:47:15 +0200 (Tue, 04 Aug 2009) $          */
34
/*===========================================================================*/
35
 
36
//=============================================================================
37
// PERIPHERALS REGISTER DEFINITIONS
38
//=============================================================================
39
 
40
//----------------------------------------------------------
41
// SPECIAL FUNCTION REGISTERS
42
//----------------------------------------------------------
43 211 olivier.gi
#define  IE1_set_wdtie()   __asm__ __volatile__ ("bis.b #0x01, &0x0000")
44
//#define  IE1         (*(volatile unsigned char *) 0x0000)
45 141 olivier.gi
#define  IFG1        (*(volatile unsigned char *) 0x0002)
46
 
47
#define  CPU_ID_LO   (*(volatile unsigned char *) 0x0004)
48
#define  CPU_ID_HI   (*(volatile unsigned char *) 0x0006)
49
 
50
 
51
//----------------------------------------------------------
52
// GPIOs
53
//----------------------------------------------------------
54
#define  P1IN        (*(volatile unsigned char *) 0x0020)
55
#define  P1OUT       (*(volatile unsigned char *) 0x0021)
56
#define  P1DIR       (*(volatile unsigned char *) 0x0022)
57
#define  P1IFG       (*(volatile unsigned char *) 0x0023)
58
#define  P1IES       (*(volatile unsigned char *) 0x0024)
59
#define  P1IE        (*(volatile unsigned char *) 0x0025)
60
#define  P1SEL       (*(volatile unsigned char *) 0x0026)
61
 
62
#define  P2IN        (*(volatile unsigned char *) 0x0028)
63
#define  P2OUT       (*(volatile unsigned char *) 0x0029)
64
#define  P2DIR       (*(volatile unsigned char *) 0x002A)
65
#define  P2IFG       (*(volatile unsigned char *) 0x002B)
66
#define  P2IES       (*(volatile unsigned char *) 0x002C)
67
#define  P2IE        (*(volatile unsigned char *) 0x002D)
68
#define  P2SEL       (*(volatile unsigned char *) 0x002E)
69
 
70
#define  P3IN        (*(volatile unsigned char *) 0x0018)
71
#define  P3OUT       (*(volatile unsigned char *) 0x0019)
72
#define  P3DIR       (*(volatile unsigned char *) 0x001A)
73
#define  P3SEL       (*(volatile unsigned char *) 0x001B)
74
 
75
#define  P4IN        (*(volatile unsigned char *) 0x001C)
76
#define  P4OUT       (*(volatile unsigned char *) 0x001D)
77
#define  P4DIR       (*(volatile unsigned char *) 0x001E)
78
#define  P4SEL       (*(volatile unsigned char *) 0x001F)
79
 
80
#define  P5IN        (*(volatile unsigned char *) 0x0030)
81
#define  P5OUT       (*(volatile unsigned char *) 0x0031)
82
#define  P5DIR       (*(volatile unsigned char *) 0x0032)
83
#define  P5SEL       (*(volatile unsigned char *) 0x0033)
84
 
85
#define  P6IN        (*(volatile unsigned char *) 0x0034)
86
#define  P6OUT       (*(volatile unsigned char *) 0x0035)
87
#define  P6DIR       (*(volatile unsigned char *) 0x0036)
88
#define  P6SEL       (*(volatile unsigned char *) 0x0037)
89
 
90
 
91
//----------------------------------------------------------
92
// BASIC CLOCK MODULE
93
//----------------------------------------------------------
94
#define  BCSCTL1     (*(volatile unsigned char *) 0x0057)
95
#define  BCSCTL2     (*(volatile unsigned char *) 0x0058)
96
 
97
 
98
//----------------------------------------------------------
99
// WATCHDOG TIMER
100
//----------------------------------------------------------
101
 
102
// Addresses
103
#define  WDTCTL      (*(volatile unsigned int  *) 0x0120)
104
 
105
// Bit masks
106
#define  WDTIS0      (0x0001)
107
#define  WDTIS1      (0x0002)
108
#define  WDTSSEL     (0x0004)
109
#define  WDTCNTCL    (0x0008)
110
#define  WDTTMSEL    (0x0010)
111
#define  WDTNMI      (0x0020)
112
#define  WDTNMIES    (0x0040)
113
#define  WDTHOLD     (0x0080)
114
#define  WDTPW       (0x5A00)
115
 
116
 
117
//----------------------------------------------------------
118
// HARDWARE MULTIPLIER
119
//----------------------------------------------------------
120
#define  OP1_MPY     (*(volatile unsigned int  *) 0x0130)
121
#define  OP1_MPYS    (*(volatile unsigned int  *) 0x0132)
122
#define  OP1_MAC     (*(volatile unsigned int  *) 0x0134)
123
#define  OP1_MACS    (*(volatile unsigned int  *) 0x0136)
124
#define  OP2         (*(volatile unsigned int  *) 0x0138)
125
 
126
#define  RESLO       (*(volatile unsigned int  *) 0x013A)
127
#define  RESHI       (*(volatile unsigned int  *) 0x013C)
128
#define  SUMEXT      (*(volatile unsigned int  *) 0x013E)
129
 
130
 
131
//----------------------------------------------------------
132
// TIMER A
133
//----------------------------------------------------------
134
#define  TACTL       (*(volatile unsigned int  *) 0x0160)
135
#define  TAR         (*(volatile unsigned int  *) 0x0170)
136
#define  TACCTL0     (*(volatile unsigned int  *) 0x0162)
137
#define  TACCR0      (*(volatile unsigned int  *) 0x0172)
138
#define  TACCTL1     (*(volatile unsigned int  *) 0x0164)
139
#define  TACCR1      (*(volatile unsigned int  *) 0x0174)
140
#define  TACCTL2     (*(volatile unsigned int  *) 0x0166)
141
#define  TACCR2      (*(volatile unsigned int  *) 0x0176)
142
#define  TAIV        (*(volatile unsigned int  *) 0x012E)
143
 
144
 
145
//=============================================================================
146
// INTERRUPT VECTORS
147
//=============================================================================
148
#define interrupt(x) void __attribute__((interrupt (x)))
149 200 olivier.gi
#define eint()            __asm__ __volatile__ ("eint { nop")
150
#define dint()            __asm__ __volatile__ ("dint")
151 141 olivier.gi
 
152 200 olivier.gi
// Vector definition for RedHat/TI toolchain
153
#ifdef PFX_MSP430_ELF
154
   #define RESET_VECTOR        ("reset")   // Vector 15  (0xFFFE) - Reset              -  [Highest Priority]
155
   #define NMI_VECTOR          (15)        // Vector 14  (0xFFFC) - Non-maskable       -
156
   #define UNUSED_13_VECTOR    (14)        // Vector 13  (0xFFFA) -                    -
157
   #define UNUSED_12_VECTOR    (13)        // Vector 12  (0xFFF8) -                    -
158
   #define UNUSED_11_VECTOR    (12)        // Vector 11  (0xFFF6) -                    -
159
   #define WDT_VECTOR          (11)        // Vector 10  (0xFFF4) - Watchdog Timer     -
160
   #define TIMERA0_VECTOR      (10)        // Vector  9  (0xFFF2) - Timer A CC0        -
161
   #define TIMERA1_VECTOR      (9)         // Vector  8  (0xFFF0) - Timer A CC1-2, TA  -
162
   #define UNUSED_07_VECTOR    (8)         // Vector  7  (0xFFEE) -                    -
163
   #define UNUSED_06_VECTOR    (7)         // Vector  6  (0xFFEC) -                    -
164
   #define UNUSED_05_VECTOR    (6)         // Vector  5  (0xFFEA) -                    -
165
   #define UNUSED_04_VECTOR    (5)         // Vector  4  (0xFFE8) -                    -
166
   #define PORT2_VECTOR        (4)         // Vector  3  (0xFFE6) - Port 1             -
167
   #define PORT1_VECTOR        (3)         // Vector  2  (0xFFE4) - Port 1             -
168
   #define UNUSED_01_VECTOR    (2)         // Vector  1  (0xFFE2) -                    -
169
   #define UNUSED_00_VECTOR    (1)         // Vector  0  (0xFFE0) -                    -  [Lowest Priority]
170
 
171
// Vector definition for MSPGCC toolchain
172
#else
173
   #define RESET_VECTOR        (0x001E)    // Vector 15  (0xFFFE) - Reset              -  [Highest Priority]
174
   #define NMI_VECTOR          (0x001C)    // Vector 14  (0xFFFC) - Non-maskable       -
175
   #define UNUSED_13_VECTOR    (0x001A)    // Vector 13  (0xFFFA) -                    -
176
   #define UNUSED_12_VECTOR    (0x0018)    // Vector 12  (0xFFF8) -                    -
177
   #define UNUSED_11_VECTOR    (0x0016)    // Vector 11  (0xFFF6) -                    -
178
   #define WDT_VECTOR          (0x0014)    // Vector 10  (0xFFF4) - Watchdog Timer     -
179
   #define TIMERA0_VECTOR      (0x0012)    // Vector  9  (0xFFF2) - Timer A CC0        -
180
   #define TIMERA1_VECTOR      (0x0010)    // Vector  8  (0xFFF0) - Timer A CC1-2, TA  -
181
   #define UNUSED_07_VECTOR    (0x000E)    // Vector  7  (0xFFEE) -                    -
182
   #define UNUSED_06_VECTOR    (0x000C)    // Vector  6  (0xFFEC) -                    -
183
   #define UNUSED_05_VECTOR    (0x000A)    // Vector  5  (0xFFEA) -                    -
184
   #define UNUSED_04_VECTOR    (0x0008)    // Vector  4  (0xFFE8) -                    -
185
   #define PORT2_VECTOR        (0x0006)    // Vector  3  (0xFFE6) - Port 1             -
186
   #define PORT1_VECTOR        (0x0004)    // Vector  2  (0xFFE4) - Port 1             -
187
   #define UNUSED_01_VECTOR    (0x0002)    // Vector  1  (0xFFE2) -                    -
188
   #define UNUSED_00_VECTOR    (0x0000)    // Vector  0  (0xFFE0) -                    -  [Lowest Priority]
189
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.