Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2850 dpurdie 1
/******************************************************************************/
2
/* Legacy Header File                                                         */
3
/* Not recommended for use in new projects.                                   */
4
/* Please use the msp430.h file or the device specific header file            */
5
/******************************************************************************/
6
 
7
/********************************************************************
8
*
9
* Standard register and bit definitions for the Texas Instruments
10
* MSP430 microcontroller.
11
*
12
* This file supports assembler and C development for
13
* MSP430xE42x devices.
14
*
15
* Texas Instruments, Version 2.6
16
*
17
*
18
* Rev. 2.1,  Alignment of defintions in Users Guide and of version numbers
19
* Rev. 2.2,  Added new definitions for ESP430
20
* Rev. 2.21, Fixed swap of mSET_STARTCURR_FRAC and mSET_STARTCURR_FRAC
21
* Rev. 2.22, Removed definition of LCDLOWR (not available at 4xx devices)
22
*            Added definition for mI2RDY
23
* Rev. 2.23, Fixed bit names in accordance to Users Guide
24
* Rev. 2.24, Added SD16INTDLY_x definitions
25
* Rev. 2.24, Added mREAD_I2 definition
26
* Rev. 2.3, Removed unused def of TASSEL2
27
* Rev. 2.4, Added VLD bits in SVS module
28
* Rev. 2.5, Removed definitions for BTRESET
29
*           Fixed type define of AFECCTL2
30
* Rev. 2.6, added definitions for Interrupt Vectors xxIV
31
*
32
********************************************************************/
33
 
34
#ifndef __msp430xE42x
35
#define __msp430xE42x
36
 
