Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

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