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
* MSP430x46x devices.
8
*
9
* Texas Instruments, Version 1.0
10
*
11
* Rev. 1.0, Setup
12
*
13
*
14
********************************************************************/
15
 
16
#ifndef __msp430x46x
17
#define __msp430x46x
18
 
19
#ifdef __cplusplus
20
extern "C" {
21
#endif
22
 
23
 
24
/*----------------------------------------------------------------------------*/
25
/* PERIPHERAL FILE MAP                                                        */
26
/*----------------------------------------------------------------------------*/
27
 
28
/* External references resolved by a device-specific linker command file */
29
#define SFR_8BIT(address)   extern volatile unsigned char address
30
#define SFR_16BIT(address)  extern volatile unsigned int address
31
//#define SFR_20BIT(address)  extern volatile unsigned int address
32
typedef void (* __SFR_FARPTR)();
33
#define SFR_20BIT(address) extern __SFR_FARPTR address
34
#define SFR_32BIT(address)  extern volatile unsigned long address
35
 
36
 
37
 
38
/************************************************************
39
* STANDARD BITS
40
************************************************************/
41
 
42
#define BIT0                   (0x0001)
43
#define BIT1                   (0x0002)
44
#define BIT2                   (0x0004)
45
#define BIT3                   (0x0008)
46
#define BIT4                   (0x0010)
47
#define BIT5                   (0x0020)
48
#define BIT6                   (0x0040)
49
#define BIT7                   (0x0080)
50
#define BIT8                   (0x0100)
51
#define BIT9                   (0x0200)
52
#define BITA                   (0x0400)
53
#define BITB                   (0x0800)
54
#define BITC                   (0x1000)
55
#define BITD                   (0x2000)
56
#define BITE                   (0x4000)
57
#define BITF                   (0x8000)
58
 
59
/************************************************************
60
* STATUS REGISTER BITS
61
************************************************************/
62
 
63
#define C                      (0x0001)
64
#define Z                      (0x0002)
65
#define N                      (0x0004)
66
#define V                      (0x0100)
67
#define GIE                    (0x0008)
68
#define CPUOFF                 (0x0010)
69
#define OSCOFF                 (0x0020)
70
#define SCG0                   (0x0040)
71
#define SCG1                   (0x0080)
72
 
73
/* Low Power Modes coded with Bits 4-7 in SR */
74
 
75
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
76
#define LPM0                   (CPUOFF)
77
#define LPM1                   (SCG0+CPUOFF)
78
#define LPM2                   (SCG1+CPUOFF)
79
#define LPM3                   (SCG1+SCG0+CPUOFF)
80
#define LPM4                   (SCG1+SCG0+OSCOFF+CPUOFF)
81
/* End #defines for assembler */
82
 
83
#else /* Begin #defines for C */
84
#define LPM0_bits              (CPUOFF)
85
#define LPM1_bits              (SCG0+CPUOFF)
86
#define LPM2_bits              (SCG1+CPUOFF)
87
#define LPM3_bits              (SCG1+SCG0+CPUOFF)
88
#define LPM4_bits              (SCG1+SCG0+OSCOFF+CPUOFF)
89
 
90
#include "in430.h"
91
 
92
#define LPM0         _bis_SR_register(LPM0_bits)         /* Enter Low Power Mode 0 */
93
#define LPM0_EXIT    _bic_SR_register_on_exit(LPM0_bits) /* Exit Low Power Mode 0 */
94
#define LPM1         _bis_SR_register(LPM1_bits)         /* Enter Low Power Mode 1 */
95
#define LPM1_EXIT    _bic_SR_register_on_exit(LPM1_bits) /* Exit Low Power Mode 1 */
96
#define LPM2         _bis_SR_register(LPM2_bits)         /* Enter Low Power Mode 2 */
97
#define LPM2_EXIT    _bic_SR_register_on_exit(LPM2_bits) /* Exit Low Power Mode 2 */
98
#define LPM3         _bis_SR_register(LPM3_bits)         /* Enter Low Power Mode 3 */
99
#define LPM3_EXIT    _bic_SR_register_on_exit(LPM3_bits) /* Exit Low Power Mode 3 */
100
#define LPM4         _bis_SR_register(LPM4_bits)         /* Enter Low Power Mode 4 */
101
#define LPM4_EXIT    _bic_SR_register_on_exit(LPM4_bits) /* Exit Low Power Mode 4 */
102
#endif /* End #defines for C */
103
 
104
/************************************************************
105
* CPU
106
************************************************************/
107
#define __MSP430_HAS_MSP430X_CPU__                /* Definition to show that it has MSP430X CPU */
108
 
109
/************************************************************
110
* PERIPHERAL FILE MAP
111
************************************************************/
112
 
113
/************************************************************
114
* SPECIAL FUNCTION REGISTER ADDRESSES + CONTROL BITS
115
************************************************************/
116
 
117
SFR_8BIT(IE1);                                /* Interrupt Enable 1 */
118
#define WDTIE                  (0x01)
119
#define OFIE                   (0x02)
120
#define NMIIE                  (0x10)
121
#define ACCVIE                 (0x20)
122
 
123
SFR_8BIT(IFG1);                               /* Interrupt Flag 1 */
124
#define WDTIFG                 (0x01)
125
#define OFIFG                  (0x02)
126
#define NMIIFG                 (0x10)
127
 
128
SFR_8BIT(IE2);                                /* Interrupt Enable 2 */
129
#define U1IE                   IE2            /* UART1 Interrupt Enable Register */
130
#define UC0IE                  IE2
131
#define UCA0RXIE               (0x01)
132
#define UCA0TXIE               (0x02)
133
#define UCB0RXIE               (0x04)
134
#define UCB0TXIE               (0x08)
135
#define URXIE1                 (0x10)
136
#define UTXIE1                 (0x20)
137
#define BTIE                   (0x80)
138
 
139
SFR_8BIT(IFG2);                               /* Interrupt Flag 2 */
140
#define U1IFG                  IFG2           /* UART1 Interrupt Flag Register */
141
#define UC0IFG                 IFG2
142
#define UCA0RXIFG              (0x01)
143
#define UCA0TXIFG              (0x02)
144
#define UCB0RXIFG              (0x04)
145
#define UCB0TXIFG              (0x08)
146
#define URXIFG1                (0x10)
147
#define UTXIFG1                (0x20)
148
#define BTIFG                  (0x80)
149
 
150
SFR_8BIT(ME2);                                /* Module Enable 2 */
151
#define U1ME                   ME2            /* UART1 Module Enable Register */
152
#define URXE1                  (0x10)
153
#define UTXE1                  (0x20)
154
#define USPIE1                 (0x10)
155
 
156
/************************************************************
157
* ADC12
158
************************************************************/
159
#define __MSP430_HAS_ADC12__                  /* Definition to show that Module is available */
160
 
161
SFR_16BIT(ADC12CTL0);                         /* ADC12 Control 0 */
162
SFR_16BIT(ADC12CTL1);                         /* ADC12 Control 1 */
163
SFR_16BIT(ADC12IFG);                          /* ADC12 Interrupt Flag */
164
SFR_16BIT(ADC12IE);                           /* ADC12 Interrupt Enable */
165
SFR_16BIT(ADC12IV);                           /* ADC12 Interrupt Vector Word */
166
 
167
#define ADC12MEM_              (0x0140)       /* ADC12 Conversion Memory */
168
#ifdef __ASM_HEADER__
169
#define ADC12MEM               (ADC12MEM_)    /* ADC12 Conversion Memory (for assembler) */
170
#else
171
#define ADC12MEM               ((int*)        ADC12MEM_) /* ADC12 Conversion Memory (for C) */
172
#endif
173
SFR_16BIT(ADC12MEM0);                         /* ADC12 Conversion Memory 0 */
174
SFR_16BIT(ADC12MEM1);                         /* ADC12 Conversion Memory 1 */
175
SFR_16BIT(ADC12MEM2);                         /* ADC12 Conversion Memory 2 */
176
SFR_16BIT(ADC12MEM3);                         /* ADC12 Conversion Memory 3 */
177
SFR_16BIT(ADC12MEM4);                         /* ADC12 Conversion Memory 4 */
178
SFR_16BIT(ADC12MEM5);                         /* ADC12 Conversion Memory 5 */
179
SFR_16BIT(ADC12MEM6);                         /* ADC12 Conversion Memory 6 */
180
SFR_16BIT(ADC12MEM7);                         /* ADC12 Conversion Memory 7 */
181
SFR_16BIT(ADC12MEM8);                         /* ADC12 Conversion Memory 8 */
182
SFR_16BIT(ADC12MEM9);                         /* ADC12 Conversion Memory 9 */
183
SFR_16BIT(ADC12MEM10);                        /* ADC12 Conversion Memory 10 */
184
SFR_16BIT(ADC12MEM11);                        /* ADC12 Conversion Memory 11 */
185
SFR_16BIT(ADC12MEM12);                        /* ADC12 Conversion Memory 12 */
186
SFR_16BIT(ADC12MEM13);                        /* ADC12 Conversion Memory 13 */
187
SFR_16BIT(ADC12MEM14);                        /* ADC12 Conversion Memory 14 */
188
SFR_16BIT(ADC12MEM15);                        /* ADC12 Conversion Memory 15 */
189
 
190
#define ADC12MCTL_             (0x0080)       /* ADC12 Memory Control */
191
#ifdef __ASM_HEADER__
192
#define ADC12MCTL              (ADC12MCTL_)   /* ADC12 Memory Control (for assembler) */
193
#else
194
#define ADC12MCTL              ((char*)       ADC12MCTL_) /* ADC12 Memory Control (for C) */
195
#endif
196
SFR_8BIT(ADC12MCTL0);                         /* ADC12 Memory Control 0 */
197
SFR_8BIT(ADC12MCTL1);                         /* ADC12 Memory Control 1 */
198
SFR_8BIT(ADC12MCTL2);                         /* ADC12 Memory Control 2 */
199
SFR_8BIT(ADC12MCTL3);                         /* ADC12 Memory Control 3 */
200
SFR_8BIT(ADC12MCTL4);                         /* ADC12 Memory Control 4 */
201
SFR_8BIT(ADC12MCTL5);                         /* ADC12 Memory Control 5 */
202
SFR_8BIT(ADC12MCTL6);                         /* ADC12 Memory Control 6 */
203
SFR_8BIT(ADC12MCTL7);                         /* ADC12 Memory Control 7 */
204
SFR_8BIT(ADC12MCTL8);                         /* ADC12 Memory Control 8 */
205
SFR_8BIT(ADC12MCTL9);                         /* ADC12 Memory Control 9 */
206
SFR_8BIT(ADC12MCTL10);                        /* ADC12 Memory Control 10 */
207
SFR_8BIT(ADC12MCTL11);                        /* ADC12 Memory Control 11 */
208
SFR_8BIT(ADC12MCTL12);                        /* ADC12 Memory Control 12 */
209
SFR_8BIT(ADC12MCTL13);                        /* ADC12 Memory Control 13 */
210
SFR_8BIT(ADC12MCTL14);                        /* ADC12 Memory Control 14 */
211
SFR_8BIT(ADC12MCTL15);                        /* ADC12 Memory Control 15 */
212
 
213
/* ADC12CTL0 */
214
#define ADC12SC                (0x001)        /* ADC12 Start Conversion */
215
#define ENC                    (0x002)        /* ADC12 Enable Conversion */
216
#define ADC12TOVIE             (0x004)        /* ADC12 Timer Overflow interrupt enable */
217
#define ADC12OVIE              (0x008)        /* ADC12 Overflow interrupt enable */
218
#define ADC12ON                (0x010)        /* ADC12 On/enable */
219
#define REFON                  (0x020)        /* ADC12 Reference on */
220
#define REF2_5V                (0x040)        /* ADC12 Ref 0:1.5V / 1:2.5V */
221
#define MSC                    (0x080)        /* ADC12 Multiple SampleConversion */
222
#define SHT00                  (0x0100)       /* ADC12 Sample Hold 0 Select 0 */
223
#define SHT01                  (0x0200)       /* ADC12 Sample Hold 0 Select 1 */
224
#define SHT02                  (0x0400)       /* ADC12 Sample Hold 0 Select 2 */
225
#define SHT03                  (0x0800)       /* ADC12 Sample Hold 0 Select 3 */
226
#define SHT10                  (0x1000)       /* ADC12 Sample Hold 0 Select 0 */
227
#define SHT11                  (0x2000)       /* ADC12 Sample Hold 1 Select 1 */
228
#define SHT12                  (0x4000)       /* ADC12 Sample Hold 2 Select 2 */
229
#define SHT13                  (0x8000)       /* ADC12 Sample Hold 3 Select 3 */
230
#define MSH                    (0x080)
231
 
232
#define SHT0_0                 (0*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 0 */
233
#define SHT0_1                 (1*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 1 */
234
#define SHT0_2                 (2*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 2 */
235
#define SHT0_3                 (3*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 3 */
236
#define SHT0_4                 (4*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 4 */
237
#define SHT0_5                 (5*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 5 */
238
#define SHT0_6                 (6*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 6 */
239
#define SHT0_7                 (7*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 7 */
240
#define SHT0_8                 (8*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 8 */
241
#define SHT0_9                 (9*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 9 */
242
#define SHT0_10                (10*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 10 */
243
#define SHT0_11                (11*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 11 */
244
#define SHT0_12                (12*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 12 */
245
#define SHT0_13                (13*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 13 */
246
#define SHT0_14                (14*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 14 */
247
#define SHT0_15                (15*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 15 */
248
 
249
#define SHT1_0                 (0*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 0 */
250
#define SHT1_1                 (1*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 1 */
251
#define SHT1_2                 (2*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 2 */
252
#define SHT1_3                 (3*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 3 */
253
#define SHT1_4                 (4*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 4 */
254
#define SHT1_5                 (5*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 5 */
255
#define SHT1_6                 (6*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 6 */
256
#define SHT1_7                 (7*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 7 */
257
#define SHT1_8                 (8*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 8 */
258
#define SHT1_9                 (9*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 9 */
259
#define SHT1_10                (10*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 10 */
260
#define SHT1_11                (11*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 11 */
261
#define SHT1_12                (12*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 12 */
262
#define SHT1_13                (13*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 13 */
263
#define SHT1_14                (14*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 14 */
264
#define SHT1_15                (15*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 15 */
265
 
266
/* ADC12CTL1 */
267
#define ADC12BUSY              (0x0001)       /* ADC12 Busy */
268
#define CONSEQ0                (0x0002)       /* ADC12 Conversion Sequence Select 0 */
269
#define CONSEQ1                (0x0004)       /* ADC12 Conversion Sequence Select 1 */
270
#define ADC12SSEL0             (0x0008)       /* ADC12 Clock Source Select 0 */
271
#define ADC12SSEL1             (0x0010)       /* ADC12 Clock Source Select 1 */
272
#define ADC12DIV0              (0x0020)       /* ADC12 Clock Divider Select 0 */
273
#define ADC12DIV1              (0x0040)       /* ADC12 Clock Divider Select 1 */
274
#define ADC12DIV2              (0x0080)       /* ADC12 Clock Divider Select 2 */
275
#define ISSH                   (0x0100)       /* ADC12 Invert Sample Hold Signal */
276
#define SHP                    (0x0200)       /* ADC12 Sample/Hold Pulse Mode */
277
#define SHS0                   (0x0400)       /* ADC12 Sample/Hold Source 0 */
278
#define SHS1                   (0x0800)       /* ADC12 Sample/Hold Source 1 */
279
#define CSTARTADD0             (0x1000)       /* ADC12 Conversion Start Address 0 */
280
#define CSTARTADD1             (0x2000)       /* ADC12 Conversion Start Address 1 */
281
#define CSTARTADD2             (0x4000)       /* ADC12 Conversion Start Address 2 */
282
#define CSTARTADD3             (0x8000)       /* ADC12 Conversion Start Address 3 */
283
 
284
#define CONSEQ_0               (0*2u)         /* ADC12 Conversion Sequence Select: 0 */
285
#define CONSEQ_1               (1*2u)         /* ADC12 Conversion Sequence Select: 1 */
286
#define CONSEQ_2               (2*2u)         /* ADC12 Conversion Sequence Select: 2 */
287
#define CONSEQ_3               (3*2u)         /* ADC12 Conversion Sequence Select: 3 */
288
#define ADC12SSEL_0            (0*8u)         /* ADC12 Clock Source Select: 0 */
289
#define ADC12SSEL_1            (1*8u)         /* ADC12 Clock Source Select: 1 */
290
#define ADC12SSEL_2            (2*8u)         /* ADC12 Clock Source Select: 2 */
291
#define ADC12SSEL_3            (3*8u)         /* ADC12 Clock Source Select: 3 */
292
#define ADC12DIV_0             (0*0x20u)      /* ADC12 Clock Divider Select: 0 */
293
#define ADC12DIV_1             (1*0x20u)      /* ADC12 Clock Divider Select: 1 */
294
#define ADC12DIV_2             (2*0x20u)      /* ADC12 Clock Divider Select: 2 */
295
#define ADC12DIV_3             (3*0x20u)      /* ADC12 Clock Divider Select: 3 */
296
#define ADC12DIV_4             (4*0x20u)      /* ADC12 Clock Divider Select: 4 */
297
#define ADC12DIV_5             (5*0x20u)      /* ADC12 Clock Divider Select: 5 */
298
#define ADC12DIV_6             (6*0x20u)      /* ADC12 Clock Divider Select: 6 */
299
#define ADC12DIV_7             (7*0x20u)      /* ADC12 Clock Divider Select: 7 */
300
#define SHS_0                  (0*0x400u)     /* ADC12 Sample/Hold Source: 0 */
301
#define SHS_1                  (1*0x400u)     /* ADC12 Sample/Hold Source: 1 */
302
#define SHS_2                  (2*0x400u)     /* ADC12 Sample/Hold Source: 2 */
303
#define SHS_3                  (3*0x400u)     /* ADC12 Sample/Hold Source: 3 */
304
#define CSTARTADD_0            (0*0x1000u)    /* ADC12 Conversion Start Address: 0 */
305
#define CSTARTADD_1            (1*0x1000u)    /* ADC12 Conversion Start Address: 1 */
306
#define CSTARTADD_2            (2*0x1000u)    /* ADC12 Conversion Start Address: 2 */
307
#define CSTARTADD_3            (3*0x1000u)    /* ADC12 Conversion Start Address: 3 */
308
#define CSTARTADD_4            (4*0x1000u)    /* ADC12 Conversion Start Address: 4 */
309
#define CSTARTADD_5            (5*0x1000u)    /* ADC12 Conversion Start Address: 5 */
310
#define CSTARTADD_6            (6*0x1000u)    /* ADC12 Conversion Start Address: 6 */
311
#define CSTARTADD_7            (7*0x1000u)    /* ADC12 Conversion Start Address: 7 */
312
#define CSTARTADD_8            (8*0x1000u)    /* ADC12 Conversion Start Address: 8 */
313
#define CSTARTADD_9            (9*0x1000u)    /* ADC12 Conversion Start Address: 9 */
314
#define CSTARTADD_10           (10*0x1000u)   /* ADC12 Conversion Start Address: 10 */
315
#define CSTARTADD_11           (11*0x1000u)   /* ADC12 Conversion Start Address: 11 */
316
#define CSTARTADD_12           (12*0x1000u)   /* ADC12 Conversion Start Address: 12 */
317
#define CSTARTADD_13           (13*0x1000u)   /* ADC12 Conversion Start Address: 13 */
318
#define CSTARTADD_14           (14*0x1000u)   /* ADC12 Conversion Start Address: 14 */
319
#define CSTARTADD_15           (15*0x1000u)   /* ADC12 Conversion Start Address: 15 */
320
 
321
/* ADC12MCTLx */
322
#define INCH0                  (0x0001)       /* ADC12 Input Channel Select Bit 0 */
323
#define INCH1                  (0x0002)       /* ADC12 Input Channel Select Bit 1 */
324
#define INCH2                  (0x0004)       /* ADC12 Input Channel Select Bit 2 */
325
#define INCH3                  (0x0008)       /* ADC12 Input Channel Select Bit 3 */
326
#define SREF0                  (0x0010)       /* ADC12 Select Reference Bit 0 */
327
#define SREF1                  (0x0020)       /* ADC12 Select Reference Bit 1 */
328
#define SREF2                  (0x0040)       /* ADC12 Select Reference Bit 2 */
329
#define EOS                    (0x0080)       /* ADC12 End of Sequence */
330
 
331
#define INCH_0                 (0)            /* ADC12 Input Channel 0 */
332
#define INCH_1                 (1)            /* ADC12 Input Channel 1 */
333
#define INCH_2                 (2)            /* ADC12 Input Channel 2 */
334
#define INCH_3                 (3)            /* ADC12 Input Channel 3 */
335
#define INCH_4                 (4)            /* ADC12 Input Channel 4 */
336
#define INCH_5                 (5)            /* ADC12 Input Channel 5 */
337
#define INCH_6                 (6)            /* ADC12 Input Channel 6 */
338
#define INCH_7                 (7)            /* ADC12 Input Channel 7 */
339
#define INCH_8                 (8)            /* ADC12 Input Channel 8 */
340
#define INCH_9                 (9)            /* ADC12 Input Channel 9 */
341
#define INCH_10                (10)           /* ADC12 Input Channel 10 */
342
#define INCH_11                (11)           /* ADC12 Input Channel 11 */
343
#define INCH_12                (12)           /* ADC12 Input Channel 12 */
344
#define INCH_13                (13)           /* ADC12 Input Channel 13 */
345
#define INCH_14                (14)           /* ADC12 Input Channel 14 */
346
#define INCH_15                (15)           /* ADC12 Input Channel 15 */
347
 
348
#define SREF_0                 (0*0x10u)      /* ADC12 Select Reference 0 */
349
#define SREF_1                 (1*0x10u)      /* ADC12 Select Reference 1 */
350
#define SREF_2                 (2*0x10u)      /* ADC12 Select Reference 2 */
351
#define SREF_3                 (3*0x10u)      /* ADC12 Select Reference 3 */
352
#define SREF_4                 (4*0x10u)      /* ADC12 Select Reference 4 */
353
#define SREF_5                 (5*0x10u)      /* ADC12 Select Reference 5 */
354
#define SREF_6                 (6*0x10u)      /* ADC12 Select Reference 6 */
355
#define SREF_7                 (7*0x10u)      /* ADC12 Select Reference 7 */
356
 
357
/* ADC12IV Definitions */
358
#define ADC12IV_NONE           (0x0000)       /* No Interrupt pending */
359
#define ADC12IV_ADC12OVIFG     (0x0002)       /* ADC12OVIFG */
360
#define ADC12IV_ADC12TOVIFG    (0x0004)       /* ADC12TOVIFG */
361
#define ADC12IV_ADC12IFG0      (0x0006)       /* ADC12IFG0 */
362
#define ADC12IV_ADC12IFG1      (0x0008)       /* ADC12IFG1 */
363
#define ADC12IV_ADC12IFG2      (0x000A)       /* ADC12IFG2 */
364
#define ADC12IV_ADC12IFG3      (0x000C)       /* ADC12IFG3 */
365
#define ADC12IV_ADC12IFG4      (0x000E)       /* ADC12IFG4 */
366
#define ADC12IV_ADC12IFG5      (0x0010)       /* ADC12IFG5 */
367
#define ADC12IV_ADC12IFG6      (0x0012)       /* ADC12IFG6 */
368
#define ADC12IV_ADC12IFG7      (0x0014)       /* ADC12IFG7 */
369
#define ADC12IV_ADC12IFG8      (0x0016)       /* ADC12IFG8 */
370
#define ADC12IV_ADC12IFG9      (0x0018)       /* ADC12IFG9 */
371
#define ADC12IV_ADC12IFG10     (0x001A)       /* ADC12IFG10 */
372
#define ADC12IV_ADC12IFG11     (0x001C)       /* ADC12IFG11 */
373
#define ADC12IV_ADC12IFG12     (0x001E)       /* ADC12IFG12 */
374
#define ADC12IV_ADC12IFG13     (0x0020)       /* ADC12IFG13 */
375
#define ADC12IV_ADC12IFG14     (0x0022)       /* ADC12IFG14 */
376
#define ADC12IV_ADC12IFG15     (0x0024)       /* ADC12IFG15 */
377
 
378
/************************************************************
379
* BASIC TIMER with Real Time Clock
380
************************************************************/
381
#define __MSP430_HAS_BT_RTC__                 /* Definition to show that Module is available */
382
 
383
SFR_8BIT(BTCTL);                              /* Basic Timer Control */
384
SFR_8BIT(RTCCTL);                             /* Real Time Clock Control */
385
SFR_8BIT(RTCNT1);                             /* Real Time Counter 1 */
386
SFR_8BIT(RTCNT2);                             /* Real Time Counter 2 */
387
SFR_8BIT(RTCNT3);                             /* Real Time Counter 3 */
388
SFR_8BIT(RTCNT4);                             /* Real Time Counter 4 */
389
SFR_8BIT(BTCNT1);                             /* Basic Timer Count 1 */
390
SFR_8BIT(BTCNT2);                             /* Basic Timer Count 2 */
391
SFR_8BIT(RTCDAY);                             /* Real Time Clock Day */
392
SFR_8BIT(RTCMON);                             /* Real Time Clock Month */
393
SFR_8BIT(RTCYEARL);                           /* Real Time Clock Year (Low Byte) */
394
SFR_8BIT(RTCYEARH);                           /* Real Time Clock Year (High Byte) */
395
#define RTCSEC                 RTCNT1
396
#define RTCMIN                 RTCNT2
397
#define RTCHOUR                RTCNT3
398
#define RTCDOW                 RTCNT4
399
 
400
SFR_16BIT(RTCTL);                             /* Basic/Real Timer Control */
401
SFR_16BIT(RTCTIM0);                           /* Real Time Clock Time 0 */
402
SFR_16BIT(RTCTIM1);                           /* Real Time Clock Time 1 */
403
SFR_16BIT(BTCNT12);                           /* Basic Timer Count 1/2 */
404
SFR_16BIT(RTCDATE);                           /* Real Time Clock Date */
405
SFR_16BIT(RTCYEAR);                           /* Real Time Clock Year */
406
#define RTCNT12                RTCTIM0
407
#define RTCNT34                RTCTIM1
408
 
409
#define BTSSEL                 (0x80)         /* fBT = fMCLK (main clock) */
410
#define BTHOLD                 (0x40)         /* BT1 is held if this bit is set */
411
#define BTDIV                  (0x20)         /* fCLK2 = ACLK:256 */
412
//#define res               (0x10)
413
//#define res               (0x08)
414
#define BTIP2                  (0x04)
415
#define BTIP1                  (0x02)
416
#define BTIP0                  (0x01)
417
 
418
#define RTCBCD                 (0x80)         /* RTC BCD Select */
419
#define RTCHOLD                (0x40)         /* RTC Hold */
420
#define RTCMODE1               (0x20)         /* RTC Mode 1 */
421
#define RTCMODE0               (0x10)         /* RTC Mode 0 */
422
#define RTCTEV1                (0x08)         /* RTC Time Event 1 */
423
#define RTCTEV0                (0x04)         /* RTC Time Event 0 */
424
#define RTCIE                  (0x02)         /* RTC Interrupt Enable */
425
#define RTCFG                  (0x01)         /* RTC Event Flag */
426
 
427
#define RTCTEV_0               (0x00)         /* RTC Time Event: 0 */
428
#define RTCTEV_1               (0x04)         /* RTC Time Event: 1 */
429
#define RTCTEV_2               (0x08)         /* RTC Time Event: 2 */
430
#define RTCTEV_3               (0x0C)         /* RTC Time Event: 3 */
431
#define RTCMODE_0              (0x00)         /* RTC Mode: 0 */
432
#define RTCMODE_1              (0x10)         /* RTC Mode: 1 */
433
#define RTCMODE_2              (0x20)         /* RTC Mode: 2 */
434
#define RTCMODE_3              (0x30)         /* RTC Mode: 3 */
435
 
436
/* Frequency of the BTCNT2 coded with Bit 5 and 7 in BTCTL */
437
#define BT_fCLK2_ACLK          (0x00)
438
#define BT_fCLK2_ACLK_DIV256   (BTDIV)
439
#define BT_fCLK2_MCLK          (BTSSEL)
440
 
441
/* Interrupt interval time fINT coded with Bits 0-2 in BTCTL */
442
#define BT_fCLK2_DIV2          (0x00)         /* fINT = fCLK2:2 (default) */
443
#define BT_fCLK2_DIV4          (BTIP0)        /* fINT = fCLK2:4 */
444
#define BT_fCLK2_DIV8          (BTIP1)        /* fINT = fCLK2:8 */
445
#define BT_fCLK2_DIV16         (BTIP1+BTIP0)  /* fINT = fCLK2:16 */
446
#define BT_fCLK2_DIV32         (BTIP2)        /* fINT = fCLK2:32 */
447
#define BT_fCLK2_DIV64         (BTIP2+BTIP0)  /* fINT = fCLK2:64 */
448
#define BT_fCLK2_DIV128        (BTIP2+BTIP1)  /* fINT = fCLK2:128 */
449
#define BT_fCLK2_DIV256     (BTIP2+BTIP1+BTIP0)       /* fINT = fCLK2:256 */
450
 
451
/* with assumed vlues of fACLK=32KHz, fMCLK=1MHz */
452
/* fBT=fACLK is thought for longer interval times */
453
#define BT_ADLY_0_064          (0x00)         /* 0.064ms interval (default) */
454
#define BT_ADLY_0_125          (BTIP0)        /* 0.125ms    " */
455
#define BT_ADLY_0_25           (BTIP1)        /* 0.25ms     " */
456
#define BT_ADLY_0_5            (BTIP1+BTIP0)  /* 0.5ms      " */
457
#define BT_ADLY_1              (BTIP2)        /* 1ms        " */
458
#define BT_ADLY_2              (BTIP2+BTIP0)  /* 2ms        " */
459
#define BT_ADLY_4              (BTIP2+BTIP1)  /* 4ms        " */
460
#define BT_ADLY_8           (BTIP2+BTIP1+BTIP0)       /* 8ms        " */
461
#define BT_ADLY_16             (BTDIV)        /* 16ms       " */
462
#define BT_ADLY_32             (BTDIV+BTIP0)  /* 32ms       " */
463
#define BT_ADLY_64             (BTDIV+BTIP1)  /* 64ms       " */
464
#define BT_ADLY_125         (BTDIV+BTIP1+BTIP0)       /* 125ms      " */
465
#define BT_ADLY_250            (BTDIV+BTIP2)  /* 250ms      " */
466
#define BT_ADLY_500         (BTDIV+BTIP2+BTIP0)       /* 500ms      " */
467
#define BT_ADLY_1000        (BTDIV+BTIP2+BTIP1)       /* 1000ms     " */
468
#define BT_ADLY_2000        (BTDIV+BTIP2+BTIP1+BTIP0) /* 2000ms     " */
469
/* fCLK2=fMCLK (1MHz) is thought for short interval times */
470
/* the timing for short intervals is more precise than ACLK */
471
/* NOTE */
472
/* Be sure that the SCFQCTL-Register is set to 01Fh so that fMCLK=1MHz */
473
/* Too low interval time results in interrupts too frequent for the processor to handle! */
474
#define BT_MDLY_0_002          (BTSSEL)       /* 0.002ms interval       *** interval times */
475
#define BT_MDLY_0_004          (BTSSEL+BTIP0) /* 0.004ms    "           *** too short for */
476
#define BT_MDLY_0_008          (BTSSEL+BTIP1) /* 0.008ms    "           *** interrupt */
477
#define BT_MDLY_0_016       (BTSSEL+BTIP1+BTIP0)      /* 0.016ms    "           *** handling */
478
#define BT_MDLY_0_032          (BTSSEL+BTIP2) /* 0.032ms    " */
479
#define BT_MDLY_0_064       (BTSSEL+BTIP2+BTIP0)      /* 0.064ms    " */
480
#define BT_MDLY_0_125       (BTSSEL+BTIP2+BTIP1)      /* 0.125ms    " */
481
#define BT_MDLY_0_25        (BTSSEL+BTIP2+BTIP1+BTIP0)/* 0.25ms     " */
482
 
483
/* Hold coded with Bits 6-7 in BT(1)CTL */
484
/* this is for BT */
485
#define BTHOLD_CNT1            (BTHOLD)       /* BTCNT1 is held while BTHOLD is set */
486
#define BTHOLD_CNT1_2          (BTHOLD+BTDIV) /* BT1CNT1 .AND. BT1CNT2 are held while ~ is set */
487
 
488
/* INTERRUPT CONTROL BITS */
489
/* #define BTIE                0x80 */
490
/* #define BTIFG               0x80 */
491
 
492
/************************************************************
493
* Comparator A
494
************************************************************/
495
#define __MSP430_HAS_COMPA__                  /* Definition to show that Module is available */
496
 
497
SFR_8BIT(CACTL1);                             /* Comparator A Control 1 */
498
SFR_8BIT(CACTL2);                             /* Comparator A Control 2 */
499
SFR_8BIT(CAPD);                               /* Comparator A Port Disable */
500
 
501
#define CAIFG                  (0x01)         /* Comp. A Interrupt Flag */
502
#define CAIE                   (0x02)         /* Comp. A Interrupt Enable */
503
#define CAIES                  (0x04)         /* Comp. A Int. Edge Select: 0:rising / 1:falling */
504
#define CAON                   (0x08)         /* Comp. A enable */
505
#define CAREF0                 (0x10)         /* Comp. A Internal Reference Select 0 */
506
#define CAREF1                 (0x20)         /* Comp. A Internal Reference Select 1 */
507
#define CARSEL                 (0x40)         /* Comp. A Internal Reference Enable */
508
#define CAEX                   (0x80)         /* Comp. A Exchange Inputs */
509
 
510
#define CAREF_0                (0x00)         /* Comp. A Int. Ref. Select 0 : Off */
511
#define CAREF_1                (0x10)         /* Comp. A Int. Ref. Select 1 : 0.25*Vcc */
512
#define CAREF_2                (0x20)         /* Comp. A Int. Ref. Select 2 : 0.5*Vcc */
513
#define CAREF_3                (0x30)         /* Comp. A Int. Ref. Select 3 : Vt*/
514
 
515
#define CAOUT                  (0x01)         /* Comp. A Output */
516
#define CAF                    (0x02)         /* Comp. A Enable Output Filter */
517
#define P2CA0                  (0x04)         /* Comp. A Connect External Signal to CA0 : 1 */
518
#define P2CA1                  (0x08)         /* Comp. A Connect External Signal to CA1 : 1 */
519
#define CACTL24                (0x10)
520
#define CACTL25                (0x20)
521
#define CACTL26                (0x40)
522
#define CACTL27                (0x80)
523
 
524
#define CAPD0                  (0x01)         /* Comp. A Disable Input Buffer of Port Register .0 */
525
#define CAPD1                  (0x02)         /* Comp. A Disable Input Buffer of Port Register .1 */
526
#define CAPD2                  (0x04)         /* Comp. A Disable Input Buffer of Port Register .2 */
527
#define CAPD3                  (0x08)         /* Comp. A Disable Input Buffer of Port Register .3 */
528
#define CAPD4                  (0x10)         /* Comp. A Disable Input Buffer of Port Register .4 */
529
#define CAPD5                  (0x20)         /* Comp. A Disable Input Buffer of Port Register .5 */
530
#define CAPD6                  (0x40)         /* Comp. A Disable Input Buffer of Port Register .6 */
531
#define CAPD7                  (0x80)         /* Comp. A Disable Input Buffer of Port Register .7 */
532
 
533
/************************************************************
534
* DMA_X
535
************************************************************/
536
#define __MSP430_HAS_DMAX_3__                 /* Definition to show that Module is available */
537
 
538
SFR_16BIT(DMACTL0);                           /* DMA Module Control 0 */
539
#define DMA0TSEL0              (0x0001)       /* DMA channel 0 transfer select bit 0 */
540
#define DMA0TSEL1              (0x0002)       /* DMA channel 0 transfer select bit 1 */
541
#define DMA0TSEL2              (0x0004)       /* DMA channel 0 transfer select bit 2 */
542
#define DMA0TSEL3              (0x0008)       /* DMA channel 0 transfer select bit 3 */
543
#define DMA1TSEL0              (0x0010)       /* DMA channel 1 transfer select bit 0 */
544
#define DMA1TSEL1              (0x0020)       /* DMA channel 1 transfer select bit 1 */
545
#define DMA1TSEL2              (0x0040)       /* DMA channel 1 transfer select bit 2 */
546
#define DMA1TSEL3              (0x0080)       /* DMA channel 1 transfer select bit 3 */
547
#define DMA2TSEL0              (0x0100)       /* DMA channel 2 transfer select bit 0 */
548
#define DMA2TSEL1              (0x0200)       /* DMA channel 2 transfer select bit 1 */
549
#define DMA2TSEL2              (0x0400)       /* DMA channel 2 transfer select bit 2 */
550
#define DMA2TSEL3              (0x0800)       /* DMA channel 2 transfer select bit 3 */
551
 
552
#define DMA0TSEL_0             (0*0x0001u)    /* DMA channel 0 transfer select 0:  DMA_REQ (sw)*/
553
#define DMA0TSEL_1             (1*0x0001u)    /* DMA channel 0 transfer select 1:  Timer_A (TACCR2.IFG) */
554
#define DMA0TSEL_2             (2*0x0001u)    /* DMA channel 0 transfer select 2:  Timer_B (TBCCR2.IFG) */
555
#define DMA0TSEL_3             (3*0x0001u)    /* DMA channel 0 transfer select 3:  USCIA receive */
556
#define DMA0TSEL_4             (4*0x0001u)    /* DMA channel 0 transfer select 4:  USCIA transmit */
557
#define DMA0TSEL_5             (5*0x0001u)    /* DMA channel 0 transfer select 5:  DAC12_0CTL.DAC12IFG */
558
#define DMA0TSEL_6             (6*0x0001u)    /* DMA channel 0 transfer select 6:  ADC12 (ADC12IFG) */
559
#define DMA0TSEL_7             (7*0x0001u)    /* DMA channel 0 transfer select 7:  Timer_A (TACCR0.IFG) */
560
#define DMA0TSEL_8             (8*0x0001u)    /* DMA channel 0 transfer select 8:  Timer_B (TBCCR0.IFG) */
561
#define DMA0TSEL_9             (9*0x0001u)    /* DMA channel 0 transfer select 9:  UART1 receive */
562
#define DMA0TSEL_10            (10*0x0001u)   /* DMA channel 0 transfer select 10: UART1 transmit */
563
#define DMA0TSEL_11            (11*0x0001u)   /* DMA channel 0 transfer select 11: Multiplier ready */
564
#define DMA0TSEL_12            (12*0x0001u)   /* DMA channel 0 transfer select 12: USCIB receive */
565
#define DMA0TSEL_13            (13*0x0001u)   /* DMA channel 0 transfer select 13: USCIB transmit */
566
#define DMA0TSEL_14            (14*0x0001u)   /* DMA channel 0 transfer select 14: previous DMA channel DMA2IFG */
567
#define DMA0TSEL_15            (15*0x0001u)   /* DMA channel 0 transfer select 15: ext. Trigger (DMAE0) */
568
 
569
#define DMA1TSEL_0             (0*0x0010u)    /* DMA channel 1 transfer select 0:  DMA_REQ */
570
#define DMA1TSEL_1             (1*0x0010u)    /* DMA channel 1 transfer select 1:  Timer_A CCRIFG.2 */
571
#define DMA1TSEL_2             (2*0x0010u)    /* DMA channel 1 transfer select 2:  Timer_B CCRIFG.2 */
572
#define DMA1TSEL_3             (3*0x0010u)    /* DMA channel 1 transfer select 3:  USCIA receive */
573
#define DMA1TSEL_4             (4*0x0010u)    /* DMA channel 1 transfer select 4:  USCIA transmit */
574
#define DMA1TSEL_5             (5*0x0010u)    /* DMA channel 1 transfer select 5:  DAC12.0IFG */
575
#define DMA1TSEL_6             (6*0x0010u)    /* DMA channel 1 transfer select 6:  ADC12 (ADC12IFG) */
576
#define DMA1TSEL_7             (7*0x0010u)    /* DMA channel 1 transfer select 7:  Timer_A (TACCR0.IFG) */
577
#define DMA1TSEL_8             (8*0x0010u)    /* DMA channel 1 transfer select 8:  Timer_B (TBCCR0.IFG) */
578
#define DMA1TSEL_9             (9*0x0010u)    /* DMA channel 1 transfer select 9:  UART1 receive */
579
#define DMA1TSEL_10            (10*0x0010u)   /* DMA channel 1 transfer select 10: UART1 transmit */
580
#define DMA1TSEL_11            (11*0x0010u)   /* DMA channel 1 transfer select 11: Multiplier ready */
581
#define DMA1TSEL_12            (12*0x0010u)   /* DMA channel 1 transfer select 12: USCIB receive */
582
#define DMA1TSEL_13            (13*0x0010u)   /* DMA channel 1 transfer select 13: USCIB transmit */
583
#define DMA1TSEL_14            (14*0x0010u)   /* DMA channel 1 transfer select 14: previous DMA channel DMA0IFG */
584
#define DMA1TSEL_15            (15*0x0010u)   /* DMA channel 1 transfer select 15: ext. Trigger (DMAE0) */
585
 
586
#define DMA2TSEL_0             (0*0x0100u)    /* DMA channel 2 transfer select 0:  DMA_REQ */
587
#define DMA2TSEL_1             (1*0x0100u)    /* DMA channel 2 transfer select 1:  Timer_A CCRIFG.2 */
588
#define DMA2TSEL_2             (2*0x0100u)    /* DMA channel 2 transfer select 2:  Timer_B CCRIFG.2 */
589
#define DMA2TSEL_3             (3*0x0100u)    /* DMA channel 2 transfer select 3:  USCIA receive */
590
#define DMA2TSEL_4             (4*0x0100u)    /* DMA channel 2 transfer select 4:  USCIA transmit */
591
#define DMA2TSEL_5             (5*0x0100u)    /* DMA channel 2 transfer select 5:  DAC12.0IFG */
592
#define DMA2TSEL_6             (6*0x0100u)    /* DMA channel 2 transfer select 6:  ADC12 (ADC12IFG) */
593
#define DMA2TSEL_7             (7*0x0100u)    /* DMA channel 2 transfer select 7:  Timer_A (TACCR0.IFG) */
594
#define DMA2TSEL_8             (8*0x0100u)    /* DMA channel 2 transfer select 8:  Timer_B (TBCCR0.IFG) */
595
#define DMA2TSEL_9             (9*0x0100u)    /* DMA channel 2 transfer select 9:  UART1 receive */
596
#define DMA2TSEL_10            (10*0x0100u)   /* DMA channel 2 transfer select 10: UART1 transmit */
597
#define DMA2TSEL_11            (11*0x0100u)   /* DMA channel 2 transfer select 11: Multiplier ready */
598
#define DMA2TSEL_12            (12*0x0100u)   /* DMA channel 2 transfer select 12: USCIB receive */
599
#define DMA2TSEL_13            (13*0x0100u)   /* DMA channel 2 transfer select 13: USCIB transmit */
600
#define DMA2TSEL_14            (14*0x0100u)   /* DMA channel 2 transfer select 14: previous DMA channel DMA1IFG */
601
#define DMA2TSEL_15            (15*0x0100u)   /* DMA channel 2 transfer select 15: ext. Trigger (DMAE0) */
602
 
603
SFR_16BIT(DMACTL1);                           /* DMA Module Control 1 */
604
#define ENNMI                  (0x0001)       /* Enable NMI interruption of DMA */
605
#define ROUNDROBIN             (0x0002)       /* Round-Robin DMA channel priorities */
606
#define DMAONFETCH             (0x0004)       /* DMA transfer on instruction fetch */
607
 
608
SFR_16BIT(DMAIV);                             /* DMA Interrupt Vector Word */
609
SFR_16BIT(DMA0CTL);                           /* DMA Channel 0 Control */
610
SFR_16BIT(DMA1CTL);                           /* DMA Channel 1 Control */
611
SFR_16BIT(DMA2CTL);                           /* DMA Channel 2 Control */
612
 
613
#define DMAREQ                 (0x0001)       /* Initiate DMA transfer with DMATSEL */
614
#define DMAABORT               (0x0002)       /* DMA transfer aborted by NMI */
615
#define DMAIE                  (0x0004)       /* DMA interrupt enable */
616
#define DMAIFG                 (0x0008)       /* DMA interrupt flag */
617
#define DMAEN                  (0x0010)       /* DMA enable */
618
#define DMALEVEL               (0x0020)       /* DMA level sensitive trigger select */
619
#define DMASRCBYTE             (0x0040)       /* DMA source byte */
620
#define DMADSTBYTE             (0x0080)       /* DMA destination byte */
621
#define DMASRCINCR0            (0x0100)       /* DMA source increment bit 0 */
622
#define DMASRCINCR1            (0x0200)       /* DMA source increment bit 1 */
623
#define DMADSTINCR0            (0x0400)       /* DMA destination increment bit 0 */
624
#define DMADSTINCR1            (0x0800)       /* DMA destination increment bit 1 */
625
#define DMADT0                 (0x1000)       /* DMA transfer mode bit 0 */
626
#define DMADT1                 (0x2000)       /* DMA transfer mode bit 1 */
627
#define DMADT2                 (0x4000)       /* DMA transfer mode bit 2 */
628
 
629
#define DMASWDW                (0*0x0040u)    /* DMA transfer: source word to destination word */
630
#define DMASBDW                (1*0x0040u)    /* DMA transfer: source byte to destination word */
631
#define DMASWDB                (2*0x0040u)    /* DMA transfer: source word to destination byte */
632
#define DMASBDB                (3*0x0040u)    /* DMA transfer: source byte to destination byte */
633
 
634
#define DMASRCINCR_0           (0*0x0100u)    /* DMA source increment 0: source address unchanged */
635
#define DMASRCINCR_1           (1*0x0100u)    /* DMA source increment 1: source address unchanged */
636
#define DMASRCINCR_2           (2*0x0100u)    /* DMA source increment 2: source address decremented */
637
#define DMASRCINCR_3           (3*0x0100u)    /* DMA source increment 3: source address incremented */
638
 
639
#define DMADSTINCR_0           (0*0x0400u)    /* DMA destination increment 0: destination address unchanged */
640
#define DMADSTINCR_1           (1*0x0400u)    /* DMA destination increment 1: destination address unchanged */
641
#define DMADSTINCR_2           (2*0x0400u)    /* DMA destination increment 2: destination address decremented */
642
#define DMADSTINCR_3           (3*0x0400u)    /* DMA destination increment 3: destination address incremented */
643
 
644
#define DMADT_0                (0*0x1000u)    /* DMA transfer mode 0: single */
645
#define DMADT_1                (1*0x1000u)    /* DMA transfer mode 1: block */
646
#define DMADT_2                (2*0x1000u)    /* DMA transfer mode 2: interleaved */
647
#define DMADT_3                (3*0x1000u)    /* DMA transfer mode 3: interleaved */
648
#define DMADT_4                (4*0x1000u)    /* DMA transfer mode 4: single, repeat */
649
#define DMADT_5                (5*0x1000u)    /* DMA transfer mode 5: block, repeat */
650
#define DMADT_6                (6*0x1000u)    /* DMA transfer mode 6: interleaved, repeat */
651
#define DMADT_7                (7*0x1000u)    /* DMA transfer mode 7: interleaved, repeat */
652
 
653
SFR_20BIT(DMA0SA);                            /* DMA Channel 0 Source Address */
654
SFR_16BIT(DMA0SAL);                           /* DMA Channel 0 Source Address */
655
SFR_20BIT(DMA0DA);                            /* DMA Channel 0 Destination Address */
656
SFR_16BIT(DMA0DAL);                           /* DMA Channel 0 Destination Address */
657
SFR_16BIT(DMA0SZ);                            /* DMA Channel 0 Transfer Size */
658
SFR_20BIT(DMA1SA);                            /* DMA Channel 1 Source Address */
659
SFR_16BIT(DMA1SAL);                           /* DMA Channel 1 Source Address */
660
SFR_20BIT(DMA1DA);                            /* DMA Channel 1 Destination Address */
661
SFR_16BIT(DMA1DAL);                           /* DMA Channel 1 Destination Address */
662
SFR_16BIT(DMA1SZ);                            /* DMA Channel 1 Transfer Size */
663
SFR_20BIT(DMA2SA);                            /* DMA Channel 2 Source Address */
664
SFR_16BIT(DMA2SAL);                           /* DMA Channel 2 Source Address */
665
SFR_20BIT(DMA2DA);                            /* DMA Channel 2 Destination Address */
666
SFR_16BIT(DMA2DAL);                           /* DMA Channel 2 Destination Address */
667
SFR_16BIT(DMA2SZ);                            /* DMA Channel 2 Transfer Size */
668
 
669
/* DMAIV Definitions */
670
#define DMAIV_NONE             (0x0000)       /* No Interrupt pending */
671
#define DMAIV_DMA0IFG          (0x0002)       /* DMA0IFG */
672
#define DMAIV_DMA1IFG          (0x0004)       /* DMA1IFG */
673
#define DMAIV_DMA2IFG          (0x0006)       /* DMA2IFG */
674
 
675
/*************************************************************
676
* Flash Memory
677
*************************************************************/
678
#define __MSP430_HAS_FLASH__                  /* Definition to show that Module is available */
679
#define __MSP430_HAS_2FLASH_IP__                /* Definition to show that Module is available */
680
 
681
SFR_16BIT(FCTL1);                             /* FLASH Control 1 */
682
SFR_16BIT(FCTL2);                             /* FLASH Control 2 */
683
SFR_16BIT(FCTL3);                             /* FLASH Control 3 */
684
 
685
#define FRKEY                  (0x9600)       /* Flash key returned by read */
686
#define FWKEY                  (0xA500)       /* Flash key for write */
687
#define FXKEY                  (0x3300)       /* for use with XOR instruction */
688
 
689
#define ERASE                  (0x0002)       /* Enable bit for Flash segment erase */
690
#define MERAS                  (0x0004)       /* Enable bit for Flash mass erase */
691
#define GMERAS                 (0x0008)       /* Enable bit for Flash global mass erase */
692
#define CPUEX                  (0x0010)       /* Enable bit for CPU Execution during Flash write/erase */
693
#define WRT                    (0x0040)       /* Enable bit for Flash write */
694
#define BLKWRT                 (0x0080)       /* Enable bit for Flash segment write */
695
#define SEGWRT                 (0x0080)       /* old definition */ /* Enable bit for Flash segment write */
696
 
697
#define FN0                    (0x0001)       /* Divide Flash clock by 1 to 64 using FN0 to FN5 according to: */
698
#define FN1                    (0x0002)       /*  32*FN5 + 16*FN4 + 8*FN3 + 4*FN2 + 2*FN1 + FN0 + 1 */
699
#ifndef FN2
700
#define FN2                    (0x0004)
701
#endif
702
#ifndef FN3
703
#define FN3                    (0x0008)
704
#endif
705
#ifndef FN4
706
#define FN4                    (0x0010)
707
#endif
708
#define FN5                    (0x0020)
709
#define FSSEL0                 (0x0040)       /* Flash clock select 0 */        /* to distinguish from USART SSELx */
710
#define FSSEL1                 (0x0080)       /* Flash clock select 1 */
711
 
712
#define FSSEL_0                (0x0000)       /* Flash clock select: 0 - ACLK */
713
#define FSSEL_1                (0x0040)       /* Flash clock select: 1 - MCLK */
714
#define FSSEL_2                (0x0080)       /* Flash clock select: 2 - SMCLK */
715
#define FSSEL_3                (0x00C0)       /* Flash clock select: 3 - SMCLK */
716
 
717
#define BUSY                   (0x0001)       /* Flash busy: 1 */
718
#define KEYV                   (0x0002)       /* Flash Key violation flag */
719
#define ACCVIFG                (0x0004)       /* Flash Access violation flag */
720
#define WAIT                   (0x0008)       /* Wait flag for segment write */
721
#define LOCK                   (0x0010)       /* Lock bit: 1 - Flash is locked (read only) */
722
#define EMEX                   (0x0020)       /* Flash Emergency Exit */
723
 
724
/************************************************************
725
* SYSTEM CLOCK, FLL+
726
************************************************************/
727
#define __MSP430_HAS_FLLPLUS__                /* Definition to show that Module is available */
728
 
729
SFR_8BIT(SCFI0);                              /* System Clock Frequency Integrator 0 */
730
#define FN_2                   (0x04)         /* fDCOCLK =   1.4-12MHz*/
731
#define FN_3                   (0x08)         /* fDCOCLK =   2.2-17Mhz*/
732
#define FN_4                   (0x10)         /* fDCOCLK =   3.2-25Mhz*/
733
#define FN_8                   (0x20)         /* fDCOCLK =     5-40Mhz*/
734
#define FLLD0                  (0x40)         /* Loop Divider Bit : 0 */
735
#define FLLD1                  (0x80)         /* Loop Divider Bit : 1 */
736
 
737
#define FLLD_1                 (0x00)         /* Multiply Selected Loop Freq. By 1 */
738
#define FLLD_2                 (0x40)         /* Multiply Selected Loop Freq. By 2 */
739
#define FLLD_4                 (0x80)         /* Multiply Selected Loop Freq. By 4 */
740
#define FLLD_8                 (0xC0)         /* Multiply Selected Loop Freq. By 8 */
741
 
742
SFR_8BIT(SCFI1);                              /* System Clock Frequency Integrator 1 */
743
SFR_8BIT(SCFQCTL);                            /* System Clock Frequency Control */
744
/* System clock frequency values fMCLK coded with Bits 0-6 in SCFQCTL */
745
/* #define SCFQ_32K            0x00                        fMCLK=1*fACLK       only a range from */
746
#define SCFQ_64K               (0x01)         /* fMCLK=2*fACLK          1+1 to 127+1 is possible */
747
#define SCFQ_128K              (0x03)         /* fMCLK=4*fACLK */
748
#define SCFQ_256K              (0x07)         /* fMCLK=8*fACLK */
749
#define SCFQ_512K              (0x0F)         /* fMCLK=16*fACLK */
750
#define SCFQ_1M                (0x1F)         /* fMCLK=32*fACLK */
751
#define SCFQ_2M                (0x3F)         /* fMCLK=64*fACLK */
752
#define SCFQ_4M                (0x7F)         /* fMCLK=128*fACLK */
753
#define SCFQ_M                 (0x80)         /* Modulation Disable */
754
 
755
SFR_8BIT(FLL_CTL0);                           /* FLL+ Control 0 */
756
#define DCOF                   (0x01)         /* DCO Fault Flag */
757
#define LFOF                   (0x02)         /* Low Frequency Oscillator Fault Flag */
758
#define XT1OF                  (0x04)         /* High Frequency Oscillator 1 Fault Flag */
759
#define XT2OF                  (0x08)         /* High Frequency Oscillator 2 Fault Flag */
760
#define OSCCAP0                (0x10)         /* XIN/XOUT Cap 0 */
761
#define OSCCAP1                (0x20)         /* XIN/XOUT Cap 1 */
762
#define XTS_FLL                (0x40)         /* 1: Selects high-freq. oscillator */
763
#define DCOPLUS                (0x80)         /* DCO+ Enable */
764
 
765
#define XCAP0PF                (0x00)         /* XIN Cap = XOUT Cap = 0pf */
766
#define XCAP10PF               (0x10)         /* XIN Cap = XOUT Cap = 10pf */
767
#define XCAP14PF               (0x20)         /* XIN Cap = XOUT Cap = 14pf */
768
#define XCAP18PF               (0x30)         /* XIN Cap = XOUT Cap = 18pf */
769
#define OSCCAP_0               (0x00)         /* XIN Cap = XOUT Cap = 0pf */
770
#define OSCCAP_1               (0x10)         /* XIN Cap = XOUT Cap = 10pf */
771
#define OSCCAP_2               (0x20)         /* XIN Cap = XOUT Cap = 14pf */
772
#define OSCCAP_3               (0x30)         /* XIN Cap = XOUT Cap = 18pf */
773
 
774
SFR_8BIT(FLL_CTL1);                           /* FLL+ Control 1 */
775
#define FLL_DIV0               (0x01)         /* FLL+ Divide Px.x/ACLK 0 */
776
#define FLL_DIV1               (0x02)         /* FLL+ Divide Px.x/ACLK 1 */
777
#define SELS                   (0x04)         /* Peripheral Module Clock Source (0: DCO, 1: XT2) */
778
#define SELM0                  (0x08)         /* MCLK Source Select 0 */
779
#define SELM1                  (0x10)         /* MCLK Source Select 1 */
780
#define XT2OFF                 (0x20)         /* High Frequency Oscillator 2 (XT2) disable */
781
#define SMCLKOFF               (0x40)         /* Peripheral Module Clock (SMCLK) disable */
782
#define LFXT1DIG               (0x80)         /* Enable Digital input for LF clock */
783
 
784
#define FLL_DIV_1              (0x00)         /* FLL+ Divide Px.x/ACLK By 1 */
785
#define FLL_DIV_2              (0x01)         /* FLL+ Divide Px.x/ACLK By 2 */
786
#define FLL_DIV_4              (0x02)         /* FLL+ Divide Px.x/ACLK By 4 */
787
#define FLL_DIV_8              (0x03)         /* FLL+ Divide Px.x/ACLK By 8 */
788
 
789
#define SELM_DCO               (0x00)         /* Select DCO for CPU MCLK */
790
#define SELM_XT2               (0x10)         /* Select XT2 for CPU MCLK */
791
#define SELM_A                 (0x18)         /* Select A (from LFXT1) for CPU MCLK */
792
 
793
/* INTERRUPT CONTROL BITS */
794
/* These two bits are defined in the Special Function Registers */
795
/* #define OFIFG               0x02 */
796
/* #define OFIE                0x02 */
797
 
798
/************************************************************
799
* LCD_A
800
************************************************************/
801
#define __MSP430_HAS_LCD_A__                  /* Definition to show that Module is available */
802
 
803
SFR_8BIT(LCDACTL);                            /* LCD_A Control Register */
804
#define LCDON                  (0x01)
805
#define LCDSON                 (0x04)
806
#define LCDMX0                 (0x08)
807
#define LCDMX1                 (0x10)
808
#define LCDFREQ0               (0x20)
809
#define LCDFREQ1               (0x40)
810
#define LCDFREQ2               (0x80)
811
/* Display modes coded with Bits 2-4 */
812
#define LCDSTATIC              (LCDSON)
813
#define LCD2MUX                (LCDMX0+LCDSON)
814
#define LCD3MUX                (LCDMX1+LCDSON)
815
#define LCD4MUX                (LCDMX1+LCDMX0+LCDSON)
816
/* Frequency select code with Bits 5-7 */
817
#define LCDFREQ_32             (0x00)         /* LCD Freq: ACLK divided by 32 */
818
#define LCDFREQ_64             (0x20)         /* LCD Freq: ACLK divided by 64 */
819
#define LCDFREQ_96             (0x40)         /* LCD Freq: ACLK divided by 96 */
820
#define LCDFREQ_128            (0x60)         /* LCD Freq: ACLK divided by 128 */
821
#define LCDFREQ_192            (0x80)         /* LCD Freq: ACLK divided by 192 */
822
#define LCDFREQ_256            (0xA0)         /* LCD Freq: ACLK divided by 256 */
823
#define LCDFREQ_384            (0xC0)         /* LCD Freq: ACLK divided by 384 */
824
#define LCDFREQ_512            (0xE0)         /* LCD Freq: ACLK divided by 512 */
825
 
826
SFR_8BIT(LCDAPCTL0);                          /* LCD_A Port Control Register 0 */
827
#define LCDS0                  (0x01)         /* LCD Segment  0 to  3 Enable. */
828
#define LCDS4                  (0x02)         /* LCD Segment  4 to  7 Enable. */
829
#define LCDS8                  (0x04)         /* LCD Segment  8 to 11 Enable. */
830
#define LCDS12                 (0x08)         /* LCD Segment 12 to 15 Enable. */
831
#define LCDS16                 (0x10)         /* LCD Segment 16 to 19 Enable. */
832
#define LCDS20                 (0x20)         /* LCD Segment 20 to 23 Enable. */
833
#define LCDS24                 (0x40)         /* LCD Segment 24 to 27 Enable. */
834
#define LCDS28                 (0x80)         /* LCD Segment 28 to 31 Enable. */
835
 
836
SFR_8BIT(LCDAPCTL1);                          /* LCD_A Port Control Register 1 */
837
#define LCDS32                 (0x01)         /* LCD Segment 32 to 35 Enable. */
838
#define LCDS36                 (0x02)         /* LCD Segment 36 to 39 Enable. */
839
 
840
SFR_8BIT(LCDAVCTL0);                          /* LCD_A Voltage Control Register 0 */
841
#define LCD2B                  (0x01)         /* Selects 1/2 bias. */
842
#define VLCDREF0               (0x02)         /* Selects reference voltage for regulated charge pump: 0 */
843
#define VLCDREF1               (0x04)         /* Selects reference voltage for regulated charge pump: 1 */
844
#define LCDCPEN                (0x08)         /* LCD Voltage Charge Pump Enable. */
845
#define VLCDEXT                (0x10)         /* Select external source for VLCD. */
846
#define LCDREXT                (0x20)         /* Selects external connections for LCD mid voltages. */
847
#define LCDR03EXT              (0x40)         /* Selects external connection for lowest LCD voltage. */
848
 
849
/* Reference voltage source select for the regulated charge pump */
850
#define VLCDREF_0              (0<<1)         /* Internal */
851
#define VLCDREF_1              (1<<1)         /* External */
852
#define VLCDREF_2              (2<<1)         /* Reserved */
853
#define VLCDREF_3              (3<<1)         /* Reserved */
854
 
855
SFR_8BIT(LCDAVCTL1);                          /* LCD_A Voltage Control Register 1 */
856
#define VLCD0                  (0x02)         /* VLCD select: 0 */
857
#define VLCD1                  (0x04)         /* VLCD select: 1 */
858
#define VLCD2                  (0x08)         /* VLCD select: 2 */
859
#define VLCD3                  (0x10)         /* VLCD select: 3 */
860
 
861
/* Charge pump voltage selections */
862
#define VLCD_0                 (0<<1)         /* Charge pump disabled */
863
#define VLCD_1                 (1<<1)         /* VLCD = 2.60V */
864
#define VLCD_2                 (2<<1)         /* VLCD = 2.66V */
865
#define VLCD_3                 (3<<1)         /* VLCD = 2.72V */
866
#define VLCD_4                 (4<<1)         /* VLCD = 2.78V */
867
#define VLCD_5                 (5<<1)         /* VLCD = 2.84V */
868
#define VLCD_6                 (6<<1)         /* VLCD = 2.90V */
869
#define VLCD_7                 (7<<1)         /* VLCD = 2.96V */
870
#define VLCD_8                 (8<<1)         /* VLCD = 3.02V */
871
#define VLCD_9                 (9<<1)         /* VLCD = 3.08V */
872
#define VLCD_10                (10<<1)        /* VLCD = 3.14V */
873
#define VLCD_11                (11<<1)        /* VLCD = 3.20V */
874
#define VLCD_12                (12<<1)        /* VLCD = 3.26V */
875
#define VLCD_13                (12<<1)        /* VLCD = 3.32V */
876
#define VLCD_14                (13<<1)        /* VLCD = 3.38V */
877
#define VLCD_15                (15<<1)        /* VLCD = 3.44V */
878
 
879
#define VLCD_DISABLED          (0<<1)         /* Charge pump disabled */
880
#define VLCD_2_60              (1<<1)         /* VLCD = 2.60V */
881
#define VLCD_2_66              (2<<1)         /* VLCD = 2.66V */
882
#define VLCD_2_72              (3<<1)         /* VLCD = 2.72V */
883
#define VLCD_2_78              (4<<1)         /* VLCD = 2.78V */
884
#define VLCD_2_84              (5<<1)         /* VLCD = 2.84V */
885
#define VLCD_2_90              (6<<1)         /* VLCD = 2.90V */
886
#define VLCD_2_96              (7<<1)         /* VLCD = 2.96V */
887
#define VLCD_3_02              (8<<1)         /* VLCD = 3.02V */
888
#define VLCD_3_08              (9<<1)         /* VLCD = 3.08V */
889
#define VLCD_3_14              (10<<1)        /* VLCD = 3.14V */
890
#define VLCD_3_20              (11<<1)        /* VLCD = 3.20V */
891
#define VLCD_3_26              (12<<1)        /* VLCD = 3.26V */
892
#define VLCD_3_32              (12<<1)        /* VLCD = 3.32V */
893
#define VLCD_3_38              (13<<1)        /* VLCD = 3.38V */
894
#define VLCD_3_44              (15<<1)        /* VLCD = 3.44V */
895
 
896
#define LCDMEM_                (0x0091)       /* LCD Memory */
897
#ifdef __ASM_HEADER__
898
#define LCDMEM                 (LCDMEM_)      /* LCD Memory (for assembler) */
899
#else
900
#define LCDMEM                 ((char*)       LCDMEM_) /* LCD Memory (for C) */
901
#endif
902
SFR_8BIT(LCDM1);                              /* LCD Memory 1 */
903
SFR_8BIT(LCDM2);                              /* LCD Memory 2 */
904
SFR_8BIT(LCDM3);                              /* LCD Memory 3 */
905
SFR_8BIT(LCDM4);                              /* LCD Memory 4 */
906
SFR_8BIT(LCDM5);                              /* LCD Memory 5 */
907
SFR_8BIT(LCDM6);                              /* LCD Memory 6 */
908
SFR_8BIT(LCDM7);                              /* LCD Memory 7 */
909
SFR_8BIT(LCDM8);                              /* LCD Memory 8 */
910
SFR_8BIT(LCDM9);                              /* LCD Memory 9 */
911
SFR_8BIT(LCDM10);                             /* LCD Memory 10 */
912
SFR_8BIT(LCDM11);                             /* LCD Memory 11 */
913
SFR_8BIT(LCDM12);                             /* LCD Memory 12 */
914
SFR_8BIT(LCDM13);                             /* LCD Memory 13 */
915
SFR_8BIT(LCDM14);                             /* LCD Memory 14 */
916
SFR_8BIT(LCDM15);                             /* LCD Memory 15 */
917
SFR_8BIT(LCDM16);                             /* LCD Memory 16 */
918
SFR_8BIT(LCDM17);                             /* LCD Memory 17 */
919
SFR_8BIT(LCDM18);                             /* LCD Memory 18 */
920
SFR_8BIT(LCDM19);                             /* LCD Memory 19 */
921
SFR_8BIT(LCDM20);                             /* LCD Memory 20 */
922
 
923
#define LCDMA                  (LCDM10)       /* LCD Memory A */
924
#define LCDMB                  (LCDM11)       /* LCD Memory B */
925
#define LCDMC                  (LCDM12)       /* LCD Memory C */
926
#define LCDMD                  (LCDM13)       /* LCD Memory D */
927
#define LCDME                  (LCDM14)       /* LCD Memory E */
928
#define LCDMF                  (LCDM15)       /* LCD Memory F */
929
 
930
/************************************************************
931
* HARDWARE MULTIPLIER
932
************************************************************/
933
#define __MSP430_HAS_MPY__                    /* Definition to show that Module is available */
934
 
935
SFR_16BIT(MPY);                               /* Multiply Unsigned/Operand 1 */
936
SFR_16BIT(MPYS);                              /* Multiply Signed/Operand 1 */
937
SFR_16BIT(MAC);                               /* Multiply Unsigned and Accumulate/Operand 1 */
938
SFR_16BIT(MACS);                              /* Multiply Signed and Accumulate/Operand 1 */
939
SFR_16BIT(OP2);                               /* Operand 2 */
940
SFR_16BIT(RESLO);                             /* Result Low Word */
941
SFR_16BIT(RESHI);                             /* Result High Word */
942
SFR_16BIT(SUMEXT);                            /* Sum Extend */
943
 
944
/************************************************************
945
* DIGITAL I/O Port1/2
946
************************************************************/
947
#define __MSP430_HAS_PORT1__                  /* Definition to show that Module is available */
948
#define __MSP430_HAS_PORT2__                  /* Definition to show that Module is available */
949
 
950
SFR_8BIT(P1IN);                               /* Port 1 Input */
951
SFR_8BIT(P1OUT);                              /* Port 1 Output */
952
SFR_8BIT(P1DIR);                              /* Port 1 Direction */
953
SFR_8BIT(P1IFG);                              /* Port 1 Interrupt Flag */
954
SFR_8BIT(P1IES);                              /* Port 1 Interrupt Edge Select */
955
SFR_8BIT(P1IE);                               /* Port 1 Interrupt Enable */
956
SFR_8BIT(P1SEL);                              /* Port 1 Selection */
957
 
958
SFR_8BIT(P2IN);                               /* Port 2 Input */
959
SFR_8BIT(P2OUT);                              /* Port 2 Output */
960
SFR_8BIT(P2DIR);                              /* Port 2 Direction */
961
SFR_8BIT(P2IFG);                              /* Port 2 Interrupt Flag */
962
SFR_8BIT(P2IES);                              /* Port 2 Interrupt Edge Select */
963
SFR_8BIT(P2IE);                               /* Port 2 Interrupt Enable */
964
SFR_8BIT(P2SEL);                              /* Port 2 Selection */
965
 
966
/************************************************************
967
* DIGITAL I/O Port3/4
968
************************************************************/
969
#define __MSP430_HAS_PORT3__                  /* Definition to show that Module is available */
970
#define __MSP430_HAS_PORT4__                  /* Definition to show that Module is available */
971
 
972
SFR_8BIT(P3IN);                               /* Port 3 Input */
973
SFR_8BIT(P3OUT);                              /* Port 3 Output */
974
SFR_8BIT(P3DIR);                              /* Port 3 Direction */
975
SFR_8BIT(P3SEL);                              /* Port 3 Selection */
976
 
977
SFR_8BIT(P4IN);                               /* Port 4 Input */
978
SFR_8BIT(P4OUT);                              /* Port 4 Output */
979
SFR_8BIT(P4DIR);                              /* Port 4 Direction */
980
SFR_8BIT(P4SEL);                              /* Port 4 Selection */
981
 
982
/************************************************************
983
* DIGITAL I/O Port5/6
984
************************************************************/
985
#define __MSP430_HAS_PORT5__                  /* Definition to show that Module is available */
986
#define __MSP430_HAS_PORT6__                  /* Definition to show that Module is available */
987
 
988
SFR_8BIT(P5IN);                               /* Port 5 Input */
989
SFR_8BIT(P5OUT);                              /* Port 5 Output */
990
SFR_8BIT(P5DIR);                              /* Port 5 Direction */
991
SFR_8BIT(P5SEL);                              /* Port 5 Selection */
992
 
993
SFR_8BIT(P6IN);                               /* Port 6 Input */
994
SFR_8BIT(P6OUT);                              /* Port 6 Output */
995
SFR_8BIT(P6DIR);                              /* Port 6 Direction */
996
SFR_8BIT(P6SEL);                              /* Port 6 Selection */
997
 
998
/************************************************************
999
* DIGITAL I/O Port7/8
1000
************************************************************/
1001
#define __MSP430_HAS_PORT7__                  /* Definition to show that Module is available */
1002
#define __MSP430_HAS_PORT8__                  /* Definition to show that Module is available */
1003
#define __MSP430_HAS_PORTA__                  /* Definition to show that Module is available */
1004
 
1005
SFR_8BIT(P7IN);                               /* Port 7 Input */
1006
SFR_8BIT(P7OUT);                              /* Port 7 Output */
1007
SFR_8BIT(P7DIR);                              /* Port 7 Direction */
1008
SFR_8BIT(P7SEL);                              /* Port 7 Selection */
1009
 
1010
SFR_8BIT(P8IN);                               /* Port 8 Input */
1011
SFR_8BIT(P8OUT);                              /* Port 8 Output */
1012
SFR_8BIT(P8DIR);                              /* Port 8 Direction */
1013
SFR_8BIT(P8SEL);                              /* Port 8 Selection */
1014
 
1015
SFR_16BIT(PAIN);                              /* Port A Input */
1016
SFR_16BIT(PAOUT);                             /* Port A Output */
1017
SFR_16BIT(PADIR);                             /* Port A Direction */
1018
SFR_16BIT(PASEL);                             /* Port A Selection */
1019
 
1020
/************************************************************
1021
* DIGITAL I/O Port9/10
1022
************************************************************/
1023
#define __MSP430_HAS_PORT9__                  /* Definition to show that Module is available */
1024
#define __MSP430_HAS_PORT10__                 /* Definition to show that Module is available */
1025
#define __MSP430_HAS_PORTB__                  /* Definition to show that Module is available */
1026
 
1027
SFR_8BIT(P9IN);                               /* Port 9 Input */
1028
SFR_8BIT(P9OUT);                              /* Port 9 Output */
1029
SFR_8BIT(P9DIR);                              /* Port 9 Direction */
1030
SFR_8BIT(P9SEL);                              /* Port 9 Selection */
1031
 
1032
SFR_8BIT(P10IN);                              /* Port 10 Input */
1033
SFR_8BIT(P10OUT);                             /* Port 10 Output */
1034
SFR_8BIT(P10DIR);                             /* Port 10 Direction */
1035
SFR_8BIT(P10SEL);                             /* Port 10 Selection */
1036
 
1037
SFR_16BIT(PBIN);                              /* Port B Input */
1038
SFR_16BIT(PBOUT);                             /* Port B Output */
1039
SFR_16BIT(PBDIR);                             /* Port B Direction */
1040
SFR_16BIT(PBSEL);                             /* Port B Selection */
1041
 
1042
/************************************************************
1043
* Brown-Out, Supply Voltage Supervision (SVS)
1044
************************************************************/
1045
#define __MSP430_HAS_SVS__                    /* Definition to show that Module is available */
1046
 
1047
SFR_8BIT(SVSCTL);                             /* SVS Control */
1048
#define SVSFG                  (0x01)         /* SVS Flag */
1049
#define SVSOP                  (0x02)         /* SVS output (read only) */
1050
#define SVSON                  (0x04)         /* Switches the SVS on/off */
1051
#define PORON                  (0x08)         /* Enable POR Generation if Low Voltage */
1052
#define VLD0                   (0x10)
1053
#define VLD1                   (0x20)
1054
#define VLD2                   (0x40)
1055
#define VLD3                   (0x80)
1056
 
1057
#define VLDON                  (0x10)
1058
#define VLDOFF                 (0x00)
1059
#define VLD_1_8V               (0x10)
1060
 
1061
/************************************************************
1062
* Timer A3
1063
************************************************************/
1064
#define __MSP430_HAS_TA3__                    /* Definition to show that Module is available */
1065
 
1066
SFR_16BIT(TAIV);                              /* Timer A Interrupt Vector Word */
1067
SFR_16BIT(TACTL);                             /* Timer A Control */
1068
SFR_16BIT(TACCTL0);                           /* Timer A Capture/Compare Control 0 */
1069
SFR_16BIT(TACCTL1);                           /* Timer A Capture/Compare Control 1 */
1070
SFR_16BIT(TACCTL2);                           /* Timer A Capture/Compare Control 2 */
1071
SFR_16BIT(TAR);                               /* Timer A Counter Register */
1072
SFR_16BIT(TACCR0);                            /* Timer A Capture/Compare 0 */
1073
SFR_16BIT(TACCR1);                            /* Timer A Capture/Compare 1 */
1074
SFR_16BIT(TACCR2);                            /* Timer A Capture/Compare 2 */
1075
 
1076
/* Alternate register names */
1077
#define CCTL0                  TACCTL0        /* Timer A Capture/Compare Control 0 */
1078
#define CCTL1                  TACCTL1        /* Timer A Capture/Compare Control 1 */
1079
#define CCTL2                  TACCTL2        /* Timer A Capture/Compare Control 2 */
1080
#define CCR0                   TACCR0         /* Timer A Capture/Compare 0 */
1081
#define CCR1                   TACCR1         /* Timer A Capture/Compare 1 */
1082
#define CCR2                   TACCR2         /* Timer A Capture/Compare 2 */
1083
#define CCTL0_                 TACCTL0_       /* Timer A Capture/Compare Control 0 */
1084
#define CCTL1_                 TACCTL1_       /* Timer A Capture/Compare Control 1 */
1085
#define CCTL2_                 TACCTL2_       /* Timer A Capture/Compare Control 2 */
1086
#define CCR0_                  TACCR0_        /* Timer A Capture/Compare 0 */
1087
#define CCR1_                  TACCR1_        /* Timer A Capture/Compare 1 */
1088
#define CCR2_                  TACCR2_        /* Timer A Capture/Compare 2 */
1089
/* Alternate register names - 5xx style */
1090
#define TA0IV                  TAIV           /* Timer A Interrupt Vector Word */
1091
#define TA0CTL                 TACTL          /* Timer A Control */
1092
#define TA0CCTL0               TACCTL0        /* Timer A Capture/Compare Control 0 */
1093
#define TA0CCTL1               TACCTL1        /* Timer A Capture/Compare Control 1 */
1094
#define TA0CCTL2               TACCTL2        /* Timer A Capture/Compare Control 2 */
1095
#define TA0R                   TAR            /* Timer A Counter Register */
1096
#define TA0CCR0                TACCR0         /* Timer A Capture/Compare 0 */
1097
#define TA0CCR1                TACCR1         /* Timer A Capture/Compare 1 */
1098
#define TA0CCR2                TACCR2         /* Timer A Capture/Compare 2 */
1099
#define TA0IV_                 TAIV_          /* Timer A Interrupt Vector Word */
1100
#define TA0CTL_                TACTL_         /* Timer A Control */
1101
#define TA0CCTL0_              TACCTL0_       /* Timer A Capture/Compare Control 0 */
1102
#define TA0CCTL1_              TACCTL1_       /* Timer A Capture/Compare Control 1 */
1103
#define TA0CCTL2_              TACCTL2_       /* Timer A Capture/Compare Control 2 */
1104
#define TA0R_                  TAR_           /* Timer A Counter Register */
1105
#define TA0CCR0_               TACCR0_        /* Timer A Capture/Compare 0 */
1106
#define TA0CCR1_               TACCR1_        /* Timer A Capture/Compare 1 */
1107
#define TA0CCR2_               TACCR2_        /* Timer A Capture/Compare 2 */
1108
 
1109
#define TASSEL1                (0x0200)       /* Timer A clock source select 0 */
1110
#define TASSEL0                (0x0100)       /* Timer A clock source select 1 */
1111
#define ID1                    (0x0080)       /* Timer A clock input divider 1 */
1112
#define ID0                    (0x0040)       /* Timer A clock input divider 0 */
1113
#define MC1                    (0x0020)       /* Timer A mode control 1 */
1114
#define MC0                    (0x0010)       /* Timer A mode control 0 */
1115
#define TACLR                  (0x0004)       /* Timer A counter clear */
1116
#define TAIE                   (0x0002)       /* Timer A counter interrupt enable */
1117
#define TAIFG                  (0x0001)       /* Timer A counter interrupt flag */
1118
 
1119
#define MC_0                   (0*0x10u)      /* Timer A mode control: 0 - Stop */
1120
#define MC_1                   (1*0x10u)      /* Timer A mode control: 1 - Up to CCR0 */
1121
#define MC_2                   (2*0x10u)      /* Timer A mode control: 2 - Continous up */
1122
#define MC_3                   (3*0x10u)      /* Timer A mode control: 3 - Up/Down */
1123
#define ID_0                   (0*0x40u)      /* Timer A input divider: 0 - /1 */
1124
#define ID_1                   (1*0x40u)      /* Timer A input divider: 1 - /2 */
1125
#define ID_2                   (2*0x40u)      /* Timer A input divider: 2 - /4 */
1126
#define ID_3                   (3*0x40u)      /* Timer A input divider: 3 - /8 */
1127
#define TASSEL_0               (0*0x100u)     /* Timer A clock source select: 0 - TACLK */
1128
#define TASSEL_1               (1*0x100u)     /* Timer A clock source select: 1 - ACLK  */
1129
#define TASSEL_2               (2*0x100u)     /* Timer A clock source select: 2 - SMCLK */
1130
#define TASSEL_3               (3*0x100u)     /* Timer A clock source select: 3 - INCLK */
1131
 
1132
#define CM1                    (0x8000)       /* Capture mode 1 */
1133
#define CM0                    (0x4000)       /* Capture mode 0 */
1134
#define CCIS1                  (0x2000)       /* Capture input select 1 */
1135
#define CCIS0                  (0x1000)       /* Capture input select 0 */
1136
#define SCS                    (0x0800)       /* Capture sychronize */
1137
#define SCCI                   (0x0400)       /* Latched capture signal (read) */
1138
#define CAP                    (0x0100)       /* Capture mode: 1 /Compare mode : 0 */
1139
#define OUTMOD2                (0x0080)       /* Output mode 2 */
1140
#define OUTMOD1                (0x0040)       /* Output mode 1 */
1141
#define OUTMOD0                (0x0020)       /* Output mode 0 */
1142
#define CCIE                   (0x0010)       /* Capture/compare interrupt enable */
1143
#define CCI                    (0x0008)       /* Capture input signal (read) */
1144
#define OUT                    (0x0004)       /* PWM Output signal if output mode 0 */
1145
#define COV                    (0x0002)       /* Capture/compare overflow flag */
1146
#define CCIFG                  (0x0001)       /* Capture/compare interrupt flag */
1147
 
1148
#define OUTMOD_0               (0*0x20u)      /* PWM output mode: 0 - output only */
1149
#define OUTMOD_1               (1*0x20u)      /* PWM output mode: 1 - set */
1150
#define OUTMOD_2               (2*0x20u)      /* PWM output mode: 2 - PWM toggle/reset */
1151
#define OUTMOD_3               (3*0x20u)      /* PWM output mode: 3 - PWM set/reset */
1152
#define OUTMOD_4               (4*0x20u)      /* PWM output mode: 4 - toggle */
1153
#define OUTMOD_5               (5*0x20u)      /* PWM output mode: 5 - Reset */
1154
#define OUTMOD_6               (6*0x20u)      /* PWM output mode: 6 - PWM toggle/set */
1155
#define OUTMOD_7               (7*0x20u)      /* PWM output mode: 7 - PWM reset/set */
1156
#define CCIS_0                 (0*0x1000u)    /* Capture input select: 0 - CCIxA */
1157
#define CCIS_1                 (1*0x1000u)    /* Capture input select: 1 - CCIxB */
1158
#define CCIS_2                 (2*0x1000u)    /* Capture input select: 2 - GND */
1159
#define CCIS_3                 (3*0x1000u)    /* Capture input select: 3 - Vcc */
1160
#define CM_0                   (0*0x4000u)    /* Capture mode: 0 - disabled */
1161
#define CM_1                   (1*0x4000u)    /* Capture mode: 1 - pos. edge */
1162
#define CM_2                   (2*0x4000u)    /* Capture mode: 1 - neg. edge */
1163
#define CM_3                   (3*0x4000u)    /* Capture mode: 1 - both edges */
1164
 
1165
/* TA3IV Definitions */
1166
#define TAIV_NONE              (0x0000)       /* No Interrupt pending */
1167
#define TAIV_TACCR1            (0x0002)       /* TACCR1_CCIFG */
1168
#define TAIV_TACCR2            (0x0004)       /* TACCR2_CCIFG */
1169
#define TAIV_6                 (0x0006)       /* Reserved */
1170
#define TAIV_8                 (0x0008)       /* Reserved */
1171
#define TAIV_TAIFG             (0x000A)       /* TAIFG */
1172
 
1173
/************************************************************
1174
* Timer B7
1175
************************************************************/
1176
#define __MSP430_HAS_TB7__                    /* Definition to show that Module is available */
1177
 
1178
SFR_16BIT(TBIV);                              /* Timer B Interrupt Vector Word */
1179
SFR_16BIT(TBCTL);                             /* Timer B Control */
1180
SFR_16BIT(TBCCTL0);                           /* Timer B Capture/Compare Control 0 */
1181
SFR_16BIT(TBCCTL1);                           /* Timer B Capture/Compare Control 1 */
1182
SFR_16BIT(TBCCTL2);                           /* Timer B Capture/Compare Control 2 */
1183
SFR_16BIT(TBCCTL3);                           /* Timer B Capture/Compare Control 3 */
1184
SFR_16BIT(TBCCTL4);                           /* Timer B Capture/Compare Control 4 */
1185
SFR_16BIT(TBCCTL5);                           /* Timer B Capture/Compare Control 5 */
1186
SFR_16BIT(TBCCTL6);                           /* Timer B Capture/Compare Control 6 */
1187
SFR_16BIT(TBR);                               /* Timer B Counter Register */
1188
SFR_16BIT(TBCCR0);                            /* Timer B Capture/Compare 0 */
1189
SFR_16BIT(TBCCR1);                            /* Timer B Capture/Compare 1 */
1190
SFR_16BIT(TBCCR2);                            /* Timer B Capture/Compare 2 */
1191
SFR_16BIT(TBCCR3);                            /* Timer B Capture/Compare 3 */
1192
SFR_16BIT(TBCCR4);                            /* Timer B Capture/Compare 4 */
1193
SFR_16BIT(TBCCR5);                            /* Timer B Capture/Compare 5 */
1194
SFR_16BIT(TBCCR6);                            /* Timer B Capture/Compare 6 */
1195
 
1196
/* Alternate register names - 5xx style */
1197
#define TB0IV                  TBIV           /* Timer B Interrupt Vector Word */
1198
#define TB0CTL                 TBCTL          /* Timer B Control */
1199
#define TB0CCTL0               TBCCTL0        /* Timer B Capture/Compare Control 0 */
1200
#define TB0CCTL1               TBCCTL1        /* Timer B Capture/Compare Control 1 */
1201
#define TB0CCTL2               TBCCTL2        /* Timer B Capture/Compare Control 2 */
1202
#define TB0CCTL3               TBCCTL3        /* Timer B Capture/Compare Control 3 */
1203
#define TB0CCTL4               TBCCTL4        /* Timer B Capture/Compare Control 4 */
1204
#define TB0CCTL5               TBCCTL5        /* Timer B Capture/Compare Control 5 */
1205
#define TB0CCTL6               TBCCTL6        /* Timer B Capture/Compare Control 6 */
1206
#define TB0R                   TBR            /* Timer B Counter Register */
1207
#define TB0CCR0                TBCCR0         /* Timer B Capture/Compare 0 */
1208
#define TB0CCR1                TBCCR1         /* Timer B Capture/Compare 1 */
1209
#define TB0CCR2                TBCCR2         /* Timer B Capture/Compare 2 */
1210
#define TB0CCR3                TBCCR3         /* Timer B Capture/Compare 3 */
1211
#define TB0CCR4                TBCCR4         /* Timer B Capture/Compare 4 */
1212
#define TB0CCR5                TBCCR5         /* Timer B Capture/Compare 5 */
1213
#define TB0CCR6                TBCCR6         /* Timer B Capture/Compare 6 */
1214
#define TB0IV_                 TBIV_          /* Timer B Interrupt Vector Word */
1215
#define TB0CTL_                TBCTL_         /* Timer B Control */
1216
#define TB0CCTL0_              TBCCTL0_       /* Timer B Capture/Compare Control 0 */
1217
#define TB0CCTL1_              TBCCTL1_       /* Timer B Capture/Compare Control 1 */
1218
#define TB0CCTL2_              TBCCTL2_       /* Timer B Capture/Compare Control 2 */
1219
#define TB0CCTL3_              TBCCTL3_       /* Timer B Capture/Compare Control 3 */
1220
#define TB0CCTL4_              TBCCTL4_       /* Timer B Capture/Compare Control 4 */
1221
#define TB0CCTL5_              TBCCTL5_       /* Timer B Capture/Compare Control 5 */
1222
#define TB0CCTL6_              TBCCTL6_       /* Timer B Capture/Compare Control 6 */
1223
#define TB0R_                  TBR_           /* Timer B Counter Register */
1224
#define TB0CCR0_               TBCCR0_        /* Timer B Capture/Compare 0 */
1225
#define TB0CCR1_               TBCCR1_        /* Timer B Capture/Compare 1 */
1226
#define TB0CCR2_               TBCCR2_        /* Timer B Capture/Compare 2 */
1227
#define TB0CCR3_               TBCCR3_        /* Timer B Capture/Compare 3 */
1228
#define TB0CCR4_               TBCCR4_        /* Timer B Capture/Compare 4 */
1229
#define TB0CCR5_               TBCCR5_        /* Timer B Capture/Compare 5 */
1230
#define TB0CCR6_               TBCCR6_        /* Timer B Capture/Compare 6 */
1231
 
1232
#define TBCLGRP1               (0x4000)       /* Timer B Compare latch load group 1 */
1233
#define TBCLGRP0               (0x2000)       /* Timer B Compare latch load group 0 */
1234
#define CNTL1                  (0x1000)       /* Counter lenght 1 */
1235
#define CNTL0                  (0x0800)       /* Counter lenght 0 */
1236
#define TBSSEL1                (0x0200)       /* Clock source 1 */
1237
#define TBSSEL0                (0x0100)       /* Clock source 0 */
1238
#define TBCLR                  (0x0004)       /* Timer B counter clear */
1239
#define TBIE                   (0x0002)       /* Timer B interrupt enable */
1240
#define TBIFG                  (0x0001)       /* Timer B interrupt flag */
1241
 
1242
#define SHR1                   (0x4000)       /* Timer B Compare latch load group 1 */
1243
#define SHR0                   (0x2000)       /* Timer B Compare latch load group 0 */
1244
 
1245
#define TBSSEL_0               (0*0x0100u)    /* Clock Source: TBCLK */
1246
#define TBSSEL_1               (1*0x0100u)    /* Clock Source: ACLK  */
1247
#define TBSSEL_2               (2*0x0100u)    /* Clock Source: SMCLK */
1248
#define TBSSEL_3               (3*0x0100u)    /* Clock Source: INCLK */
1249
#define CNTL_0                 (0*0x0800u)    /* Counter lenght: 16 bit */
1250
#define CNTL_1                 (1*0x0800u)    /* Counter lenght: 12 bit */
1251
#define CNTL_2                 (2*0x0800u)    /* Counter lenght: 10 bit */
1252
#define CNTL_3                 (3*0x0800u)    /* Counter lenght:  8 bit */
1253
#define SHR_0                  (0*0x2000u)    /* Timer B Group: 0 - individually */
1254
#define SHR_1                  (1*0x2000u)    /* Timer B Group: 1 - 3 groups (1-2, 3-4, 5-6) */
1255
#define SHR_2                  (2*0x2000u)    /* Timer B Group: 2 - 2 groups (1-3, 4-6)*/
1256
#define SHR_3                  (3*0x2000u)    /* Timer B Group: 3 - 1 group (all) */
1257
#define TBCLGRP_0              (0*0x2000u)    /* Timer B Group: 0 - individually */
1258
#define TBCLGRP_1              (1*0x2000u)    /* Timer B Group: 1 - 3 groups (1-2, 3-4, 5-6) */
1259
#define TBCLGRP_2              (2*0x2000u)    /* Timer B Group: 2 - 2 groups (1-3, 4-6)*/
1260
#define TBCLGRP_3              (3*0x2000u)    /* Timer B Group: 3 - 1 group (all) */
1261
 
1262
/* Additional Timer B Control Register bits are defined in Timer A */
1263
#define CLLD1                  (0x0400)       /* Compare latch load source 1 */
1264
#define CLLD0                  (0x0200)       /* Compare latch load source 0 */
1265
 
1266
#define SLSHR1                 (0x0400)       /* Compare latch load source 1 */
1267
#define SLSHR0                 (0x0200)       /* Compare latch load source 0 */
1268
 
1269
#define SLSHR_0                (0*0x0200u)    /* Compare latch load sourec : 0 - immediate */
1270
#define SLSHR_1                (1*0x0200u)    /* Compare latch load sourec : 1 - TBR counts to 0 */
1271
#define SLSHR_2                (2*0x0200u)    /* Compare latch load sourec : 2 - up/down */
1272
#define SLSHR_3                (3*0x0200u)    /* Compare latch load sourec : 3 - TBR counts to TBCTL0 */
1273
 
1274
#define CLLD_0                 (0*0x0200u)    /* Compare latch load sourec : 0 - immediate */
1275
#define CLLD_1                 (1*0x0200u)    /* Compare latch load sourec : 1 - TBR counts to 0 */
1276
#define CLLD_2                 (2*0x0200u)    /* Compare latch load sourec : 2 - up/down */
1277
#define CLLD_3                 (3*0x0200u)    /* Compare latch load sourec : 3 - TBR counts to TBCTL0 */
1278
 
1279
/* TB7IV Definitions */
1280
#define TBIV_NONE              (0x0000)       /* No Interrupt pending */
1281
#define TBIV_TBCCR1            (0x0002)       /* TBCCR1_CCIFG */
1282
#define TBIV_TBCCR2            (0x0004)       /* TBCCR2_CCIFG */
1283
#define TBIV_TBCCR3            (0x0006)       /* TBCCR3_CCIFG */
1284
#define TBIV_TBCCR4            (0x0008)       /* TBCCR4_CCIFG */
1285
#define TBIV_TBCCR5            (0x000A)       /* TBCCR3_CCIFG */
1286
#define TBIV_TBCCR6            (0x000C)       /* TBCCR4_CCIFG */
1287
#define TBIV_TBIFG             (0x000E)       /* TBIFG */
1288
 
1289
/************************************************************
1290
* USCI
1291
************************************************************/
1292
#define __MSP430_HAS_USCI__                   /* Definition to show that Module is available */
1293
 
1294
SFR_8BIT(UCA0CTL0);                           /* USCI A0 Control Register 0 */
1295
SFR_8BIT(UCA0CTL1);                           /* USCI A0 Control Register 1 */
1296
SFR_8BIT(UCA0BR0);                            /* USCI A0 Baud Rate 0 */
1297
SFR_8BIT(UCA0BR1);                            /* USCI A0 Baud Rate 1 */
1298
SFR_8BIT(UCA0MCTL);                           /* USCI A0 Modulation Control */
1299
SFR_8BIT(UCA0STAT);                           /* USCI A0 Status Register */
1300
SFR_8BIT(UCA0RXBUF);                          /* USCI A0 Receive Buffer */
1301
SFR_8BIT(UCA0TXBUF);                          /* USCI A0 Transmit Buffer */
1302
SFR_8BIT(UCA0ABCTL);                          /* USCI A0 LIN Control */
1303
SFR_8BIT(UCA0IRTCTL);                         /* USCI A0 IrDA Transmit Control */
1304
SFR_8BIT(UCA0IRRCTL);                         /* USCI A0 IrDA Receive Control */
1305
 
1306
 
1307
 
1308
SFR_8BIT(UCB0CTL0);                           /* USCI B0 Control Register 0 */
1309
SFR_8BIT(UCB0CTL1);                           /* USCI B0 Control Register 1 */
1310
SFR_8BIT(UCB0BR0);                            /* USCI B0 Baud Rate 0 */
1311
SFR_8BIT(UCB0BR1);                            /* USCI B0 Baud Rate 1 */
1312
SFR_8BIT(UCB0I2CIE);                          /* USCI B0 I2C Interrupt Enable Register */
1313
SFR_8BIT(UCB0STAT);                           /* USCI B0 Status Register */
1314
SFR_8BIT(UCB0RXBUF);                          /* USCI B0 Receive Buffer */
1315
SFR_8BIT(UCB0TXBUF);                          /* USCI B0 Transmit Buffer */
1316
SFR_16BIT(UCB0I2COA);                         /* USCI B0 I2C Own Address */
1317
SFR_16BIT(UCB0I2CSA);                         /* USCI B0 I2C Slave Address */
1318
 
1319
// UART-Mode Bits
1320
#define UCPEN                  (0x80)         /* Async. Mode: Parity enable */
1321
#define UCPAR                  (0x40)         /* Async. Mode: Parity     0:odd / 1:even */
1322
#define UCMSB                  (0x20)         /* Async. Mode: MSB first  0:LSB / 1:MSB */
1323
#define UC7BIT                 (0x10)         /* Async. Mode: Data Bits  0:8-bits / 1:7-bits */
1324
#define UCSPB                  (0x08)         /* Async. Mode: Stop Bits  0:one / 1: two */
1325
#define UCMODE1                (0x04)         /* Async. Mode: USCI Mode 1 */
1326
#define UCMODE0                (0x02)         /* Async. Mode: USCI Mode 0 */
1327
#define UCSYNC                 (0x01)         /* Sync-Mode  0:UART-Mode / 1:SPI-Mode */
1328
 
1329
// SPI-Mode Bits
1330
#define UCCKPH                 (0x80)         /* Sync. Mode: Clock Phase */
1331
#define UCCKPL                 (0x40)         /* Sync. Mode: Clock Polarity */
1332
#define UCMST                  (0x08)         /* Sync. Mode: Master Select */
1333
 
1334
// I2C-Mode Bits
1335
#define UCA10                  (0x80)         /* 10-bit Address Mode */
1336
#define UCSLA10                (0x40)         /* 10-bit Slave Address Mode */
1337
#define UCMM                   (0x20)         /* Multi-Master Environment */
1338
//#define res               (0x10)    /* reserved */
1339
#define UCMODE_0               (0x00)         /* Sync. Mode: USCI Mode: 0 */
1340
#define UCMODE_1               (0x02)         /* Sync. Mode: USCI Mode: 1 */
1341
#define UCMODE_2               (0x04)         /* Sync. Mode: USCI Mode: 2 */
1342
#define UCMODE_3               (0x06)         /* Sync. Mode: USCI Mode: 3 */
1343
 
1344
// UART-Mode Bits
1345
#define UCSSEL1                (0x80)         /* USCI 0 Clock Source Select 1 */
1346
#define UCSSEL0                (0x40)         /* USCI 0 Clock Source Select 0 */
1347
#define UCRXEIE                (0x20)         /* RX Error interrupt enable */
1348
#define UCBRKIE                (0x10)         /* Break interrupt enable */
1349
#define UCDORM                 (0x08)         /* Dormant (Sleep) Mode */
1350
#define UCTXADDR               (0x04)         /* Send next Data as Address */
1351
#define UCTXBRK                (0x02)         /* Send next Data as Break */
1352
#define UCSWRST                (0x01)         /* USCI Software Reset */
1353
 
1354
// SPI-Mode Bits
1355
//#define res               (0x20)    /* reserved */
1356
//#define res               (0x10)    /* reserved */
1357
//#define res               (0x08)    /* reserved */
1358
//#define res               (0x04)    /* reserved */
1359
//#define res               (0x02)    /* reserved */
1360
 
1361
// I2C-Mode Bits
1362
//#define res               (0x20)    /* reserved */
1363
#define UCTR                   (0x10)         /* Transmit/Receive Select/Flag */
1364
#define UCTXNACK               (0x08)         /* Transmit NACK */
1365
#define UCTXSTP                (0x04)         /* Transmit STOP */
1366
#define UCTXSTT                (0x02)         /* Transmit START */
1367
#define UCSSEL_0               (0x00)         /* USCI 0 Clock Source: 0 */
1368
#define UCSSEL_1               (0x40)         /* USCI 0 Clock Source: 1 */
1369
#define UCSSEL_2               (0x80)         /* USCI 0 Clock Source: 2 */
1370
#define UCSSEL_3               (0xC0)         /* USCI 0 Clock Source: 3 */
1371
 
1372
#define UCBRF3                 (0x80)         /* USCI First Stage Modulation Select 3 */
1373
#define UCBRF2                 (0x40)         /* USCI First Stage Modulation Select 2 */
1374
#define UCBRF1                 (0x20)         /* USCI First Stage Modulation Select 1 */
1375
#define UCBRF0                 (0x10)         /* USCI First Stage Modulation Select 0 */
1376
#define UCBRS2                 (0x08)         /* USCI Second Stage Modulation Select 2 */
1377
#define UCBRS1                 (0x04)         /* USCI Second Stage Modulation Select 1 */
1378
#define UCBRS0                 (0x02)         /* USCI Second Stage Modulation Select 0 */
1379
#define UCOS16                 (0x01)         /* USCI 16-times Oversampling enable */
1380
 
1381
#define UCBRF_0                (0x00)         /* USCI First Stage Modulation: 0 */
1382
#define UCBRF_1                (0x10)         /* USCI First Stage Modulation: 1 */
1383
#define UCBRF_2                (0x20)         /* USCI First Stage Modulation: 2 */
1384
#define UCBRF_3                (0x30)         /* USCI First Stage Modulation: 3 */
1385
#define UCBRF_4                (0x40)         /* USCI First Stage Modulation: 4 */
1386
#define UCBRF_5                (0x50)         /* USCI First Stage Modulation: 5 */
1387
#define UCBRF_6                (0x60)         /* USCI First Stage Modulation: 6 */
1388
#define UCBRF_7                (0x70)         /* USCI First Stage Modulation: 7 */
1389
#define UCBRF_8                (0x80)         /* USCI First Stage Modulation: 8 */
1390
#define UCBRF_9                (0x90)         /* USCI First Stage Modulation: 9 */
1391
#define UCBRF_10               (0xA0)         /* USCI First Stage Modulation: A */
1392
#define UCBRF_11               (0xB0)         /* USCI First Stage Modulation: B */
1393
#define UCBRF_12               (0xC0)         /* USCI First Stage Modulation: C */
1394
#define UCBRF_13               (0xD0)         /* USCI First Stage Modulation: D */
1395
#define UCBRF_14               (0xE0)         /* USCI First Stage Modulation: E */
1396
#define UCBRF_15               (0xF0)         /* USCI First Stage Modulation: F */
1397
 
1398
#define UCBRS_0                (0x00)         /* USCI Second Stage Modulation: 0 */
1399
#define UCBRS_1                (0x02)         /* USCI Second Stage Modulation: 1 */
1400
#define UCBRS_2                (0x04)         /* USCI Second Stage Modulation: 2 */
1401
#define UCBRS_3                (0x06)         /* USCI Second Stage Modulation: 3 */
1402
#define UCBRS_4                (0x08)         /* USCI Second Stage Modulation: 4 */
1403
#define UCBRS_5                (0x0A)         /* USCI Second Stage Modulation: 5 */
1404
#define UCBRS_6                (0x0C)         /* USCI Second Stage Modulation: 6 */
1405
#define UCBRS_7                (0x0E)         /* USCI Second Stage Modulation: 7 */
1406
 
1407
#define UCLISTEN               (0x80)         /* USCI Listen mode */
1408
#define UCFE                   (0x40)         /* USCI Frame Error Flag */
1409
#define UCOE                   (0x20)         /* USCI Overrun Error Flag */
1410
#define UCPE                   (0x10)         /* USCI Parity Error Flag */
1411
#define UCBRK                  (0x08)         /* USCI Break received */
1412
#define UCRXERR                (0x04)         /* USCI RX Error Flag */
1413
#define UCADDR                 (0x02)         /* USCI Address received Flag */
1414
#define UCBUSY                 (0x01)         /* USCI Busy Flag */
1415
#define UCIDLE                 (0x02)         /* USCI Idle line detected Flag */
1416
 
1417
//#define res               (0x80)    /* reserved */
1418
//#define res               (0x40)    /* reserved */
1419
//#define res               (0x20)    /* reserved */
1420
//#define res               (0x10)    /* reserved */
1421
#define UCNACKIE               (0x08)         /* NACK Condition interrupt enable */
1422
#define UCSTPIE                (0x04)         /* STOP Condition interrupt enable */
1423
#define UCSTTIE                (0x02)         /* START Condition interrupt enable */
1424
#define UCALIE                 (0x01)         /* Arbitration Lost interrupt enable */
1425
 
1426
#define UCSCLLOW               (0x40)         /* SCL low */
1427
#define UCGC                   (0x20)         /* General Call address received Flag */
1428
#define UCBBUSY                (0x10)         /* Bus Busy Flag */
1429
#define UCNACKIFG              (0x08)         /* NAK Condition interrupt Flag */
1430
#define UCSTPIFG               (0x04)         /* STOP Condition interrupt Flag */
1431
#define UCSTTIFG               (0x02)         /* START Condition interrupt Flag */
1432
#define UCALIFG                (0x01)         /* Arbitration Lost interrupt Flag */
1433
 
1434
#define UCIRTXPL5              (0x80)         /* IRDA Transmit Pulse Length 5 */
1435
#define UCIRTXPL4              (0x40)         /* IRDA Transmit Pulse Length 4 */
1436
#define UCIRTXPL3              (0x20)         /* IRDA Transmit Pulse Length 3 */
1437
#define UCIRTXPL2              (0x10)         /* IRDA Transmit Pulse Length 2 */
1438
#define UCIRTXPL1              (0x08)         /* IRDA Transmit Pulse Length 1 */
1439
#define UCIRTXPL0              (0x04)         /* IRDA Transmit Pulse Length 0 */
1440
#define UCIRTXCLK              (0x02)         /* IRDA Transmit Pulse Clock Select */
1441
#define UCIREN                 (0x01)         /* IRDA Encoder/Decoder enable */
1442
 
1443
#define UCIRRXFL5              (0x80)         /* IRDA Receive Filter Length 5 */
1444
#define UCIRRXFL4              (0x40)         /* IRDA Receive Filter Length 4 */
1445
#define UCIRRXFL3              (0x20)         /* IRDA Receive Filter Length 3 */
1446
#define UCIRRXFL2              (0x10)         /* IRDA Receive Filter Length 2 */
1447
#define UCIRRXFL1              (0x08)         /* IRDA Receive Filter Length 1 */
1448
#define UCIRRXFL0              (0x04)         /* IRDA Receive Filter Length 0 */
1449
#define UCIRRXPL               (0x02)         /* IRDA Receive Input Polarity */
1450
#define UCIRRXFE               (0x01)         /* IRDA Receive Filter enable */
1451
 
1452
//#define res               (0x80)    /* reserved */
1453
//#define res               (0x40)    /* reserved */
1454
#define UCDELIM1               (0x20)         /* Break Sync Delimiter 1 */
1455
#define UCDELIM0               (0x10)         /* Break Sync Delimiter 0 */
1456
#define UCSTOE                 (0x08)         /* Sync-Field Timeout error */
1457
#define UCBTOE                 (0x04)         /* Break Timeout error */
1458
//#define res               (0x02)    /* reserved */
1459
#define UCABDEN                (0x01)         /* Auto Baud Rate detect enable */
1460
 
1461
#define UCGCEN                 (0x8000)       /* I2C General Call enable */
1462
#define UCOA9                  (0x0200)       /* I2C Own Address 9 */
1463
#define UCOA8                  (0x0100)       /* I2C Own Address 8 */
1464
#define UCOA7                  (0x0080)       /* I2C Own Address 7 */
1465
#define UCOA6                  (0x0040)       /* I2C Own Address 6 */
1466
#define UCOA5                  (0x0020)       /* I2C Own Address 5 */
1467
#define UCOA4                  (0x0010)       /* I2C Own Address 4 */
1468
#define UCOA3                  (0x0008)       /* I2C Own Address 3 */
1469
#define UCOA2                  (0x0004)       /* I2C Own Address 2 */
1470
#define UCOA1                  (0x0002)       /* I2C Own Address 1 */
1471
#define UCOA0                  (0x0001)       /* I2C Own Address 0 */
1472
 
1473
#define UCSA9                  (0x0200)       /* I2C Slave Address 9 */
1474
#define UCSA8                  (0x0100)       /* I2C Slave Address 8 */
1475
#define UCSA7                  (0x0080)       /* I2C Slave Address 7 */
1476
#define UCSA6                  (0x0040)       /* I2C Slave Address 6 */
1477
#define UCSA5                  (0x0020)       /* I2C Slave Address 5 */
1478
#define UCSA4                  (0x0010)       /* I2C Slave Address 4 */
1479
#define UCSA3                  (0x0008)       /* I2C Slave Address 3 */
1480
#define UCSA2                  (0x0004)       /* I2C Slave Address 2 */
1481
#define UCSA1                  (0x0002)       /* I2C Slave Address 1 */
1482
#define UCSA0                  (0x0001)       /* I2C Slave Address 0 */
1483
 
1484
/************************************************************
1485
* USART
1486
************************************************************/
1487
 
1488
/* UxCTL */
1489
#define PENA                   (0x80)         /* Parity enable */
1490
#define PEV                    (0x40)         /* Parity 0:odd / 1:even */
1491
#define SPB                    (0x20)         /* Stop Bits 0:one / 1: two */
1492
#define CHAR                   (0x10)         /* Data 0:7-bits / 1:8-bits */
1493
#define LISTEN                 (0x08)         /* Listen mode */
1494
#define SYNC                   (0x04)         /* UART / SPI mode */
1495
#define MM                     (0x02)         /* Master Mode off/on */
1496
#define SWRST                  (0x01)         /* USART Software Reset */
1497
 
1498
/* UxTCTL */
1499
#define CKPH                   (0x80)         /* SPI: Clock Phase */
1500
#define CKPL                   (0x40)         /* Clock Polarity */
1501
#define SSEL1                  (0x20)         /* Clock Source Select 1 */
1502
#define SSEL0                  (0x10)         /* Clock Source Select 0 */
1503
#define URXSE                  (0x08)         /* Receive Start edge select */
1504
#define TXWAKE                 (0x04)         /* TX Wake up mode */
1505
#define STC                    (0x02)         /* SPI: STC enable 0:on / 1:off */
1506
#define TXEPT                  (0x01)         /* TX Buffer empty */
1507
 
1508
/* UxRCTL */
1509
#define FE                     (0x80)         /* Frame Error */
1510
#define PE                     (0x40)         /* Parity Error */
1511
#define OE                     (0x20)         /* Overrun Error */
1512
#define BRK                    (0x10)         /* Break detected */
1513
#define URXEIE                 (0x08)         /* RX Error interrupt enable */
1514
#define URXWIE                 (0x04)         /* RX Wake up interrupt enable */
1515
#define RXWAKE                 (0x02)         /* RX Wake up detect */
1516
#define RXERR                  (0x01)         /* RX Error Error */
1517
 
1518
/************************************************************
1519
* USART 1
1520
************************************************************/
1521
#define __MSP430_HAS_UART1__                  /* Definition to show that Module is available */
1522
 
1523
SFR_8BIT(U1CTL);                              /* USART 1 Control */
1524
SFR_8BIT(U1TCTL);                             /* USART 1 Transmit Control */
1525
SFR_8BIT(U1RCTL);                             /* USART 1 Receive Control */
1526
SFR_8BIT(U1MCTL);                             /* USART 1 Modulation Control */
1527
SFR_8BIT(U1BR0);                              /* USART 1 Baud Rate 0 */
1528
SFR_8BIT(U1BR1);                              /* USART 1 Baud Rate 1 */
1529
SFR_8BIT(U1RXBUF);                            /* USART 1 Receive Buffer */
1530
SFR_8BIT(U1TXBUF);                            /* USART 1 Transmit Buffer */
1531
 
1532
/* Alternate register names */
1533
 
1534
#define UCTL1                  U1CTL          /* USART 1 Control */
1535
#define UTCTL1                 U1TCTL         /* USART 1 Transmit Control */
1536
#define URCTL1                 U1RCTL         /* USART 1 Receive Control */
1537
#define UMCTL1                 U1MCTL         /* USART 1 Modulation Control */
1538
#define UBR01                  U1BR0          /* USART 1 Baud Rate 0 */
1539
#define UBR11                  U1BR1          /* USART 1 Baud Rate 1 */
1540
#define RXBUF1                 U1RXBUF        /* USART 1 Receive Buffer */
1541
#define TXBUF1                 U1TXBUF        /* USART 1 Transmit Buffer */
1542
#define UCTL1_                 U1CTL_         /* USART 1 Control */
1543
#define UTCTL1_                U1TCTL_        /* USART 1 Transmit Control */
1544
#define URCTL1_                U1RCTL_        /* USART 1 Receive Control */
1545
#define UMCTL1_                U1MCTL_        /* USART 1 Modulation Control */
1546
#define UBR01_                 U1BR0_         /* USART 1 Baud Rate 0 */
1547
#define UBR11_                 U1BR1_         /* USART 1 Baud Rate 1 */
1548
#define RXBUF1_                U1RXBUF_       /* USART 1 Receive Buffer */
1549
#define TXBUF1_                U1TXBUF_       /* USART 1 Transmit Buffer */
1550
#define UCTL_1                 U1CTL          /* USART 1 Control */
1551
#define UTCTL_1                U1TCTL         /* USART 1 Transmit Control */
1552
#define URCTL_1                U1RCTL         /* USART 1 Receive Control */
1553
#define UMCTL_1                U1MCTL         /* USART 1 Modulation Control */
1554
#define UBR0_1                 U1BR0          /* USART 1 Baud Rate 0 */
1555
#define UBR1_1                 U1BR1          /* USART 1 Baud Rate 1 */
1556
#define RXBUF_1                U1RXBUF        /* USART 1 Receive Buffer */
1557
#define TXBUF_1                U1TXBUF        /* USART 1 Transmit Buffer */
1558
#define UCTL_1_                U1CTL_         /* USART 1 Control */
1559
#define UTCTL_1_               U1TCTL_        /* USART 1 Transmit Control */
1560
#define URCTL_1_               U1RCTL_        /* USART 1 Receive Control */
1561
#define UMCTL_1_               U1MCTL_        /* USART 1 Modulation Control */
1562
#define UBR0_1_                U1BR0_         /* USART 1 Baud Rate 0 */
1563
#define UBR1_1_                U1BR1_         /* USART 1 Baud Rate 1 */
1564
#define RXBUF_1_               U1RXBUF_       /* USART 1 Receive Buffer */
1565
#define TXBUF_1_               U1TXBUF_       /* USART 1 Transmit Buffer */
1566
 
1567
/************************************************************
1568
* WATCHDOG TIMER
1569
************************************************************/
1570
#define __MSP430_HAS_WDT__                    /* Definition to show that Module is available */
1571
 
1572
SFR_16BIT(WDTCTL);                            /* Watchdog Timer Control */
1573
/* The bit names have been prefixed with "WDT" */
1574
#define WDTIS0                 (0x0001)
1575
#define WDTIS1                 (0x0002)
1576
#define WDTSSEL                (0x0004)
1577
#define WDTCNTCL               (0x0008)
1578
#define WDTTMSEL               (0x0010)
1579
#define WDTNMI                 (0x0020)
1580
#define WDTNMIES               (0x0040)
1581
#define WDTHOLD                (0x0080)
1582
 
1583
#define WDTPW                  (0x5A00)
1584
 
1585
/* WDT-interval times [1ms] coded with Bits 0-2 */
1586
/* WDT is clocked by fSMCLK (assumed 1MHz) */
1587
#define WDT_MDLY_32         (WDTPW+WDTTMSEL+WDTCNTCL)                         /* 32ms interval (default) */
1588
#define WDT_MDLY_8          (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS0)                  /* 8ms     " */
1589
#define WDT_MDLY_0_5        (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS1)                  /* 0.5ms   " */
1590
#define WDT_MDLY_0_064      (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS1+WDTIS0)           /* 0.064ms " */
1591
/* WDT is clocked by fACLK (assumed 32KHz) */
1592
#define WDT_ADLY_1000       (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL)                 /* 1000ms  " */
1593
#define WDT_ADLY_250        (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS0)          /* 250ms   " */
1594
#define WDT_ADLY_16         (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS1)          /* 16ms    " */
1595
#define WDT_ADLY_1_9        (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS1+WDTIS0)   /* 1.9ms   " */
1596
/* Watchdog mode -> reset after expired time */
1597
/* WDT is clocked by fSMCLK (assumed 1MHz) */
1598
#define WDT_MRST_32         (WDTPW+WDTCNTCL)                                  /* 32ms interval (default) */
1599
#define WDT_MRST_8          (WDTPW+WDTCNTCL+WDTIS0)                           /* 8ms     " */
1600
#define WDT_MRST_0_5        (WDTPW+WDTCNTCL+WDTIS1)                           /* 0.5ms   " */
1601
#define WDT_MRST_0_064      (WDTPW+WDTCNTCL+WDTIS1+WDTIS0)                    /* 0.064ms " */
1602
/* WDT is clocked by fACLK (assumed 32KHz) */
1603
#define WDT_ARST_1000       (WDTPW+WDTCNTCL+WDTSSEL)                          /* 1000ms  " */
1604
#define WDT_ARST_250        (WDTPW+WDTCNTCL+WDTSSEL+WDTIS0)                   /* 250ms   " */
1605
#define WDT_ARST_16         (WDTPW+WDTCNTCL+WDTSSEL+WDTIS1)                   /* 16ms    " */
1606
#define WDT_ARST_1_9        (WDTPW+WDTCNTCL+WDTSSEL+WDTIS1+WDTIS0)            /* 1.9ms   " */
1607
 
1608
/* INTERRUPT CONTROL */
1609
/* These two bits are defined in the Special Function Registers */
1610
/* #define WDTIE               0x01 */
1611
/* #define WDTIFG              0x01 */
1612
 
1613
/************************************************************
1614
* Interrupt Vectors (offset from 0xFFC0)
1615
************************************************************/
1616
 
1617
#pragma diag_suppress 1107
1618
#define VECTOR_NAME(name)             name##_ptr
1619
#define EMIT_PRAGMA(x)                _Pragma(#x)
1620
#define CREATE_VECTOR(name)           void * const VECTOR_NAME(name) = (void *)(long)&name
1621
#define PLACE_VECTOR(vector,section)  EMIT_PRAGMA(DATA_SECTION(vector,section))
1622
#define PLACE_INTERRUPT(func)         EMIT_PRAGMA(CODE_SECTION(func,".text:_isr"))
1623
#define ISR_VECTOR(func,offset)       CREATE_VECTOR(func); \
1624
                                      PLACE_VECTOR(VECTOR_NAME(func), offset) \
1625
                                      PLACE_INTERRUPT(func)
1626
 
1627
 
1628
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1629
#define DMA_VECTOR              ".int15"                    /* 0xFFDE DMA */
1630
#else
1631
#define DMA_VECTOR              (15 * 1u)                    /* 0xFFDE DMA */
1632
/*#define DMA_ISR(func)           ISR_VECTOR(func, ".int15")  */ /* 0xFFDE DMA */ /* CCE V2 Style */
1633
#endif
1634
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1635
#define BASICTIMER_VECTOR       ".int16"                    /* 0xFFE0 Basic Timer / RTC */
1636
#else
1637
#define BASICTIMER_VECTOR       (16 * 1u)                    /* 0xFFE0 Basic Timer / RTC */
1638
/*#define BASICTIMER_ISR(func)    ISR_VECTOR(func, ".int16")  */ /* 0xFFE0 Basic Timer / RTC */ /* CCE V2 Style */
1639
#endif
1640
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1641
#define PORT2_VECTOR            ".int17"                    /* 0xFFE2 Port 2 */
1642
#else
1643
#define PORT2_VECTOR            (17 * 1u)                    /* 0xFFE2 Port 2 */
1644
/*#define PORT2_ISR(func)         ISR_VECTOR(func, ".int17")  */ /* 0xFFE2 Port 2 */ /* CCE V2 Style */
1645
#endif
1646
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1647
#define USART1TX_VECTOR         ".int18"                    /* 0xFFE4 USART 1 Transmit */
1648
#else
1649
#define USART1TX_VECTOR         (18 * 1u)                    /* 0xFFE4 USART 1 Transmit */
1650
/*#define USART1TX_ISR(func)      ISR_VECTOR(func, ".int18")  */ /* 0xFFE4 USART 1 Transmit */ /* CCE V2 Style */
1651
#endif
1652
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1653
#define USART1RX_VECTOR         ".int19"                    /* 0xFFE6 USART 1 Receive */
1654
#else
1655
#define USART1RX_VECTOR         (19 * 1u)                    /* 0xFFE6 USART 1 Receive */
1656
/*#define USART1RX_ISR(func)      ISR_VECTOR(func, ".int19")  */ /* 0xFFE6 USART 1 Receive */ /* CCE V2 Style */
1657
#endif
1658
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1659
#define PORT1_VECTOR            ".int20"                    /* 0xFFE8 Port 1 */
1660
#else
1661
#define PORT1_VECTOR            (20 * 1u)                    /* 0xFFE8 Port 1 */
1662
/*#define PORT1_ISR(func)         ISR_VECTOR(func, ".int20")  */ /* 0xFFE8 Port 1 */ /* CCE V2 Style */
1663
#endif
1664
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1665
#define TIMERA1_VECTOR          ".int21"                    /* 0xFFEA Timer A CC1-2, TA */
1666
#else
1667
#define TIMERA1_VECTOR          (21 * 1u)                    /* 0xFFEA Timer A CC1-2, TA */
1668
/*#define TIMERA1_ISR(func)       ISR_VECTOR(func, ".int21")  */ /* 0xFFEA Timer A CC1-2, TA */ /* CCE V2 Style */
1669
#endif
1670
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1671
#define TIMERA0_VECTOR          ".int22"                    /* 0xFFEC Timer A CC0 */
1672
#else
1673
#define TIMERA0_VECTOR          (22 * 1u)                    /* 0xFFEC Timer A CC0 */
1674
/*#define TIMERA0_ISR(func)       ISR_VECTOR(func, ".int22")  */ /* 0xFFEC Timer A CC0 */ /* CCE V2 Style */
1675
#endif
1676
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1677
#define ADC12_VECTOR            ".int23"                    /* 0xFFEE ADC */
1678
#else
1679
#define ADC12_VECTOR            (23 * 1u)                    /* 0xFFEE ADC */
1680
/*#define ADC12_ISR(func)         ISR_VECTOR(func, ".int23")  */ /* 0xFFEE ADC */ /* CCE V2 Style */
1681
#endif
1682
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1683
#define USCIAB0TX_VECTOR        ".int24"                    /* 0xFFF0 USCI A0/B0 Transmit */
1684
#else
1685
#define USCIAB0TX_VECTOR        (24 * 1u)                    /* 0xFFF0 USCI A0/B0 Transmit */
1686
/*#define USCIAB0TX_ISR(func)     ISR_VECTOR(func, ".int24")  */ /* 0xFFF0 USCI A0/B0 Transmit */ /* CCE V2 Style */
1687
#endif
1688
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1689
#define USCIAB0RX_VECTOR        ".int25"                    /* 0xFFF2 USCI A0/B0 Receive */
1690
#else
1691
#define USCIAB0RX_VECTOR        (25 * 1u)                    /* 0xFFF2 USCI A0/B0 Receive */
1692
/*#define USCIAB0RX_ISR(func)     ISR_VECTOR(func, ".int25")  */ /* 0xFFF2 USCI A0/B0 Receive */ /* CCE V2 Style */
1693
#endif
1694
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1695
#define WDT_VECTOR              ".int26"                    /* 0xFFF4 Watchdog Timer */
1696
#else
1697
#define WDT_VECTOR              (26 * 1u)                    /* 0xFFF4 Watchdog Timer */
1698
/*#define WDT_ISR(func)           ISR_VECTOR(func, ".int26")  */ /* 0xFFF4 Watchdog Timer */ /* CCE V2 Style */
1699
#endif
1700
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1701
#define COMPARATORA_VECTOR      ".int27"                    /* 0xFFF6 Comparator A */
1702
#else
1703
#define COMPARATORA_VECTOR      (27 * 1u)                    /* 0xFFF6 Comparator A */
1704
/*#define COMPARATORA_ISR(func)   ISR_VECTOR(func, ".int27")  */ /* 0xFFF6 Comparator A */ /* CCE V2 Style */
1705
#endif
1706
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1707
#define TIMERB1_VECTOR          ".int28"                    /* 0xFFF8 Timer B CC1-2, TB */
1708
#else
1709
#define TIMERB1_VECTOR          (28 * 1u)                    /* 0xFFF8 Timer B CC1-2, TB */
1710
/*#define TIMERB1_ISR(func)       ISR_VECTOR(func, ".int28")  */ /* 0xFFF8 Timer B CC1-2, TB */ /* CCE V2 Style */
1711
#endif
1712
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1713
#define TIMERB0_VECTOR          ".int29"                    /* 0xFFFA Timer B CC0 */
1714
#else
1715
#define TIMERB0_VECTOR          (29 * 1u)                    /* 0xFFFA Timer B CC0 */
1716
/*#define TIMERB0_ISR(func)       ISR_VECTOR(func, ".int29")  */ /* 0xFFFA Timer B CC0 */ /* CCE V2 Style */
1717
#endif
1718
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1719
#define NMI_VECTOR              ".int30"                    /* 0xFFFC Non-maskable */
1720
#else
1721
#define NMI_VECTOR              (30 * 1u)                    /* 0xFFFC Non-maskable */
1722
/*#define NMI_ISR(func)           ISR_VECTOR(func, ".int30")  */ /* 0xFFFC Non-maskable */ /* CCE V2 Style */
1723
#endif
1724
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1725
#define RESET_VECTOR            ".reset"                    /* 0xFFFE Reset [Highest Priority] */
1726
#else
1727
#define RESET_VECTOR            (31 * 1u)                    /* 0xFFFE Reset [Highest Priority] */
1728
/*#define RESET_ISR(func)         ISR_VECTOR(func, ".int31")  */ /* 0xFFFE Reset [Highest Priority] */ /* CCE V2 Style */
1729
#endif
1730
 
1731
/************************************************************
1732
* End of Modules
1733
************************************************************/
1734
 
1735
#ifdef __cplusplus
1736
}
1737
#endif /* extern "C" */
1738
 
1739
#endif /* #ifndef __msp430x46x */
1740