37
#ifdef __cplusplus
38
extern "C" {
39
#endif
40
 
41
 
42
/*----------------------------------------------------------------------------*/
43
/* PERIPHERAL FILE MAP                                                        */
44
/*----------------------------------------------------------------------------*/
45
 
46
/* External references resolved by a device-specific linker command file */
47
#define SFR_8BIT(address)   extern volatile unsigned char address
48
#define SFR_16BIT(address)  extern volatile unsigned int address
49
 
50
 
51
/************************************************************
52
* STANDARD BITS
53
************************************************************/
54
 
55
#define BIT0                   (0x0001)
56
#define BIT1                   (0x0002)
57
#define BIT2                   (0x0004)
58
#define BIT3                   (0x0008)
59
#define BIT4                   (0x0010)
60
#define BIT5                   (0x0020)
61
#define BIT6                   (0x0040)
62
#define BIT7                   (0x0080)
63
#define BIT8                   (0x0100)
64
#define BIT9                   (0x0200)
65
#define BITA                   (0x0400)
66
#define BITB                   (0x0800)
67
#define BITC                   (0x1000)
68
#define BITD                   (0x2000)
69
#define BITE                   (0x4000)
70
#define BITF                   (0x8000)
71
 
72
/************************************************************
73
* STATUS REGISTER BITS
74
************************************************************/
75
 
76
#define C                      (0x0001)
77
#define Z                      (0x0002)
78
#define N                      (0x0004)
79
#define V                      (0x0100)
80
#define GIE                    (0x0008)
81
#define CPUOFF                 (0x0010)
82
#define OSCOFF                 (0x0020)
83
#define SCG0                   (0x0040)
84
#define SCG1                   (0x0080)
85
 
86
/* Low Power Modes coded with Bits 4-7 in SR */
87
 
88
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
89
#define LPM0                   (CPUOFF)
90
#define LPM1                   (SCG0+CPUOFF)
91
#define LPM2                   (SCG1+CPUOFF)
92
#define LPM3                   (SCG1+SCG0+CPUOFF)
93
#define LPM4                   (SCG1+SCG0+OSCOFF+CPUOFF)
94
/* End #defines for assembler */
95
 
96
#else /* Begin #defines for C */
97
#define LPM0_bits              (CPUOFF)
98
#define LPM1_bits              (SCG0+CPUOFF)
99
#define LPM2_bits              (SCG1+CPUOFF)
100
#define LPM3_bits              (SCG1+SCG0+CPUOFF)
101
#define LPM4_bits              (SCG1+SCG0+OSCOFF+CPUOFF)
102
 
103
#include "in430.h"
104
 
105
#define LPM0         _bis_SR_register(LPM0_bits)         /* Enter Low Power Mode 0 */
106
#define LPM0_EXIT    _bic_SR_register_on_exit(LPM0_bits) /* Exit Low Power Mode 0 */
107
#define LPM1         _bis_SR_register(LPM1_bits)         /* Enter Low Power Mode 1 */
108
#define LPM1_EXIT    _bic_SR_register_on_exit(LPM1_bits) /* Exit Low Power Mode 1 */
109
#define LPM2         _bis_SR_register(LPM2_bits)         /* Enter Low Power Mode 2 */
110
#define LPM2_EXIT    _bic_SR_register_on_exit(LPM2_bits) /* Exit Low Power Mode 2 */
111
#define LPM3         _bis_SR_register(LPM3_bits)         /* Enter Low Power Mode 3 */
112
#define LPM3_EXIT    _bic_SR_register_on_exit(LPM3_bits) /* Exit Low Power Mode 3 */
113
#define LPM4         _bis_SR_register(LPM4_bits)         /* Enter Low Power Mode 4 */
114
#define LPM4_EXIT    _bic_SR_register_on_exit(LPM4_bits) /* Exit Low Power Mode 4 */
115
#endif /* End #defines for C */
116
 
117
/************************************************************
118
* PERIPHERAL FILE MAP
119
************************************************************/
120
 
121
/************************************************************
122
* SPECIAL FUNCTION REGISTER ADDRESSES + CONTROL BITS
123
************************************************************/
124
 
125
SFR_8BIT(IE1);                                /* Interrupt Enable 1 */
126
#define U0IE                   IE1            /* UART0 Interrupt Enable Register */
127
#define WDTIE                  (0x01)
128
#define OFIE                   (0x02)
129
#define NMIIE                  (0x10)
130
#define ACCVIE                 (0x20)
131
#define URXIE0                 (0x40)
132
#define UTXIE0                 (0x80)
133
 
134
SFR_8BIT(IFG1);                               /* Interrupt Flag 1 */
135
#define U0IFG                  IFG1           /* UART0 Interrupt Flag Register */
136
#define WDTIFG                 (0x01)
137
#define OFIFG                  (0x02)
138
#define NMIIFG                 (0x10)
139
#define URXIFG0                (0x40)
140
#define UTXIFG0                (0x80)
141
 
142
SFR_8BIT(ME1);                                /* Module Enable 1 */
143
#define U0ME                   ME1            /* UART0 Module Enable Register */
144
#define URXE0                  (0x40)
145
#define UTXE0                  (0x80)
146
#define USPIE0                 (0x40)
147
 
148
SFR_8BIT(IE2);                                /* Interrupt Enable 2 */
149
#define BTIE                   (0x80)
150
 
151
SFR_8BIT(IFG2);                               /* Interrupt Flag 2 */
152
#define BTIFG                  (0x80)
153
 
154
/************************************************************
155
* WATCHDOG TIMER
156
************************************************************/
157
#define __MSP430_HAS_WDT__                    /* Definition to show that Module is available */
158
 
159
SFR_16BIT(WDTCTL);                            /* Watchdog Timer Control */
160
/* The bit names have been prefixed with "WDT" */
161
#define WDTIS0                 (0x0001)
162
#define WDTIS1                 (0x0002)
163
#define WDTSSEL                (0x0004)
164
#define WDTCNTCL               (0x0008)
165
#define WDTTMSEL               (0x0010)
166
#define WDTNMI                 (0x0020)
167
#define WDTNMIES               (0x0040)
168
#define WDTHOLD                (0x0080)
169
 
170
#define WDTPW                  (0x5A00)
171
 
172
/* WDT-interval times [1ms] coded with Bits 0-2 */
173
/* WDT is clocked by fSMCLK (assumed 1MHz) */
174
#define WDT_MDLY_32         (WDTPW+WDTTMSEL+WDTCNTCL)                         /* 32ms interval (default) */
175
#define WDT_MDLY_8          (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS0)                  /* 8ms     " */
176
#define WDT_MDLY_0_5        (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS1)                  /* 0.5ms   " */
177
#define WDT_MDLY_0_064      (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS1+WDTIS0)           /* 0.064ms " */
178
/* WDT is clocked by fACLK (assumed 32KHz) */
179
#define WDT_ADLY_1000       (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL)                 /* 1000ms  " */
180
#define WDT_ADLY_250        (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS0)          /* 250ms   " */
181
#define WDT_ADLY_16         (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS1)          /* 16ms    " */
182
#define WDT_ADLY_1_9        (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS1+WDTIS0)   /* 1.9ms   " */
183
/* Watchdog mode -> reset after expired time */
184
/* WDT is clocked by fSMCLK (assumed 1MHz) */
185
#define WDT_MRST_32         (WDTPW+WDTCNTCL)                                  /* 32ms interval (default) */
186
#define WDT_MRST_8          (WDTPW+WDTCNTCL+WDTIS0)                           /* 8ms     " */
187
#define WDT_MRST_0_5        (WDTPW+WDTCNTCL+WDTIS1)                           /* 0.5ms   " */
188
#define WDT_MRST_0_064      (WDTPW+WDTCNTCL+WDTIS1+WDTIS0)                    /* 0.064ms " */
189
/* WDT is clocked by fACLK (assumed 32KHz) */
190
#define WDT_ARST_1000       (WDTPW+WDTCNTCL+WDTSSEL)                          /* 1000ms  " */
191
#define WDT_ARST_250        (WDTPW+WDTCNTCL+WDTSSEL+WDTIS0)                   /* 250ms   " */
192
#define WDT_ARST_16         (WDTPW+WDTCNTCL+WDTSSEL+WDTIS1)                   /* 16ms    " */
193
#define WDT_ARST_1_9        (WDTPW+WDTCNTCL+WDTSSEL+WDTIS1+WDTIS0)            /* 1.9ms   " */
194
 
195
/* INTERRUPT CONTROL */
196
/* These two bits are defined in the Special Function Registers */
197
/* #define WDTIE               0x01 */
198
/* #define WDTIFG              0x01 */
199
 
200
/************************************************************
201
* DIGITAL I/O Port1/2
202
************************************************************/
203
#define __MSP430_HAS_PORT1__                  /* Definition to show that Module is available */
204
#define __MSP430_HAS_PORT2__                  /* Definition to show that Module is available */
205
 
206
SFR_8BIT(P1IN);                               /* Port 1 Input */
207
SFR_8BIT(P1OUT);                              /* Port 1 Output */
208
SFR_8BIT(P1DIR);                              /* Port 1 Direction */
209
SFR_8BIT(P1IFG);                              /* Port 1 Interrupt Flag */
210
SFR_8BIT(P1IES);                              /* Port 1 Interrupt Edge Select */
211
SFR_8BIT(P1IE);                               /* Port 1 Interrupt Enable */
212
SFR_8BIT(P1SEL);                              /* Port 1 Selection */
213
 
214
SFR_8BIT(P2IN);                               /* Port 2 Input */
215
SFR_8BIT(P2OUT);                              /* Port 2 Output */
216
SFR_8BIT(P2DIR);                              /* Port 2 Direction */
217
SFR_8BIT(P2IFG);                              /* Port 2 Interrupt Flag */
218
SFR_8BIT(P2IES);                              /* Port 2 Interrupt Edge Select */
219
SFR_8BIT(P2IE);                               /* Port 2 Interrupt Enable */
220
SFR_8BIT(P2SEL);                              /* Port 2 Selection */
221
 
222
/************************************************************
223
* BASIC TIMER
224
************************************************************/
225
#define __MSP430_HAS_BT__                     /* Definition to show that Module is available */
226
 
227
SFR_8BIT(BTCTL);                              /* Basic Timer Control */
228
/* The bit names have been prefixed with "BT" */
229
#define BTIP0                  (0x01)
230
#define BTIP1                  (0x02)
231
#define BTIP2                  (0x04)
232
#define BTFRFQ0                (0x08)
233
#define BTFRFQ1                (0x10)
234
#define BTDIV                  (0x20)         /* fCLK2 = ACLK:256 */
235
#define BTHOLD                 (0x40)         /* BT1 is held if this bit is set */
236
#define BTSSEL                 (0x80)         /* fBT = fMCLK (main clock) */
237
 
238
SFR_8BIT(BTCNT1);                             /* Basic Timer Count 1 */
239
SFR_8BIT(BTCNT2);                             /* Basic Timer Count 2 */
240
 
241
/* Frequency of the BTCNT2 coded with Bit 5 and 7 in BTCTL */
242
#define BT_fCLK2_ACLK          (0x00)
243
#define BT_fCLK2_ACLK_DIV256   (BTDIV)
244
#define BT_fCLK2_MCLK          (BTSSEL)
245
 
246
/* Interrupt interval time fINT coded with Bits 0-2 in BTCTL */
247
#define BT_fCLK2_DIV2          (0x00)         /* fINT = fCLK2:2 (default) */
248
#define BT_fCLK2_DIV4          (BTIP0)        /* fINT = fCLK2:4 */
249
#define BT_fCLK2_DIV8          (BTIP1)        /* fINT = fCLK2:8 */
250
#define BT_fCLK2_DIV16         (BTIP1+BTIP0)  /* fINT = fCLK2:16 */
251
#define BT_fCLK2_DIV32         (BTIP2)        /* fINT = fCLK2:32 */
252
#define BT_fCLK2_DIV64         (BTIP2+BTIP0)  /* fINT = fCLK2:64 */
253
#define BT_fCLK2_DIV128        (BTIP2+BTIP1)  /* fINT = fCLK2:128 */
254
#define BT_fCLK2_DIV256     (BTIP2+BTIP1+BTIP0)       /* fINT = fCLK2:256 */
255
/* Frequency of LCD coded with Bits 3-4 */
256
#define BT_fLCD_DIV32          (0x00)         /* fLCD = fACLK:32 (default) */
257
#define BT_fLCD_DIV64          (BTFRFQ0)      /* fLCD = fACLK:64 */
258
#define BT_fLCD_DIV128         (BTFRFQ1)      /* fLCD = fACLK:128 */
259
#define BT_fLCD_DIV256      (BTFRFQ1+BTFRFQ0)         /* fLCD = fACLK:256 */
260
/* LCD frequency values with fBT=fACLK */
261
#define BT_fLCD_1K             (0x00)         /* fACLK:32 (default) */
262
#define BT_fLCD_512            (BTFRFQ0)      /* fACLK:64 */
263
#define BT_fLCD_256            (BTFRFQ1)      /* fACLK:128 */
264
#define BT_fLCD_128         (BTFRFQ1+BTFRFQ0)         /* fACLK:256 */
265
/* LCD frequency values with fBT=fMCLK */
266
#define BT_fLCD_31K            (BTSSEL)       /* fMCLK:32 */
267
#define BT_fLCD_15_5K       (BTSSEL+BTFRFQ0)          /* fMCLK:64 */
268
#define BT_fLCD_7_8K        (BTSSEL+BTFRFQ1+BTFRFQ0)  /* fMCLK:256 */
269
/* with assumed vlues of fACLK=32KHz, fMCLK=1MHz */
270
/* fBT=fACLK is thought for longer interval times */
271
#define BT_ADLY_0_064          (0x00)         /* 0.064ms interval (default) */
272
#define BT_ADLY_0_125          (BTIP0)        /* 0.125ms    " */
273
#define BT_ADLY_0_25           (BTIP1)        /* 0.25ms     " */
274
#define BT_ADLY_0_5            (BTIP1+BTIP0)  /* 0.5ms      " */
275
#define BT_ADLY_1              (BTIP2)        /* 1ms        " */
276
#define BT_ADLY_2              (BTIP2+BTIP0)  /* 2ms        " */
277
#define BT_ADLY_4              (BTIP2+BTIP1)  /* 4ms        " */
278
#define BT_ADLY_8           (BTIP2+BTIP1+BTIP0)       /* 8ms        " */
279
#define BT_ADLY_16             (BTDIV)        /* 16ms       " */
280
#define BT_ADLY_32             (BTDIV+BTIP0)  /* 32ms       " */
281
#define BT_ADLY_64             (BTDIV+BTIP1)  /* 64ms       " */
282
#define BT_ADLY_125         (BTDIV+BTIP1+BTIP0)       /* 125ms      " */
283
#define BT_ADLY_250            (BTDIV+BTIP2)  /* 250ms      " */
284
#define BT_ADLY_500         (BTDIV+BTIP2+BTIP0)       /* 500ms      " */
285
#define BT_ADLY_1000        (BTDIV+BTIP2+BTIP1)       /* 1000ms     " */
286
#define BT_ADLY_2000        (BTDIV+BTIP2+BTIP1+BTIP0) /* 2000ms     " */
287
/* fCLK2=fMCLK (1MHz) is thought for short interval times */
288
/* the timing for short intervals is more precise than ACLK */
289
/* NOTE */
290
/* Be sure that the SCFQCTL-Register is set to 01Fh so that fMCLK=1MHz */
291
/* Too low interval time results in interrupts too frequent for the processor to handle! */
292
#define BT_MDLY_0_002          (BTSSEL)       /* 0.002ms interval       *** interval times */
293
#define BT_MDLY_0_004          (BTSSEL+BTIP0) /* 0.004ms    "           *** too short for */
294
#define BT_MDLY_0_008          (BTSSEL+BTIP1) /* 0.008ms    "           *** interrupt */
295
#define BT_MDLY_0_016       (BTSSEL+BTIP1+BTIP0)      /* 0.016ms    "           *** handling */
296
#define BT_MDLY_0_032          (BTSSEL+BTIP2) /* 0.032ms    " */
297
#define BT_MDLY_0_064       (BTSSEL+BTIP2+BTIP0)      /* 0.064ms    " */
298
#define BT_MDLY_0_125       (BTSSEL+BTIP2+BTIP1)      /* 0.125ms    " */
299
#define BT_MDLY_0_25        (BTSSEL+BTIP2+BTIP1+BTIP0)/* 0.25ms     " */
300
 
301
/* Reset/Hold coded with Bits 6-7 in BT(1)CTL */
302
/* this is for BT */
303
//#define BTRESET_CNT1        (BTRESET)           /* BTCNT1 is reset while BTRESET is set */
304
//#define BTRESET_CNT1_2      (BTRESET+BTDIV)     /* BTCNT1 .AND. BTCNT2 are reset while ~ is set */
305
/* this is for BT1 */
306
#define BTHOLD_CNT1            (BTHOLD)       /* BTCNT1 is held while BTHOLD is set */
307
#define BTHOLD_CNT1_2          (BTHOLD+BTDIV) /* BT1CNT1 .AND. BT1CNT2 are held while ~ is set */
308
 
309
/* INTERRUPT CONTROL BITS */
310
/* #define BTIE                0x80 */
311
/* #define BTIFG               0x80 */
312
 
313
/************************************************************
314
* SYSTEM CLOCK, FLL+ (x41x)
315
************************************************************/
316
#define __MSP430_HAS_FLLPLUS_SMALL__                /* Definition to show that Module is available */
317
 
318
SFR_8BIT(SCFI0);                              /* System Clock Frequency Integrator 0 */
319
#define FN_2                   (0x04)         /* fDCOCLK =   1.4-12MHz*/
320
#define FN_3                   (0x08)         /* fDCOCLK =   2.2-17Mhz*/
321
#define FN_4                   (0x10)         /* fDCOCLK =   3.2-25Mhz*/
322
#define FN_8                   (0x20)         /* fDCOCLK =     5-40Mhz*/
323
#define FLLD0                  (0x40)         /* Loop Divider Bit : 0 */
324
#define FLLD1                  (0x80)         /* Loop Divider Bit : 1 */
325
 
326
#define FLLD_1                 (0x00)         /* Multiply Selected Loop Freq. By 1 */
327
#define FLLD_2                 (0x40)         /* Multiply Selected Loop Freq. By 2 */
328
#define FLLD_4                 (0x80)         /* Multiply Selected Loop Freq. By 4 */
329
#define FLLD_8                 (0xC0)         /* Multiply Selected Loop Freq. By 8 */
330
 
331
SFR_8BIT(SCFI1);                              /* System Clock Frequency Integrator 1 */
332
SFR_8BIT(SCFQCTL);                            /* System Clock Frequency Control */
333
/* System clock frequency values fMCLK coded with Bits 0-6 in SCFQCTL */
334
/* #define SCFQ_32K            0x00                        fMCLK=1*fACLK       only a range from */
335
#define SCFQ_64K               (0x01)         /* fMCLK=2*fACLK          1+1 to 127+1 is possible */
336
#define SCFQ_128K              (0x03)         /* fMCLK=4*fACLK */
337
#define SCFQ_256K              (0x07)         /* fMCLK=8*fACLK */
338
#define SCFQ_512K              (0x0F)         /* fMCLK=16*fACLK */
339
#define SCFQ_1M                (0x1F)         /* fMCLK=32*fACLK */
340
#define SCFQ_2M                (0x3F)         /* fMCLK=64*fACLK */
341
#define SCFQ_4M                (0x7F)         /* fMCLK=128*fACLK */
342
#define SCFQ_M                 (0x80)         /* Modulation Disable */
343
 
344
SFR_8BIT(FLL_CTL0);                           /* FLL+ Control 0 */
345
#define DCOF                   (0x01)         /* DCO Fault Flag */
346
#define LFOF                   (0x02)         /* Low Frequency Oscillator Fault Flag */
347
#define XT1OF                  (0x04)         /* High Frequency Oscillator Fault Flag */
348
#define OSCCAP0                (0x10)         /* XIN/XOUT Cap 0 */
349
#define OSCCAP1                (0x20)         /* XIN/XOUT Cap 1 */
350
#define XTS_FLL                (0x40)         /* 1: Selects high-freq. oscillator */
351
#define DCOPLUS                (0x80)         /* DCO+ Enable */
352
 
353
#define XCAP0PF                (0x00)         /* XIN Cap = XOUT Cap = 0pf */
354
#define XCAP10PF               (0x10)         /* XIN Cap = XOUT Cap = 10pf */
355
#define XCAP14PF               (0x20)         /* XIN Cap = XOUT Cap = 14pf */
356
#define XCAP18PF               (0x30)         /* XIN Cap = XOUT Cap = 18pf */
357
#define OSCCAP_0               (0x00)         /* XIN Cap = XOUT Cap = 0pf */
358
#define OSCCAP_1               (0x10)         /* XIN Cap = XOUT Cap = 10pf */
359
#define OSCCAP_2               (0x20)         /* XIN Cap = XOUT Cap = 14pf */
360
#define OSCCAP_3               (0x30)         /* XIN Cap = XOUT Cap = 18pf */
361
 
362
SFR_8BIT(FLL_CTL1);                           /* FLL+ Control 1 */
363
#define FLL_DIV0               (0x01)         /* FLL+ Divide Px.x/ACLK 0 */
364
#define FLL_DIV1               (0x02)         /* FLL+ Divide Px.x/ACLK 1 */
365
 
366
#define FLL_DIV_1              (0x00)         /* FLL+ Divide Px.x/ACLK By 1 */
367
#define FLL_DIV_2              (0x01)         /* FLL+ Divide Px.x/ACLK By 2 */
368
#define FLL_DIV_4              (0x02)         /* FLL+ Divide Px.x/ACLK By 4 */
369
#define FLL_DIV_8              (0x03)         /* FLL+ Divide Px.x/ACLK By 8 */
370
 
371
/* INTERRUPT CONTROL BITS */
372
/* These two bits are defined in the Special Function Registers */
373
/* #define OFIFG               0x02 */
374
/* #define OFIE                0x02 */
375
 
376
/************************************************************
377
* Brown-Out, Supply Voltage Supervision (SVS)
378
************************************************************/
379
#define __MSP430_HAS_SVS__                    /* Definition to show that Module is available */
380
 
381
SFR_8BIT(SVSCTL);                             /* SVS Control */
382
#define SVSFG                  (0x01)         /* SVS Flag */
383
#define SVSOP                  (0x02)         /* SVS output (read only) */
384
#define SVSON                  (0x04)         /* Switches the SVS on/off */
385
#define PORON                  (0x08)         /* Enable POR Generation if Low Voltage */
386
#define VLD0                   (0x10)
387
#define VLD1                   (0x20)
388
#define VLD2                   (0x40)
389
#define VLD3                   (0x80)
390
 
391
#define VLDON                  (0x10)
392
#define VLDOFF                 (0x00)
393
#define VLD_1_8V               (0x10)
394
 
395
/************************************************************
396
* LCD
397
************************************************************/
398
#define __MSP430_HAS_LCD4__                   /* Definition to show that Module is available */
399
 
400
SFR_8BIT(LCDCTL);                             /* LCD Control */
401
/* the names of the mode bits are different from the spec */
402
#define LCDON                  (0x01)
403
//#define LCDLOWR             (0x02)
404
#define LCDSON                 (0x04)
405
#define LCDMX0                 (0x08)
406
#define LCDMX1                 (0x10)
407
#define LCDP0                  (0x20)
408
#define LCDP1                  (0x40)
409
#define LCDP2                  (0x80)
410
/* Display modes coded with Bits 2-4 */
411
#define LCDSTATIC              (LCDSON)
412
#define LCD2MUX                (LCDMX0+LCDSON)
413
#define LCD3MUX                (LCDMX1+LCDSON)
414
#define LCD4MUX                (LCDMX1+LCDMX0+LCDSON)
415
/* Group select code with Bits 5-7                     Seg.lines   Dig.output */
416
#define LCDSG0                 (0x00)         /* ---------   Port Only (default) */
417
#define LCDSG0_1               (LCDP0)        /* S0  - S15   see Datasheet */
418
#define LCDSG0_2               (LCDP1)        /* S0  - S19   see Datasheet */
419
#define LCDSG0_3               (LCDP1+LCDP0)  /* S0  - S23   see Datasheet */
420
#define LCDSG0_4               (LCDP2)        /* S0  - S27   see Datasheet */
421
#define LCDSG0_5               (LCDP2+LCDP0)  /* S0  - S31   see Datasheet */
422
#define LCDSG0_6               (LCDP2+LCDP1)  /* S0  - S35   see Datasheet */
423
#define LCDSG0_7            (LCDP2+LCDP1+LCDP0)       /* S0  - S39   see Datasheet */
424
/* NOTE: YOU CAN ONLY USE THE 'S' OR 'G' DECLARATIONS FOR A COMMAND */
425
/* MOV  #LCDSG0_3+LCDOG2_7,&LCDCTL ACTUALY MEANS MOV  #LCDP1,&LCDCTL! */
426
#define LCDOG1_7               (0x00)         /* ---------   Port Only (default) */
427
#define LCDOG2_7               (LCDP0)        /* S0  - S15   see Datasheet */
428
#define LCDOG3_7               (LCDP1)        /* S0  - S19   see Datasheet */
429
#define LCDOG4_7               (LCDP1+LCDP0)  /* S0  - S23   see Datasheet */
430
#define LCDOG5_7               (LCDP2)        /* S0  - S27   see Datasheet */
431
#define LCDOG6_7               (LCDP2+LCDP0)  /* S0  - S31   see Datasheet */
432
#define LCDOG7                 (LCDP2+LCDP1)  /* S0  - S35   see Datasheet */
433
#define LCDOGOFF            (LCDP2+LCDP1+LCDP0)       /* S0  - S39   see Datasheet */
434
 
435
#define LCDMEM_                (0x0091)       /* LCD Memory */
436
#ifdef __ASM_HEADER__
437
#define LCDMEM                 (LCDMEM_)      /* LCD Memory (for assembler) */
438
#else
439
#define LCDMEM                 ((char*)       LCDMEM_) /* LCD Memory (for C) */
440
#endif
441
SFR_8BIT(LCDM1);                              /* LCD Memory 1 */
442
SFR_8BIT(LCDM2);                              /* LCD Memory 2 */
443
SFR_8BIT(LCDM3);                              /* LCD Memory 3 */
444
SFR_8BIT(LCDM4);                              /* LCD Memory 4 */
445
SFR_8BIT(LCDM5);                              /* LCD Memory 5 */
446
SFR_8BIT(LCDM6);                              /* LCD Memory 6 */
447
SFR_8BIT(LCDM7);                              /* LCD Memory 7 */
448
SFR_8BIT(LCDM8);                              /* LCD Memory 8 */
449
SFR_8BIT(LCDM9);                              /* LCD Memory 9 */
450
SFR_8BIT(LCDM10);                             /* LCD Memory 10 */
451
SFR_8BIT(LCDM11);                             /* LCD Memory 11 */
452
SFR_8BIT(LCDM12);                             /* LCD Memory 12 */
453
SFR_8BIT(LCDM13);                             /* LCD Memory 13 */
454
SFR_8BIT(LCDM14);                             /* LCD Memory 14 */
455
SFR_8BIT(LCDM15);                             /* LCD Memory 15 */
456
SFR_8BIT(LCDM16);                             /* LCD Memory 16 */
457
SFR_8BIT(LCDM17);                             /* LCD Memory 17 */
458
SFR_8BIT(LCDM18);                             /* LCD Memory 18 */
459
SFR_8BIT(LCDM19);                             /* LCD Memory 19 */
460
SFR_8BIT(LCDM20);                             /* LCD Memory 20 */
461
 
462
#define LCDMA                  (LCDM10)       /* LCD Memory A */
463
#define LCDMB                  (LCDM11)       /* LCD Memory B */
464
#define LCDMC                  (LCDM12)       /* LCD Memory C */
465
#define LCDMD                  (LCDM13)       /* LCD Memory D */
466
#define LCDME                  (LCDM14)       /* LCD Memory E */
467
#define LCDMF                  (LCDM15)       /* LCD Memory F */
468
 
469
/************************************************************
470
* USART
471
************************************************************/
472
 
473
/* UxCTL */
474
#define PENA                   (0x80)         /* Parity enable */
475
#define PEV                    (0x40)         /* Parity 0:odd / 1:even */
476
#define SPB                    (0x20)         /* Stop Bits 0:one / 1: two */
477
#define CHAR                   (0x10)         /* Data 0:7-bits / 1:8-bits */
478
#define LISTEN                 (0x08)         /* Listen mode */
479
#define SYNC                   (0x04)         /* UART / SPI mode */
480
#define MM                     (0x02)         /* Master Mode off/on */
481
#define SWRST                  (0x01)         /* USART Software Reset */
482
 
483
/* UxTCTL */
484
#define CKPH                   (0x80)         /* SPI: Clock Phase */
485
#define CKPL                   (0x40)         /* Clock Polarity */
486
#define SSEL1                  (0x20)         /* Clock Source Select 1 */
487
#define SSEL0                  (0x10)         /* Clock Source Select 0 */
488
#define URXSE                  (0x08)         /* Receive Start edge select */
489
#define TXWAKE                 (0x04)         /* TX Wake up mode */
490
#define STC                    (0x02)         /* SPI: STC enable 0:on / 1:off */
491
#define TXEPT                  (0x01)         /* TX Buffer empty */
492
 
493
/* UxRCTL */
494
#define FE                     (0x80)         /* Frame Error */
495
#define PE                     (0x40)         /* Parity Error */
496
#define OE                     (0x20)         /* Overrun Error */
497
#define BRK                    (0x10)         /* Break detected */
498
#define URXEIE                 (0x08)         /* RX Error interrupt enable */
499
#define URXWIE                 (0x04)         /* RX Wake up interrupt enable */
500
#define RXWAKE                 (0x02)         /* RX Wake up detect */
501
#define RXERR                  (0x01)         /* RX Error Error */
502
 
503
/************************************************************
504
* USART 0
505
************************************************************/
506
#define __MSP430_HAS_UART0__                  /* Definition to show that Module is available */
507
 
508
SFR_8BIT(U0CTL);                              /* USART 0 Control */
509
SFR_8BIT(U0TCTL);                             /* USART 0 Transmit Control */
510
SFR_8BIT(U0RCTL);                             /* USART 0 Receive Control */
511
SFR_8BIT(U0MCTL);                             /* USART 0 Modulation Control */
512
SFR_8BIT(U0BR0);                              /* USART 0 Baud Rate 0 */
513
SFR_8BIT(U0BR1);                              /* USART 0 Baud Rate 1 */
514
SFR_8BIT(U0RXBUF);                            /* USART 0 Receive Buffer */
515
SFR_8BIT(U0TXBUF);                            /* USART 0 Transmit Buffer */
516
 
517
/* Alternate register names */
518
 
519
#define UCTL0                  U0CTL          /* USART 0 Control */
520
#define UTCTL0                 U0TCTL         /* USART 0 Transmit Control */
521
#define URCTL0                 U0RCTL         /* USART 0 Receive Control */
522
#define UMCTL0                 U0MCTL         /* USART 0 Modulation Control */
523
#define UBR00                  U0BR0          /* USART 0 Baud Rate 0 */
524
#define UBR10                  U0BR1          /* USART 0 Baud Rate 1 */
525
#define RXBUF0                 U0RXBUF        /* USART 0 Receive Buffer */
526
#define TXBUF0                 U0TXBUF        /* USART 0 Transmit Buffer */
527
#define UCTL0_                 U0CTL_         /* USART 0 Control */
528
#define UTCTL0_                U0TCTL_        /* USART 0 Transmit Control */
529
#define URCTL0_                U0RCTL_        /* USART 0 Receive Control */
530
#define UMCTL0_                U0MCTL_        /* USART 0 Modulation Control */
531
#define UBR00_                 U0BR0_         /* USART 0 Baud Rate 0 */
532
#define UBR10_                 U0BR1_         /* USART 0 Baud Rate 1 */
533
#define RXBUF0_                U0RXBUF_       /* USART 0 Receive Buffer */
534
#define TXBUF0_                U0TXBUF_       /* USART 0 Transmit Buffer */
535
#define UCTL_0                 U0CTL          /* USART 0 Control */
536
#define UTCTL_0                U0TCTL         /* USART 0 Transmit Control */
537
#define URCTL_0                U0RCTL         /* USART 0 Receive Control */
538
#define UMCTL_0                U0MCTL         /* USART 0 Modulation Control */
539
#define UBR0_0                 U0BR0          /* USART 0 Baud Rate 0 */
540
#define UBR1_0                 U0BR1          /* USART 0 Baud Rate 1 */
541
#define RXBUF_0                U0RXBUF        /* USART 0 Receive Buffer */
542
#define TXBUF_0                U0TXBUF        /* USART 0 Transmit Buffer */
543
#define UCTL_0_                U0CTL_         /* USART 0 Control */
544
#define UTCTL_0_               U0TCTL_        /* USART 0 Transmit Control */
545
#define URCTL_0_               U0RCTL_        /* USART 0 Receive Control */
546
#define UMCTL_0_               U0MCTL_        /* USART 0 Modulation Control */
547
#define UBR0_0_                U0BR0_         /* USART 0 Baud Rate 0 */
548
#define UBR1_0_                U0BR1_         /* USART 0 Baud Rate 1 */
549
#define RXBUF_0_               U0RXBUF_       /* USART 0 Receive Buffer */
550
#define TXBUF_0_               U0TXBUF_       /* USART 0 Transmit Buffer */
551
 
552
/************************************************************
553
* Timer A3
554
************************************************************/
555
#define __MSP430_HAS_TA3__                    /* Definition to show that Module is available */
556
 
557
SFR_16BIT(TAIV);                              /* Timer A Interrupt Vector Word */
558
SFR_16BIT(TACTL);                             /* Timer A Control */
559
SFR_16BIT(TACCTL0);                           /* Timer A Capture/Compare Control 0 */
560
SFR_16BIT(TACCTL1);                           /* Timer A Capture/Compare Control 1 */
561
SFR_16BIT(TACCTL2);                           /* Timer A Capture/Compare Control 2 */
562
SFR_16BIT(TAR);                               /* Timer A Counter Register */
563
SFR_16BIT(TACCR0);                            /* Timer A Capture/Compare 0 */
564
SFR_16BIT(TACCR1);                            /* Timer A Capture/Compare 1 */
565
SFR_16BIT(TACCR2);                            /* Timer A Capture/Compare 2 */
566
 
567
/* Alternate register names */
568
#define CCTL0                  TACCTL0        /* Timer A Capture/Compare Control 0 */
569
#define CCTL1                  TACCTL1        /* Timer A Capture/Compare Control 1 */
570
#define CCTL2                  TACCTL2        /* Timer A Capture/Compare Control 2 */
571
#define CCR0                   TACCR0         /* Timer A Capture/Compare 0 */
572
#define CCR1                   TACCR1         /* Timer A Capture/Compare 1 */
573
#define CCR2                   TACCR2         /* Timer A Capture/Compare 2 */
574
#define CCTL0_                 TACCTL0_       /* Timer A Capture/Compare Control 0 */
575
#define CCTL1_                 TACCTL1_       /* Timer A Capture/Compare Control 1 */
576
#define CCTL2_                 TACCTL2_       /* Timer A Capture/Compare Control 2 */
577
#define CCR0_                  TACCR0_        /* Timer A Capture/Compare 0 */
578
#define CCR1_                  TACCR1_        /* Timer A Capture/Compare 1 */
579
#define CCR2_                  TACCR2_        /* Timer A Capture/Compare 2 */
580
/* Alternate register names - 5xx style */
581
#define TA0IV                  TAIV           /* Timer A Interrupt Vector Word */
582
#define TA0CTL                 TACTL          /* Timer A Control */
583
#define TA0CCTL0               TACCTL0        /* Timer A Capture/Compare Control 0 */
584
#define TA0CCTL1               TACCTL1        /* Timer A Capture/Compare Control 1 */
585
#define TA0CCTL2               TACCTL2        /* Timer A Capture/Compare Control 2 */
586
#define TA0R                   TAR            /* Timer A Counter Register */
587
#define TA0CCR0                TACCR0         /* Timer A Capture/Compare 0 */
588
#define TA0CCR1                TACCR1         /* Timer A Capture/Compare 1 */
589
#define TA0CCR2                TACCR2         /* Timer A Capture/Compare 2 */
590
#define TA0IV_                 TAIV_          /* Timer A Interrupt Vector Word */
591
#define TA0CTL_                TACTL_         /* Timer A Control */
592
#define TA0CCTL0_              TACCTL0_       /* Timer A Capture/Compare Control 0 */
593
#define TA0CCTL1_              TACCTL1_       /* Timer A Capture/Compare Control 1 */
594
#define TA0CCTL2_              TACCTL2_       /* Timer A Capture/Compare Control 2 */
595
#define TA0R_                  TAR_           /* Timer A Counter Register */
596
#define TA0CCR0_               TACCR0_        /* Timer A Capture/Compare 0 */
597
#define TA0CCR1_               TACCR1_        /* Timer A Capture/Compare 1 */
598
#define TA0CCR2_               TACCR2_        /* Timer A Capture/Compare 2 */
599
 
600
#define TASSEL1                (0x0200)       /* Timer A clock source select 0 */
601
#define TASSEL0                (0x0100)       /* Timer A clock source select 1 */
602
#define ID1                    (0x0080)       /* Timer A clock input divider 1 */
603
#define ID0                    (0x0040)       /* Timer A clock input divider 0 */
604
#define MC1                    (0x0020)       /* Timer A mode control 1 */
605
#define MC0                    (0x0010)       /* Timer A mode control 0 */
606
#define TACLR                  (0x0004)       /* Timer A counter clear */
607
#define TAIE                   (0x0002)       /* Timer A counter interrupt enable */
608
#define TAIFG                  (0x0001)       /* Timer A counter interrupt flag */
609
 
610
#define MC_0                   (0*0x10u)      /* Timer A mode control: 0 - Stop */
611
#define MC_1                   (1*0x10u)      /* Timer A mode control: 1 - Up to CCR0 */
612
#define MC_2                   (2*0x10u)      /* Timer A mode control: 2 - Continous up */
613
#define MC_3                   (3*0x10u)      /* Timer A mode control: 3 - Up/Down */
614
#define ID_0                   (0*0x40u)      /* Timer A input divider: 0 - /1 */
615
#define ID_1                   (1*0x40u)      /* Timer A input divider: 1 - /2 */
616
#define ID_2                   (2*0x40u)      /* Timer A input divider: 2 - /4 */
617
#define ID_3                   (3*0x40u)      /* Timer A input divider: 3 - /8 */
618
#define TASSEL_0               (0*0x100u)     /* Timer A clock source select: 0 - TACLK */
619
#define TASSEL_1               (1*0x100u)     /* Timer A clock source select: 1 - ACLK  */
620
#define TASSEL_2               (2*0x100u)     /* Timer A clock source select: 2 - SMCLK */
621
#define TASSEL_3               (3*0x100u)     /* Timer A clock source select: 3 - INCLK */
622
 
623
#define CM1                    (0x8000)       /* Capture mode 1 */
624
#define CM0                    (0x4000)       /* Capture mode 0 */
625
#define CCIS1                  (0x2000)       /* Capture input select 1 */
626
#define CCIS0                  (0x1000)       /* Capture input select 0 */
627
#define SCS                    (0x0800)       /* Capture sychronize */
628
#define SCCI                   (0x0400)       /* Latched capture signal (read) */
629
#define CAP                    (0x0100)       /* Capture mode: 1 /Compare mode : 0 */
630
#define OUTMOD2                (0x0080)       /* Output mode 2 */
631
#define OUTMOD1                (0x0040)       /* Output mode 1 */
632
#define OUTMOD0                (0x0020)       /* Output mode 0 */
633
#define CCIE                   (0x0010)       /* Capture/compare interrupt enable */
634
#define CCI                    (0x0008)       /* Capture input signal (read) */
635
#define OUT                    (0x0004)       /* PWM Output signal if output mode 0 */
636
#define COV                    (0x0002)       /* Capture/compare overflow flag */
637
#define CCIFG                  (0x0001)       /* Capture/compare interrupt flag */
638
 
639
#define OUTMOD_0               (0*0x20u)      /* PWM output mode: 0 - output only */
640
#define OUTMOD_1               (1*0x20u)      /* PWM output mode: 1 - set */
641
#define OUTMOD_2               (2*0x20u)      /* PWM output mode: 2 - PWM toggle/reset */
642
#define OUTMOD_3               (3*0x20u)      /* PWM output mode: 3 - PWM set/reset */
643
#define OUTMOD_4               (4*0x20u)      /* PWM output mode: 4 - toggle */
644
#define OUTMOD_5               (5*0x20u)      /* PWM output mode: 5 - Reset */
645
#define OUTMOD_6               (6*0x20u)      /* PWM output mode: 6 - PWM toggle/set */
646
#define OUTMOD_7               (7*0x20u)      /* PWM output mode: 7 - PWM reset/set */
647
#define CCIS_0                 (0*0x1000u)    /* Capture input select: 0 - CCIxA */
648
#define CCIS_1                 (1*0x1000u)    /* Capture input select: 1 - CCIxB */
649
#define CCIS_2                 (2*0x1000u)    /* Capture input select: 2 - GND */
650
#define CCIS_3                 (3*0x1000u)    /* Capture input select: 3 - Vcc */
651
#define CM_0                   (0*0x4000u)    /* Capture mode: 0 - disabled */
652
#define CM_1                   (1*0x4000u)    /* Capture mode: 1 - pos. edge */
653
#define CM_2                   (2*0x4000u)    /* Capture mode: 1 - neg. edge */
654
#define CM_3                   (3*0x4000u)    /* Capture mode: 1 - both edges */
655
 
656
/* TA3IV Definitions */
657
#define TAIV_NONE              (0x0000)       /* No Interrupt pending */
658
#define TAIV_TACCR1            (0x0002)       /* TACCR1_CCIFG */
659
#define TAIV_TACCR2            (0x0004)       /* TACCR2_CCIFG */
660
#define TAIV_6                 (0x0006)       /* Reserved */
661
#define TAIV_8                 (0x0008)       /* Reserved */
662
#define TAIV_TAIFG             (0x000A)       /* TAIFG */
663
 
664
/*************************************************************
665
* Flash Memory
666
*************************************************************/
667
#define __MSP430_HAS_FLASH__                  /* Definition to show that Module is available */
668
 
669
SFR_16BIT(FCTL1);                             /* FLASH Control 1 */
670
SFR_16BIT(FCTL2);                             /* FLASH Control 2 */
671
SFR_16BIT(FCTL3);                             /* FLASH Control 3 */
672
 
673
#define FRKEY                  (0x9600)       /* Flash key returned by read */
674
#define FWKEY                  (0xA500)       /* Flash key for write */
675
#define FXKEY                  (0x3300)       /* for use with XOR instruction */
676
 
677
#define ERASE                  (0x0002)       /* Enable bit for Flash segment erase */
678
#define MERAS                  (0x0004)       /* Enable bit for Flash mass erase */
679
#define WRT                    (0x0040)       /* Enable bit for Flash write */
680
#define BLKWRT                 (0x0080)       /* Enable bit for Flash segment write */
681
#define SEGWRT                 (0x0080)       /* old definition */ /* Enable bit for Flash segment write */
682
 
683
#define FN0                    (0x0001)       /* Divide Flash clock by 1 to 64 using FN0 to FN5 according to: */
684
#define FN1                    (0x0002)       /*  32*FN5 + 16*FN4 + 8*FN3 + 4*FN2 + 2*FN1 + FN0 + 1 */
685
#ifndef FN2
686
#define FN2                    (0x0004)
687
#endif
688
#ifndef FN3
689
#define FN3                    (0x0008)
690
#endif
691
#ifndef FN4
692
#define FN4                    (0x0010)
693
#endif
694
#define FN5                    (0x0020)
695
#define FSSEL0                 (0x0040)       /* Flash clock select 0 */        /* to distinguish from USART SSELx */
696
#define FSSEL1                 (0x0080)       /* Flash clock select 1 */
697
 
698
#define FSSEL_0                (0x0000)       /* Flash clock select: 0 - ACLK */
699
#define FSSEL_1                (0x0040)       /* Flash clock select: 1 - MCLK */
700
#define FSSEL_2                (0x0080)       /* Flash clock select: 2 - SMCLK */
701
#define FSSEL_3                (0x00C0)       /* Flash clock select: 3 - SMCLK */
702
 
703
#define BUSY                   (0x0001)       /* Flash busy: 1 */
704
#define KEYV                   (0x0002)       /* Flash Key violation flag */
705
#define ACCVIFG                (0x0004)       /* Flash Access violation flag */
706
#define WAIT                   (0x0008)       /* Wait flag for segment write */
707
#define LOCK                   (0x0010)       /* Lock bit: 1 - Flash is locked (read only) */
708
#define EMEX                   (0x0020)       /* Flash Emergency Exit */
709
 
710
/************************************************************
711
* HARDWARE MULTIPLIER
712
************************************************************/
713
#define __MSP430_HAS_MPY__                    /* Definition to show that Module is available */
714
 
715
SFR_16BIT(MPY);                               /* Multiply Unsigned/Operand 1 */
716
SFR_16BIT(MPYS);                              /* Multiply Signed/Operand 1 */
717
SFR_16BIT(MAC);                               /* Multiply Unsigned and Accumulate/Operand 1 */
718
SFR_16BIT(MACS);                              /* Multiply Signed and Accumulate/Operand 1 */
719
SFR_16BIT(OP2);                               /* Operand 2 */
720
SFR_16BIT(RESLO);                             /* Result Low Word */
721
SFR_16BIT(RESHI);                             /* Result High Word */
722
SFR_16BIT(SUMEXT);                            /* Sum Extend */
723
 
724
/************************************************************
725
* SD16 - Sigma Delta 16 Bit
726
************************************************************/
727
#define __MSP430_HAS_SD16_3__                 /* Definition to show that Module is available */
728
 
729
SFR_8BIT(SD16INCTL0);                         /* SD16 Input Control Register Channel 0 */
730
SFR_8BIT(SD16INCTL1);                         /* SD16 Input Control Register Channel 1 */
731
SFR_8BIT(SD16INCTL2);                         /* SD16 Input Control Register Channel 2 */
732
SFR_8BIT(SD16PRE0);                           /* SD16 Preload Register Channel 0 */
733
SFR_8BIT(SD16PRE1);                           /* SD16 Preload Register Channel 1 */
734
SFR_8BIT(SD16PRE2);                           /* SD16 Preload Register Channel 2 */
735
SFR_8BIT(SD16CONF0);                          /* SD16 Internal Configuration Register 0 */
736
SFR_8BIT(SD16CONF1);                          /* SD16 Internal Configuration Register 1 */
737
                                      /* Please use only the recommended settings */
738
 
739
SFR_16BIT(SD16CTL);                           /* Sigma Delta ADC 16 Control Register */
740
SFR_16BIT(SD16CCTL0);                         /* SD16 Channel 0 Control Register */
741
SFR_16BIT(SD16CCTL1);                         /* SD16 Channel 1 Control Register */
742
SFR_16BIT(SD16CCTL2);                         /* SD16 Channel 2 Control Register */
743
SFR_16BIT(SD16IV);                            /* SD16 Interrupt Vector Register */
744
SFR_16BIT(SD16MEM0);                          /* SD16 Channel 0 Conversion Memory */
745
SFR_16BIT(SD16MEM1);                          /* SD16 Channel 1 Conversion Memory */
746
SFR_16BIT(SD16MEM2);                          /* SD16 Channel 2 Conversion Memory */
747
 
748
/* SD16INCTLx - AFEINCTLx */
749
#define SD16INCH0              (0x0001)       /* SD16 Input Channel select 0 */
750
#define SD16INCH1              (0x0002)       /* SD16 Input Channel select 1 */
751
#define SD16INCH2              (0x0004)       /* SD16 Input Channel select 2 */
752
#define SD16GAIN0              (0x0008)       /* SD16 Input Pre-Amplifier Gain Select 0 */
753
#define SD16GAIN1              (0x0010)       /* SD16 Input Pre-Amplifier Gain Select 1 */
754
#define SD16GAIN2              (0x0020)       /* SD16 Input Pre-Amplifier Gain Select 2 */
755
#define SD16INTDLY0            (0x0040)       /* SD16 Interrupt Delay after 1.Conversion 0 */
756
#define SD16INTDLY1            (0x0080)       /* SD16 Interrupt Delay after 1.Conversion 1 */
757
 
758
#define SD16GAIN_1             (0x0000)       /* SD16 Input Pre-Amplifier Gain Select *1  */
759
#define SD16GAIN_2             (0x0008)       /* SD16 Input Pre-Amplifier Gain Select *2  */
760
#define SD16GAIN_4             (0x0010)       /* SD16 Input Pre-Amplifier Gain Select *4  */
761
#define SD16GAIN_8             (0x0018)       /* SD16 Input Pre-Amplifier Gain Select *8  */
762
#define SD16GAIN_16            (0x0020)       /* SD16 Input Pre-Amplifier Gain Select *16 */
763
#define SD16GAIN_32            (0x0028)       /* SD16 Input Pre-Amplifier Gain Select *32 */
764
 
765
#define SD16INCH_0             (0x0000)       /* SD16 Input Channel select input */
766
#define SD16INCH_1             (0x0001)       /* SD16 Input Channel select input */
767
#define SD16INCH_2             (0x0002)       /* SD16 Input Channel select input */
768
#define SD16INCH_3             (0x0003)       /* SD16 Input Channel select input */
769
#define SD16INCH_4             (0x0004)       /* SD16 Input Channel select input */
770
#define SD16INCH_5             (0x0005)       /* SD16 Input Channel select input */
771
#define SD16INCH_6             (0x0006)       /* SD16 Input Channel select Temp */
772
#define SD16INCH_7             (0x0007)       /* SD16 Input Channel select Offset */
773
 
774
#define SD16INTDLY_0           (0x0000)       /* SD16 Interrupt Delay: Int. after 4.Conversion  */
775
#define SD16INTDLY_1           (0x0040)       /* SD16 Interrupt Delay: Int. after 3.Conversion  */
776
#define SD16INTDLY_2           (0x0080)       /* SD16 Interrupt Delay: Int. after 2.Conversion  */
777
#define SD16INTDLY_3           (0x00C0)       /* SD16 Interrupt Delay: Int. after 1.Conversion  */
778
 
779
/* SD16CTL - AFECTL */
780
#define SD16OVIE               (0x0002)       /* SD16 Overflow Interupt Enable */
781
#define SD16REFON              (0x0004)       /* SD16 Switch internal Reference on */
782
#define SD16VMIDON             (0x0008)       /* SD16 Switch Vmid Buffer on */
783
#define SD16SSEL0              (0x0010)       /* SD16 Clock Source Select 0 */
784
#define SD16SSEL1              (0x0020)       /* SD16 Clock Source Select 1 */
785
#define SD16DIV0               (0x0040)       /* SD16 Clock Divider Select 0 */
786
#define SD16DIV1               (0x0080)       /* SD16 Clock Divider Select 1 */
787
#define SD16LP                 (0x0100)       /* SD16 Low Power Mode Enable */
788
 
789
#define SD16DIV_0              (0x0000)       /* SD16 Clock Divider Select /1 */
790
#define SD16DIV_1              (SD16DIV0)     /* SD16 Clock Divider Select /2 */
791
#define SD16DIV_2              (SD16DIV1)     /* SD16 Clock Divider Select /4 */
792
#define SD16DIV_3            (SD16DIV0+SD16DIV1)    /* SD16 Clock Divider Select /8 */
793
 
794
#define SD16SSEL_0             (0x0000)       /* SD16 Clock Source Select MCLK  */
795
#define SD16SSEL_1             (SD16SSEL0)    /* SD16 Clock Source Select SMCLK */
796
#define SD16SSEL_2             (SD16SSEL1)    /* SD16 Clock Source Select ACLK  */
797
#define SD16SSEL_3           (SD16SSEL0+SD16SSEL1)  /* SD16 Clock Source Select TACLK */
798
 
799
/* SD16CCTLx - AFECCTLx */
800
#define SD16GRP                (0x0001)       /* SD16 Grouping of Channels: 0:Off/1:On */
801
#define SD16SC                 (0x0002)       /* SD16 Start Conversion */
802
#define SD16IFG                (0x0004)       /* SD16 Channel x Interrupt Flag */
803
#define SD16IE                 (0x0008)       /* SD16 Channel x Interrupt Enable */
804
#define SD16DF                 (0x0010)       /* SD16 Channel x Data Format: 0:Unipolar/1:Bipolar */
805
#define SD16OVIFG              (0x0020)       /* SD16 Channel x Overflow Interrupt Flag */
806
#define SD16LSBACC             (0x0040)       /* SD16 Channel x Access LSB of ADC */
807
#define SD16LSBTOG             (0x0080)       /* SD16 Channel x Toggle LSB Output of ADC */
808
#define SD16OSR0               (0x0100)       /* SD16 Channel x OverSampling Ratio 0 */
809
#define SD16OSR1               (0x0200)       /* SD16 Channel x OverSampling Ratio 1 */
810
#define SD16SNGL               (0x0400)       /* SD16 Channel x Single Conversion On/Off */
811
 
812
#define SD16OSR_256            (0x0000)       /* SD16 Channel x OverSampling Ratio 256 */
813
#define SD16OSR_128            (0x0100)       /* SD16 Channel x OverSampling Ratio 128 */
814
#define SD16OSR_64             (0x0200)       /* SD16 Channel x OverSampling Ratio  64 */
815
#define SD16OSR_32             (0x0300)       /* SD16 Channel x OverSampling Ratio  32 */
816
 
817
/* SD16IV Definitions */
818
#define SD16IV_NONE            (0x0000)       /* No Interrupt pending */
819
#define SD16IV_SD16OVIFG       (0x0002)       /* SD16OVIFG */
820
#define SD16IV_SD16MEM0        (0x0004)       /* SD16MEM0 SD16IFG */
821
#define SD16IV_SD16MEM1        (0x0006)       /* SD16MEM1 SD16IFG */
822
#define SD16IV_SD16MEM2        (0x0008)       /* SD16MEM2 SD16IFG */
823
 
824
/************************************************************
825
* ESP430E
826
************************************************************/
827
#define __MSP430_HAS_ESP430E__                /* Definition to show that Module is available */
828
 
829
#define AFEINCTL0              SD16INCTL0     /* AFE Input Control Register Channel 0 */
830
#define AFEINCTL1              SD16INCTL1     /* AFE Input Control Register Channel 1 */
831
#define AFEINCTL2              SD16INCTL2     /* AFE Input Control Register Channel 2 */
832
#define AFECTL                 SD16CTL        /* Analog Front End Control Register */
833
#define AFECCTL0               SD16CCTL0      /* AFE Channel 0 Control Register */
834
#define AFECCTL1               SD16CCTL1      /* AFE Channel 1 Control Register */
835
#define AFECCTL2               SD16CCTL2      /* AFE Channel 2 Control Register */
836
 
837
SFR_16BIT(ESPCTL);                            /* ESP430 Control Register */
838
SFR_16BIT(MBCTL);                             /* Mailbox Control Register */
839
SFR_16BIT(MBIN0);                             /* Incoming Mailbox 0 Register */
840
SFR_16BIT(MBIN1);                             /* Incoming Mailbox 1 Register */
841
SFR_16BIT(MBOUT0);                            /* Outgoing Mailbox 0 Register */
842
SFR_16BIT(MBOUT1);                            /* Outgoing Mailbox 1 Register */
843
 
844
SFR_16BIT(ESP430_STAT0);                      /* ESP430 Return Value 0 */
845
SFR_16BIT(ESP430_STAT1);                      /* ESP430 Return Value 1 */
846
SFR_16BIT(WAVEFSV1);                          /* ESP430 Return Value 2 */
847
SFR_16BIT(RET3);                              /* ESP430 Return Value 3 */
848
SFR_16BIT(RET4);                              /* ESP430 Return Value 4 */
849
SFR_16BIT(WAVEFSI1);                          /* ESP430 Return Value 5 */
850
SFR_16BIT(WAVEFSI2);                          /* ESP430 Return Value 6 */
851
SFR_16BIT(RET7);                              /* ESP430 Return Value 7 */
852
SFR_16BIT(ACTENERGY1_LO);                     /* ESP430 Return Value 8 */
853
SFR_16BIT(ACTENERGY1_HI);                     /* ESP430 Return Value 9 */
854
SFR_16BIT(ACTENERGY2_LO);                     /* ESP430 Return Value 10 */
855
SFR_16BIT(ACTENERGY2_HI);                     /* ESP430 Return Value 11 */
856
SFR_16BIT(REACTENERGY_LO);                    /* ESP430 Return Value 12 */
857
SFR_16BIT(REACTENERGY_HI);                    /* ESP430 Return Value 13 */
858
SFR_16BIT(APPENERGY_LO);                      /* ESP430 Return Value 14 */
859
SFR_16BIT(APPENERGY_HI);                      /* ESP430 Return Value 15 */
860
SFR_16BIT(ACTENSPER1_LO);                     /* ESP430 Return Value 16 */
861
SFR_16BIT(ACTENSPER1_HI);                     /* ESP430 Return Value 17 */
862
SFR_16BIT(ACTENSPER2_LO);                     /* ESP430 Return Value 18 */
863
SFR_16BIT(ACTENSPER2_HI);                     /* ESP430 Return Value 19 */
864
SFR_16BIT(POWERFCT);                          /* ESP430 Return Value 20 */
865
SFR_16BIT(CAPIND);                            /* ESP430 Return Value 21 */
866
SFR_16BIT(MAINSPERIOD);                       /* ESP430 Return Value 22 */
867
SFR_16BIT(V1RMS);                             /* ESP430 Return Value 23 */
868
SFR_16BIT(IRMS_LO);                           /* ESP430 Return Value 24 */
869
SFR_16BIT(IRMS_HI);                           /* ESP430 Return Value 25 */
870
SFR_16BIT(VPEAK);                             /* ESP430 Return Value 26 */
871
SFR_16BIT(IPEAK);                             /* ESP430 Return Value 27 */
872
SFR_16BIT(LINECYCLCNT_LO);                    /* ESP430 Return Value 28 */
873
SFR_16BIT(LINECYCLCNT_HI);                    /* ESP430 Return Value 29 */
874
SFR_16BIT(NMBMEAS_LO);                        /* ESP430 Return Value 30 */
875
SFR_16BIT(NMBMEAS_HI);                        /* ESP430 Return Value 31 */
876
 
877
#define RET0                   ESP430_STAT0   /* STATUS0 of ESP430 */
878
#define RET1                   ESP430_STAT1   /* STATUS1 of ESP430 */
879
#define RET2                   WAVEFSV1       /* Waveform Sample V1 offset corrected*/
880
#define RET5                   WAVEFSI1       /* Waveform Sample I1 offset corrected*/
881
#define RET6                   WAVEFSI2       /* Waveform Sample I2 offset corrected*/
882
#define RET8                   ACTENERGY1_LO  /* Active energy I1 Low Word */
883
#define RET9                   ACTENERGY1_HI  /* Active energy I1 High Word */
884
#define RET10                  ACTENERGY2_LO  /* Active energy I2 Low Word */
885
#define RET11                  ACTENERGY2_HI  /* Active energy I2 High Word*/
886
#define RET12                  REACTENERGY_LO /* Reactive energy Low Word */
887
#define RET13                  REACTENERGY_HI /* Reactive energy High Word */
888
#define RET14                  APPENERGY_LO   /* Apparent energy Low Word */
889
#define RET15                  APPENERGY_HI   /* Apparent energy High Word */
890
#define RET16                  ACTENSPER1_LO  /* Active energy I1 for last mains period Low Word */
891
#define RET17                  ACTENSPER1_HI  /* Active energy I1 for last mains period High Word */
892
#define RET18                  ACTENSPER2_LO  /* Active energy I2 for last mains period Low Word */
893
#define RET19                  ACTENSPER2_HI  /* Active energy I2 for last mains period High Word */
894
#define RET20                  POWERFCT       /* Power factor */
895
#define RET21                  CAPIND         /* Power factor: neg: inductive pos: cap. (LowByte)*/
896
#define RET22                  MAINSPERIOD    /* Mains period */
897
#define RET23                  V1RMS          /* Voltage RMS V1 value last second */
898
#define RET24                  IRMS_LO        /* Current RMS value last second I1 I2 Low Word */
899
#define RET25                  IRMS_HI        /* Current RMS value last second I1 I2 High Word */
900
#define RET26                  VPEAK          /* Voltage V1 absolute peak value */
901
#define RET27                  IPEAK          /* Current absolute peak value I1 I2 */
902
#define RET28                  LINECYCLCNT_LO /* Line cycle counter Low Word */
903
#define RET29                  LINECYCLCNT_HI /* Line cycle counter High Word */
904
#define RET30                  NMBMEAS_LO     /* Number of Measurements for CPU signal Low Word */
905
#define RET31                  NMBMEAS_HI     /* Number of Measurements for CPU signal High Word */
906
 
907
/* ESPCTL */
908
#define ESPEN                  (0x0001)       /* ESP430 Module enable */
909
#define ESPSUSP                (0x0002)       /* ESP430 Module suspend */
910
#define IREQ                   (0x0004)       /* NOT supported by current ESP430 Software */
911
 
912
/* RET0 - Status0 Flags */
913
#define WFSRDYFG               (0x0001)       /* New waveform Samples ready Flag */
914
#define I2GTI1FG               (0x0002)       /* Current I2 greater then I1 Flag */
915
#define ILREACHEDFG            (0x0004)       /* Interrupt level reached Flag */
916
#define ENRDYFG                (0x0008)       /* New Energy values ready Flag */
917
#define ZXLDFG                 (0x0010)       /* Zero Crossing of V1 Flag (leading edge) */
918
#define ZXTRFG                 (0x0020)       /* Zero Crossing of V1 Flag (trailing edge) */
919
#define CALRDYFG               (0x0040)       /* Calibration values ready Flag */
920
#define TAMPFG                 (0x0080)       /* Tampering Occured Flag */
921
#define NEGENFG                (0x0100)       /* Negativ Energy Flag */
922
#define VDROPFG                (0x0200)       /* Voltage drop occured Flag */
923
#define VPEAKFG                (0x0400)       /* Voltage exceed VPeak level Flag */
924
#define I1PEAKFG               (0x0800)       /* Current exceed I1Peak level Flag */
925
#define I2PEAKFG               (0x1000)       /* Current exceed I2Peak level Flag */
926
//#define RESERVED          (0x8000)  /* Reserved */
927
//#define RESERVED          (0x8000)  /* Reserved */
928
#define ACTIVEFG               (0x8000)       /* Measurement or Calibration running Flag */
929
 
930
/* MBCTL */
931
#define IN0IFG                 (0x0001)       /* Incoming Mail 0 Interrupt Flag */
932
#define IN1IFG                 (0x0002)       /* Incoming Mail 1 Interrupt Flag */
933
#define OUT0FG                 (0x0004)       /* Outgoing Mail 0 Flag */
934
#define OUT1FG                 (0x0008)       /* Outgoing Mail 1 Flag */
935
#define IN0IE                  (0x0010)       /* Incoming Mail 0 Interrupt Enable */
936
#define IN1IE                  (0x0020)       /* Incoming Mail 1 Interrupt Enable */
937
#define CLR0OFF                (0x0040)       /* Switch off automatic clear of IN0IFG */
938
#define CLR1OFF                (0x0080)       /* Switch off automatic clear of IN1IFG */
939
#define OUT0IFG                (0x0100)       /* Outgoing Mail 0 Interrupt Flag */
940
#define OUT1IFG                (0x0200)       /* Outgoing Mail 1 Interrupt Flag */
941
#define OUT0IE                 (0x0400)       /* Outgoing Mail 0 Interrupt Enable */
942
#define OUT1IE                 (0x0800)       /* Outgoing Mail 1 Interrupt Enable */
943
 
944
/* Messages to ESP */
945
#define mRESET                 (0x0001)       /* Restart ESP430 Software */
946
#define mSET_MODE              (0x0003)       /* Set Operation Mode for ESP430 Software */
947
#define mCLR_EVENT             (0x0005)       /* Clear Flags for ESP430 Software */
948
#define mINIT                  (0x0007)       /* Initialize ESP430 Software */
949
#define mTEMP                  (0x0009)       /* Request Temp. Measurement from ESP430 Software */
950
#define mSWVERSION             (0x000B)       /* Request software version of ESP430 */
951
#define mREAD_PARAM            (0x000D)       /* Request to read the parameter with no. “Parameter No.” */
952
#define mREAD_I2               (0x000F)       /* Request to read the I2 Channel (only if not used) */
953
 
954
#define mSET_CTRL0             (0x0200)       /* Set Control Register 0 */
955
#define mSET_CTRL1             (0x0202)       /* Set Control Register 1 */
956
#define mSET_EVENT             (0x0204)       /* Set which Evenets should cause an message */
957
#define mSET_PHASECORR1        (0x0206)       /* Set Phase Correction fo I1 */
958
#define mSET_PHASECORR2        (0x0208)       /* Set Phase Correction fo I2 */
959
#define mSET_V1OFFSET          (0x020A)       /* Set Offset for V1 */
960
#define mSET_I1OFFSET          (0x020C)       /* Set Offset for I1 */
961
#define mSET_I2OFFSET          (0x020E)       /* Set Offset for I2 */
962
#define mSET_ADAPTI1           (0x0210)       /* Set Adaption factor for I1 */
963
#define mSET_ADAPTI2           (0x0212)       /* Set Adaption factor for I2 */
964
#define mSET_GAINCORR1         (0x0214)       /* Set Gain Correction for Power P1 */
965
#define mSET_POFFSET1_LO       (0x0216)       /* Set Power Offset for Power P1 */
966
#define mSET_POFFSET1_HI       (0x0218)       /* Set Power Offset for Power P1 */
967
#define mSET_GAINCORR2         (0x021A)       /* Set Gain Correction for Power P2 */
968
#define mSET_POFFSET2_LO       (0x021C)       /* Set Power Offset for Power P2 */
969
#define mSET_POFFSET2_HI       (0x021E)       /* Set Power Offset for Power P2 */
970
#define mSET_INTRPTLEVL_LO     (0x0220)       /* Set Interrupt Level */
971
#define mSET_INTRPTLEVL_HI     (0x0222)       /* Set Interrupt Level */
972
#define mSET_CALCYCLCNT        (0x0224)       /* Set number of main cycles for calibration */
973
#define mSET_STARTCURR_FRAC    (0x0226)       /* Set start current fractional Part*/
974
#define mSET_STARTCURR_INT     (0x0228)       /* Set start current integer Part*/
975
#define mSET_NOMFREQ           (0x022A)       /* Set nominal main frequency */
976
#define mSET_VDROPCYCLS        (0x022C)       /* Set cylces for VDrop detection */
977
#define mSET_RATIOTAMP         (0x022E)       /* Set ratio for tamper detection */
978
#define mSET_ITAMP             (0x0230)       /* Set minimum current for tamper detection */
979
#define mSET_VDROPLEVEL        (0x0232)       /* Set level for VDrop detection */
980
#define mSET_VPEAKLEVEL        (0x0234)       /* Set level for VPeak detection */
981
#define mSET_IPEAKLEVEL        (0x0236)       /* Set level for IPeak detection */
982
#define mSET_DCREMPER          (0x0238)       /* Set number of periods for DC-removal */
983
 
984
/* Flags for mSET_CTRL0 */
985
#define CURR_I2                (0x0001)       /* 0: No I2 path, only I1 path is used */
986
                                      /* 1: I2 path implemented (CT, dc-tol CT or shunt) */
987
#define CURR_I1                (0x0002)       /* 0: Current transformer, dc-tol CT or shunt */
988
                                      /* 1: Rogowski coil (not yet implemented) */
989
#define MB                     (0x0004)       /* Intrpt to CPU: 0: energy level  1: #measurements */
990
#define NE0                    (0x0008)       /* Neg. energy treatment:      00: clear neg. energy */
991
#define NE1                    (0x0010)       /* 01: use absolute energy   10: use energy as it is */
992
#define DCREM_V1               (0x0020)       /* DC removal for V1:  0: off  1: on */
993
#define DCREM_I1               (0x0040)       /* DC removal for I1:  0: off  1: on */
994
#define DCREM_I2               (0x0080)       /* DC removal for I2:  0: off  1: on */
995
 
996
/* Messages from ESP */
997
#define mEVENT                 (0x0001)       /* Event Status Flag for ESP430 Software */
998
#define mTEMPRDY               (0x0003)       /* Temperature measurement completed and in MBIN1 */
999
#define mSWRDY                 (0x0005)       /* Software version in MBIN1 */
1000
#define mPARAMRDY              (0x0007)       /* Parameter requested by mREAD_PARAM returned in MBIN1  */
1001
#define mPARAMSET              (0x0009)       /* Parameter has been set */
1002
#define mI2RDY                 (0x000B)       /* I2 value ready */
1003
 
1004
/* EVENT: Event Message Enable Bits */
1005
#define WFSRDYME               (0x0001)       /* New waveform Samples ready */
1006
#define I2GTI1ME               (0x0002)       /* Current I2 greater then I1 */
1007
#define ILREACHEDME            (0x0004)       /* Interrupt level reached */
1008
#define ENRDYME                (0x0008)       /* New Energy values ready */
1009
#define ZXLDME                 (0x0010)       /* Zero Crossing of V1 (leading edge) */
1010
#define ZXTRME                 (0x0020)       /* Zero Crossing of V1 (trailing edge) */
1011
#define CALRDYME               (0x0040)       /* Calibration values ready */
1012
#define TAMPME                 (0x0080)       /* Tampering Occured */
1013
#define NEGENME                (0x0100)       /* Negativ Energy */
1014
#define VDROPME                (0x0200)       /* Voltage drop occured */
1015
#define VPEAKME                (0x0400)       /* Voltage exceed VPeak level */
1016
#define I1PEAKME               (0x0800)       /* Current exceed I1Peak level */
1017
#define I2PEAKME               (0x1000)       /* Current exceed I2Peak level */
1018
//#define RESERVED            (0x8000)  /* Reserved */
1019
//#define RESERVED            (0x8000)  /* Reserved */
1020
#define ACTIVEME               (0x8000)       /* Measurement of Calibration running */
1021
 
1022
/* ESP Modes */
1023
#define modeIDLE               (0x0000)       /* Set Mode: Idle Mode */
1024
#define modeCALIBRATION        (0x0002)       /* Set Mode: Calibration Mode */
1025
#define modeMEASURE            (0x0004)       /* Set Mode: Measure Mode */
1026
#define modeRESET              (0x0006)       /* Set Mode: Reset and Restart the ESP430 module */
1027
#define modeINIT               (0x0008)       /* Set Mode: Initialize ESP430 module */
1028
 
1029
/************************************************************
1030
* Interrupt Vectors (offset from 0xFFE0)
1031
************************************************************/
1032
 
1033
#define VECTOR_NAME(name)       name##_ptr
1034
#define EMIT_PRAGMA(x)          _Pragma(#x)
1035
#define CREATE_VECTOR(name)     void (* const VECTOR_NAME(name))(void) = &name
1036
#define PLACE_VECTOR(vector,section) EMIT_PRAGMA(DATA_SECTION(vector,section))
1037
#define ISR_VECTOR(func,offset) CREATE_VECTOR(func); \
1038
                                PLACE_VECTOR(VECTOR_NAME(func), offset)
1039
 
1040
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1041
#define BASICTIMER_VECTOR       ".int00"                    /* 0xFFE0 Basic Timer */
1042
#else
1043
#define BASICTIMER_VECTOR       (0 * 1u)                     /* 0xFFE0 Basic Timer */
1044
/*#define BASICTIMER_ISR(func)    ISR_VECTOR(func, ".int00")  */ /* 0xFFE0 Basic Timer */ /* CCE V2 Style */
1045
#endif
1046
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1047
#define PORT2_VECTOR            ".int01"                    /* 0xFFE2 Port 2 */
1048
#else
1049
#define PORT2_VECTOR            (1 * 1u)                     /* 0xFFE2 Port 2 */
1050
/*#define PORT2_ISR(func)         ISR_VECTOR(func, ".int01")  */ /* 0xFFE2 Port 2 */ /* CCE V2 Style */
1051
#endif
1052
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1053
#define PORT1_VECTOR            ".int04"                    /* 0xFFE8 Port 1 */
1054
#else
1055
#define PORT1_VECTOR            (4 * 1u)                     /* 0xFFE8 Port 1 */
1056
/*#define PORT1_ISR(func)         ISR_VECTOR(func, ".int04")  */ /* 0xFFE8 Port 1 */ /* CCE V2 Style */
1057
#endif
1058
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1059
#define TIMERA1_VECTOR          ".int05"                    /* 0xFFEA Timer A CC1-2, TA */
1060
#else
1061
#define TIMERA1_VECTOR          (5 * 1u)                     /* 0xFFEA Timer A CC1-2, TA */
1062
/*#define TIMERA1_ISR(func)       ISR_VECTOR(func, ".int05")  */ /* 0xFFEA Timer A CC1-2, TA */ /* CCE V2 Style */
1063
#endif
1064
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1065
#define TIMERA0_VECTOR          ".int06"                    /* 0xFFEC Timer A CC0 */
1066
#else
1067
#define TIMERA0_VECTOR          (6 * 1u)                     /* 0xFFEC Timer A CC0 */
1068
/*#define TIMERA0_ISR(func)       ISR_VECTOR(func, ".int06")  */ /* 0xFFEC Timer A CC0 */ /* CCE V2 Style */
1069
#endif
1070
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1071
#define USART0TX_VECTOR         ".int08"                    /* 0xFFF0 USART 0 Transmit */
1072
#else
1073
#define USART0TX_VECTOR         (8 * 1u)                     /* 0xFFF0 USART 0 Transmit */
1074
/*#define USART0TX_ISR(func)      ISR_VECTOR(func, ".int08")  */ /* 0xFFF0 USART 0 Transmit */ /* CCE V2 Style */
1075
#endif
1076
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1077
#define USART0RX_VECTOR         ".int09"                    /* 0xFFF2 USART 0 Receive */
1078
#else
1079
#define USART0RX_VECTOR         (9 * 1u)                     /* 0xFFF2 USART 0 Receive */
1080
/*#define USART0RX_ISR(func)      ISR_VECTOR(func, ".int09")  */ /* 0xFFF2 USART 0 Receive */ /* CCE V2 Style */
1081
#endif
1082
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1083
#define WDT_VECTOR              ".int10"                    /* 0xFFF4 Watchdog Timer */
1084
#else
1085
#define WDT_VECTOR              (10 * 1u)                    /* 0xFFF4 Watchdog Timer */
1086
/*#define WDT_ISR(func)           ISR_VECTOR(func, ".int10")  */ /* 0xFFF4 Watchdog Timer */ /* CCE V2 Style */
1087
#endif
1088
 
1089
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1090
#define SD16_VECTOR             ".int12"                    /* 0xFFF8 Sigma Delta ADC */
1091
#else
1092
#define SD16_VECTOR             (12 * 1u)                    /* 0xFFF8 Sigma Delta ADC */
1093
/*#define SD16_ISR(func)          ISR_VECTOR(func, ".int12")  */ /* 0xFFF8 Sigma Delta ADC */ /* CCE V2 Style */
1094
#endif
1095
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1096
#define ESP430_VECTOR           ".int13"                    /* 0xFFFA ESP430 Mailbox */
1097
#else
1098
#define ESP430_VECTOR           (13 * 1u)                    /* 0xFFFA ESP430 Mailbox */
1099
/*#define ESP430_ISR(func)        ISR_VECTOR(func, ".int13")  */ /* 0xFFFA ESP430 Mailbox */ /* CCE V2 Style */
1100
#endif
1101
 
1102
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1103
#define NMI_VECTOR              ".int14"                    /* 0xFFFC Non-maskable */
1104
#else
1105
#define NMI_VECTOR              (14 * 1u)                    /* 0xFFFC Non-maskable */
1106
/*#define NMI_ISR(func)           ISR_VECTOR(func, ".int14")  */ /* 0xFFFC Non-maskable */ /* CCE V2 Style */
1107
#endif
1108
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1109
#define RESET_VECTOR            ".reset"                    /* 0xFFFE Reset [Highest Priority] */
1110
#else
1111
#define RESET_VECTOR            (15 * 1u)                    /* 0xFFFE Reset [Highest Priority] */
1112
/*#define RESET_ISR(func)         ISR_VECTOR(func, ".int15")  */ /* 0xFFFE Reset [Highest Priority] */ /* CCE V2 Style */
1113
#endif
1114
 
1115
 
1116
/************************************************************
1117
* End of Modules
1118
************************************************************/
1119
 
1120
#ifdef __cplusplus
1121
}
1122
#endif /* extern "C" */
1123
 
1124
#endif /* #ifndef __msp430xE42x */
1125