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
* MSP430x24x and MSP430x2410 devices.
8
*
9
* Texas Instruments, Version 1.4
10
*
11
* Rev. 1.0, Initial Version
12
* Rev. 1.1  added TLV in INFO Memory
13
* Rev. 1.2, added definitions for Interrupt Vectors xxIV
14
* Rev. 1.4, fixed define: TAG_ADC12_1 to 0x08
15
*
16
********************************************************************/
17
 
18
#ifndef __msp430x24x
19
#define __msp430x24x
20
 
21
#ifdef __cplusplus
22
extern "C" {
23
#endif
24
 
25
 
26
/*----------------------------------------------------------------------------*/
27
/* PERIPHERAL FILE MAP                                                        */
28
/*----------------------------------------------------------------------------*/
29
 
30
/* External references resolved by a device-specific linker command file */
31
#define SFR_8BIT(address)   extern volatile unsigned char address
32
#define SFR_16BIT(address)  extern volatile unsigned int address
33
 
34
 
35
/************************************************************
36
* STANDARD BITS
37
************************************************************/
38
 
39
#define BIT0                   (0x0001)
40
#define BIT1                   (0x0002)
41
#define BIT2                   (0x0004)
42
#define BIT3                   (0x0008)
43
#define BIT4                   (0x0010)
44
#define BIT5                   (0x0020)
45
#define BIT6                   (0x0040)
46
#define BIT7                   (0x0080)
47
#define BIT8                   (0x0100)
48
#define BIT9                   (0x0200)
49
#define BITA                   (0x0400)
50
#define BITB                   (0x0800)
51
#define BITC                   (0x1000)
52
#define BITD                   (0x2000)
53
#define BITE                   (0x4000)
54
#define BITF                   (0x8000)
55
 
56
/************************************************************
57
* STATUS REGISTER BITS
58
************************************************************/
59
 
60
#define C                      (0x0001)
61
#define Z                      (0x0002)
62
#define N                      (0x0004)
63
#define V                      (0x0100)
64
#define GIE                    (0x0008)
65
#define CPUOFF                 (0x0010)
66
#define OSCOFF                 (0x0020)
67
#define SCG0                   (0x0040)
68
#define SCG1                   (0x0080)
69
 
70
/* Low Power Modes coded with Bits 4-7 in SR */
71
 
72
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
73
#define LPM0                   (CPUOFF)
74
#define LPM1                   (SCG0+CPUOFF)
75
#define LPM2                   (SCG1+CPUOFF)
76
#define LPM3                   (SCG1+SCG0+CPUOFF)
77
#define LPM4                   (SCG1+SCG0+OSCOFF+CPUOFF)
78
/* End #defines for assembler */
79
 
80
#else /* Begin #defines for C */
81
#define LPM0_bits              (CPUOFF)
82
#define LPM1_bits              (SCG0+CPUOFF)
83
#define LPM2_bits              (SCG1+CPUOFF)
84
#define LPM3_bits              (SCG1+SCG0+CPUOFF)
85
#define LPM4_bits              (SCG1+SCG0+OSCOFF+CPUOFF)
86
 
87
#include "in430.h"
88
 
89
#define LPM0         _bis_SR_register(LPM0_bits)         /* Enter Low Power Mode 0 */
90
#define LPM0_EXIT    _bic_SR_register_on_exit(LPM0_bits) /* Exit Low Power Mode 0 */
91
#define LPM1         _bis_SR_register(LPM1_bits)         /* Enter Low Power Mode 1 */
92
#define LPM1_EXIT    _bic_SR_register_on_exit(LPM1_bits) /* Exit Low Power Mode 1 */
93
#define LPM2         _bis_SR_register(LPM2_bits)         /* Enter Low Power Mode 2 */
94
#define LPM2_EXIT    _bic_SR_register_on_exit(LPM2_bits) /* Exit Low Power Mode 2 */
95
#define LPM3         _bis_SR_register(LPM3_bits)         /* Enter Low Power Mode 3 */
96
#define LPM3_EXIT    _bic_SR_register_on_exit(LPM3_bits) /* Exit Low Power Mode 3 */
97
#define LPM4         _bis_SR_register(LPM4_bits)         /* Enter Low Power Mode 4 */
98
#define LPM4_EXIT    _bic_SR_register_on_exit(LPM4_bits) /* Exit Low Power Mode 4 */
99
#endif /* End #defines for C */
100
 
101
/************************************************************
102
* PERIPHERAL FILE MAP
103
************************************************************/
104
 
105
/************************************************************
106
* SPECIAL FUNCTION REGISTER ADDRESSES + CONTROL BITS
107
************************************************************/
108
 
109
SFR_8BIT(IE1);                                /* Interrupt Enable 1 */
110
#define WDTIE                  (0x01)         /* Watchdog Interrupt Enable */
111
#define OFIE                   (0x02)         /* Osc. Fault  Interrupt Enable */
112
#define NMIIE                  (0x10)         /* NMI Interrupt Enable */
113
#define ACCVIE                 (0x20)         /* Flash Access Violation Interrupt Enable */
114
 
115
SFR_8BIT(IFG1);                               /* Interrupt Flag 1 */
116
#define WDTIFG                 (0x01)         /* Watchdog Interrupt Flag */
117
#define OFIFG                  (0x02)         /* Osc. Fault Interrupt Flag */
118
#define PORIFG                 (0x04)         /* Power On Interrupt Flag */
119
#define RSTIFG                 (0x08)         /* Reset Interrupt Flag */
120
#define NMIIFG                 (0x10)         /* NMI Interrupt Flag */
121
 
122
SFR_8BIT(IE2);                                /* Interrupt Enable 2 */
123
#define UC0IE                  IE2
124
#define UCA0RXIE               (0x01)
125
#define UCA0TXIE               (0x02)
126
#define UCB0RXIE               (0x04)
127
#define UCB0TXIE               (0x08)
128
 
129
SFR_8BIT(IFG2);                               /* Interrupt Flag 2 */
130
#define UC0IFG                 IFG2
131
#define UCA0RXIFG              (0x01)
132
#define UCA0TXIFG              (0x02)
133
#define UCB0RXIFG              (0x04)
134
#define UCB0TXIFG              (0x08)
135
 
136
SFR_8BIT(UC1IE);                              /* USCI 1 Interrupt Enable */
137
#define UCA1RXIE               (0x01)
138
#define UCA1TXIE               (0x02)
139
#define UCB1RXIE               (0x04)
140
#define UCB1TXIE               (0x08)
141
 
142
SFR_8BIT(UC1IFG);                             /* ISCI 1 Interrupt Flags */
143
#define UCA1RXIFG              (0x01)
144
#define UCA1TXIFG              (0x02)
145
#define UCB1RXIFG              (0x04)
146
#define UCB1TXIFG              (0x08)
147
 
148
/************************************************************
149
* ADC12
150
************************************************************/
151
#define __MSP430_HAS_ADC12__                  /* Definition to show that Module is available */
152
 
153
SFR_16BIT(ADC12CTL0);                         /* ADC12 Control 0 */
154
SFR_16BIT(ADC12CTL1);                         /* ADC12 Control 1 */
155
SFR_16BIT(ADC12IFG);                          /* ADC12 Interrupt Flag */
156
SFR_16BIT(ADC12IE);                           /* ADC12 Interrupt Enable */
157
SFR_16BIT(ADC12IV);                           /* ADC12 Interrupt Vector Word */
158
 
159
#define ADC12MEM_              (0x0140)       /* ADC12 Conversion Memory */
160
#ifdef __ASM_HEADER__
161
#define ADC12MEM               (ADC12MEM_)    /* ADC12 Conversion Memory (for assembler) */
162
#else
163
#define ADC12MEM               ((int*)        ADC12MEM_) /* ADC12 Conversion Memory (for C) */
164
#endif
165
SFR_16BIT(ADC12MEM0);                         /* ADC12 Conversion Memory 0 */
166
SFR_16BIT(ADC12MEM1);                         /* ADC12 Conversion Memory 1 */
167
SFR_16BIT(ADC12MEM2);                         /* ADC12 Conversion Memory 2 */
168
SFR_16BIT(ADC12MEM3);                         /* ADC12 Conversion Memory 3 */
169
SFR_16BIT(ADC12MEM4);                         /* ADC12 Conversion Memory 4 */
170
SFR_16BIT(ADC12MEM5);                         /* ADC12 Conversion Memory 5 */
171
SFR_16BIT(ADC12MEM6);                         /* ADC12 Conversion Memory 6 */
172
SFR_16BIT(ADC12MEM7);                         /* ADC12 Conversion Memory 7 */
173
SFR_16BIT(ADC12MEM8);                         /* ADC12 Conversion Memory 8 */
174
SFR_16BIT(ADC12MEM9);                         /* ADC12 Conversion Memory 9 */
175
SFR_16BIT(ADC12MEM10);                        /* ADC12 Conversion Memory 10 */
176
SFR_16BIT(ADC12MEM11);                        /* ADC12 Conversion Memory 11 */
177
SFR_16BIT(ADC12MEM12);                        /* ADC12 Conversion Memory 12 */
178
SFR_16BIT(ADC12MEM13);                        /* ADC12 Conversion Memory 13 */
179
SFR_16BIT(ADC12MEM14);                        /* ADC12 Conversion Memory 14 */
180
SFR_16BIT(ADC12MEM15);                        /* ADC12 Conversion Memory 15 */
181
 
182
#define ADC12MCTL_             (0x0080)       /* ADC12 Memory Control */
183
#ifdef __ASM_HEADER__
184
#define ADC12MCTL              (ADC12MCTL_)   /* ADC12 Memory Control (for assembler) */
185
#else
186
#define ADC12MCTL              ((char*)       ADC12MCTL_) /* ADC12 Memory Control (for C) */
187
#endif
188
SFR_8BIT(ADC12MCTL0);                         /* ADC12 Memory Control 0 */
189
SFR_8BIT(ADC12MCTL1);                         /* ADC12 Memory Control 1 */
190
SFR_8BIT(ADC12MCTL2);                         /* ADC12 Memory Control 2 */
191
SFR_8BIT(ADC12MCTL3);                         /* ADC12 Memory Control 3 */
192
SFR_8BIT(ADC12MCTL4);                         /* ADC12 Memory Control 4 */
193
SFR_8BIT(ADC12MCTL5);                         /* ADC12 Memory Control 5 */
194
SFR_8BIT(ADC12MCTL6);                         /* ADC12 Memory Control 6 */
195
SFR_8BIT(ADC12MCTL7);                         /* ADC12 Memory Control 7 */
196
SFR_8BIT(ADC12MCTL8);                         /* ADC12 Memory Control 8 */
197
SFR_8BIT(ADC12MCTL9);                         /* ADC12 Memory Control 9 */
198
SFR_8BIT(ADC12MCTL10);                        /* ADC12 Memory Control 10 */
199
SFR_8BIT(ADC12MCTL11);                        /* ADC12 Memory Control 11 */
200
SFR_8BIT(ADC12MCTL12);                        /* ADC12 Memory Control 12 */
201
SFR_8BIT(ADC12MCTL13);                        /* ADC12 Memory Control 13 */
202
SFR_8BIT(ADC12MCTL14);                        /* ADC12 Memory Control 14 */
203
SFR_8BIT(ADC12MCTL15);                        /* ADC12 Memory Control 15 */
204
 
205
/* ADC12CTL0 */
206
#define ADC12SC                (0x001)        /* ADC12 Start Conversion */
207
#define ENC                    (0x002)        /* ADC12 Enable Conversion */
208
#define ADC12TOVIE             (0x004)        /* ADC12 Timer Overflow interrupt enable */
209
#define ADC12OVIE              (0x008)        /* ADC12 Overflow interrupt enable */
210
#define ADC12ON                (0x010)        /* ADC12 On/enable */
211
#define REFON                  (0x020)        /* ADC12 Reference on */
212
#define REF2_5V                (0x040)        /* ADC12 Ref 0:1.5V / 1:2.5V */
213
#define MSC                    (0x080)        /* ADC12 Multiple SampleConversion */
214
#define SHT00                  (0x0100)       /* ADC12 Sample Hold 0 Select 0 */
215
#define SHT01                  (0x0200)       /* ADC12 Sample Hold 0 Select 1 */
216
#define SHT02                  (0x0400)       /* ADC12 Sample Hold 0 Select 2 */
217
#define SHT03                  (0x0800)       /* ADC12 Sample Hold 0 Select 3 */
218
#define SHT10                  (0x1000)       /* ADC12 Sample Hold 0 Select 0 */
219
#define SHT11                  (0x2000)       /* ADC12 Sample Hold 1 Select 1 */
220
#define SHT12                  (0x4000)       /* ADC12 Sample Hold 2 Select 2 */
221
#define SHT13                  (0x8000)       /* ADC12 Sample Hold 3 Select 3 */
222
#define MSH                    (0x080)
223
 
224
#define SHT0_0                 (0*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 0 */
225
#define SHT0_1                 (1*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 1 */
226
#define SHT0_2                 (2*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 2 */
227
#define SHT0_3                 (3*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 3 */
228
#define SHT0_4                 (4*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 4 */
229
#define SHT0_5                 (5*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 5 */
230
#define SHT0_6                 (6*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 6 */
231
#define SHT0_7                 (7*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 7 */
232
#define SHT0_8                 (8*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 8 */
233
#define SHT0_9                 (9*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 9 */
234
#define SHT0_10                (10*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 10 */
235
#define SHT0_11                (11*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 11 */
236
#define SHT0_12                (12*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 12 */
237
#define SHT0_13                (13*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 13 */
238
#define SHT0_14                (14*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 14 */
239
#define SHT0_15                (15*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 15 */
240
 
241
#define SHT1_0                 (0*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 0 */
242
#define SHT1_1                 (1*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 1 */
243
#define SHT1_2                 (2*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 2 */
244
#define SHT1_3                 (3*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 3 */
245
#define SHT1_4                 (4*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 4 */
246
#define SHT1_5                 (5*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 5 */
247
#define SHT1_6                 (6*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 6 */
248
#define SHT1_7                 (7*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 7 */
249
#define SHT1_8                 (8*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 8 */
250
#define SHT1_9                 (9*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 9 */
251
#define SHT1_10                (10*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 10 */
252
#define SHT1_11                (11*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 11 */
253
#define SHT1_12                (12*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 12 */
254
#define SHT1_13                (13*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 13 */
255
#define SHT1_14                (14*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 14 */
256
#define SHT1_15                (15*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 15 */
257
 
258
/* ADC12CTL1 */
259
#define ADC12BUSY              (0x0001)       /* ADC12 Busy */
260
#define CONSEQ0                (0x0002)       /* ADC12 Conversion Sequence Select 0 */
261
#define CONSEQ1                (0x0004)       /* ADC12 Conversion Sequence Select 1 */
262
#define ADC12SSEL0             (0x0008)       /* ADC12 Clock Source Select 0 */
263
#define ADC12SSEL1             (0x0010)       /* ADC12 Clock Source Select 1 */
264
#define ADC12DIV0              (0x0020)       /* ADC12 Clock Divider Select 0 */
265
#define ADC12DIV1              (0x0040)       /* ADC12 Clock Divider Select 1 */
266
#define ADC12DIV2              (0x0080)       /* ADC12 Clock Divider Select 2 */
267
#define ISSH                   (0x0100)       /* ADC12 Invert Sample Hold Signal */
268
#define SHP                    (0x0200)       /* ADC12 Sample/Hold Pulse Mode */
269
#define SHS0                   (0x0400)       /* ADC12 Sample/Hold Source 0 */
270
#define SHS1                   (0x0800)       /* ADC12 Sample/Hold Source 1 */
271
#define CSTARTADD0             (0x1000)       /* ADC12 Conversion Start Address 0 */
272
#define CSTARTADD1             (0x2000)       /* ADC12 Conversion Start Address 1 */
273
#define CSTARTADD2             (0x4000)       /* ADC12 Conversion Start Address 2 */
274
#define CSTARTADD3             (0x8000)       /* ADC12 Conversion Start Address 3 */
275
 
276
#define CONSEQ_0               (0*2u)         /* ADC12 Conversion Sequence Select: 0 */
277
#define CONSEQ_1               (1*2u)         /* ADC12 Conversion Sequence Select: 1 */
278
#define CONSEQ_2               (2*2u)         /* ADC12 Conversion Sequence Select: 2 */
279
#define CONSEQ_3               (3*2u)         /* ADC12 Conversion Sequence Select: 3 */
280
#define ADC12SSEL_0            (0*8u)         /* ADC12 Clock Source Select: 0 */
281
#define ADC12SSEL_1            (1*8u)         /* ADC12 Clock Source Select: 1 */
282
#define ADC12SSEL_2            (2*8u)         /* ADC12 Clock Source Select: 2 */
283
#define ADC12SSEL_3            (3*8u)         /* ADC12 Clock Source Select: 3 */
284
#define ADC12DIV_0             (0*0x20u)      /* ADC12 Clock Divider Select: 0 */
285
#define ADC12DIV_1             (1*0x20u)      /* ADC12 Clock Divider Select: 1 */
286
#define ADC12DIV_2             (2*0x20u)      /* ADC12 Clock Divider Select: 2 */
287
#define ADC12DIV_3             (3*0x20u)      /* ADC12 Clock Divider Select: 3 */
288
#define ADC12DIV_4             (4*0x20u)      /* ADC12 Clock Divider Select: 4 */
289
#define ADC12DIV_5             (5*0x20u)      /* ADC12 Clock Divider Select: 5 */
290
#define ADC12DIV_6             (6*0x20u)      /* ADC12 Clock Divider Select: 6 */
291
#define ADC12DIV_7             (7*0x20u)      /* ADC12 Clock Divider Select: 7 */
292
#define SHS_0                  (0*0x400u)     /* ADC12 Sample/Hold Source: 0 */
293
#define SHS_1                  (1*0x400u)     /* ADC12 Sample/Hold Source: 1 */
294
#define SHS_2                  (2*0x400u)     /* ADC12 Sample/Hold Source: 2 */
295
#define SHS_3                  (3*0x400u)     /* ADC12 Sample/Hold Source: 3 */
296
#define CSTARTADD_0            (0*0x1000u)    /* ADC12 Conversion Start Address: 0 */
297
#define CSTARTADD_1            (1*0x1000u)    /* ADC12 Conversion Start Address: 1 */
298
#define CSTARTADD_2            (2*0x1000u)    /* ADC12 Conversion Start Address: 2 */
299
#define CSTARTADD_3            (3*0x1000u)    /* ADC12 Conversion Start Address: 3 */
300
#define CSTARTADD_4            (4*0x1000u)    /* ADC12 Conversion Start Address: 4 */
301
#define CSTARTADD_5            (5*0x1000u)    /* ADC12 Conversion Start Address: 5 */
302
#define CSTARTADD_6            (6*0x1000u)    /* ADC12 Conversion Start Address: 6 */
303
#define CSTARTADD_7            (7*0x1000u)    /* ADC12 Conversion Start Address: 7 */
304
#define CSTARTADD_8            (8*0x1000u)    /* ADC12 Conversion Start Address: 8 */
305
#define CSTARTADD_9            (9*0x1000u)    /* ADC12 Conversion Start Address: 9 */
306
#define CSTARTADD_10           (10*0x1000u)   /* ADC12 Conversion Start Address: 10 */
307
#define CSTARTADD_11           (11*0x1000u)   /* ADC12 Conversion Start Address: 11 */
308
#define CSTARTADD_12           (12*0x1000u)   /* ADC12 Conversion Start Address: 12 */
309
#define CSTARTADD_13           (13*0x1000u)   /* ADC12 Conversion Start Address: 13 */
310
#define CSTARTADD_14           (14*0x1000u)   /* ADC12 Conversion Start Address: 14 */
311
#define CSTARTADD_15           (15*0x1000u)   /* ADC12 Conversion Start Address: 15 */
312
 
313
/* ADC12MCTLx */
314
#define INCH0                  (0x0001)       /* ADC12 Input Channel Select Bit 0 */
315
#define INCH1                  (0x0002)       /* ADC12 Input Channel Select Bit 1 */
316
#define INCH2                  (0x0004)       /* ADC12 Input Channel Select Bit 2 */
317
#define INCH3                  (0x0008)       /* ADC12 Input Channel Select Bit 3 */
318
#define SREF0                  (0x0010)       /* ADC12 Select Reference Bit 0 */
319
#define SREF1                  (0x0020)       /* ADC12 Select Reference Bit 1 */
320
#define SREF2                  (0x0040)       /* ADC12 Select Reference Bit 2 */
321
#define EOS                    (0x0080)       /* ADC12 End of Sequence */
322
 
323
#define INCH_0                 (0)            /* ADC12 Input Channel 0 */
324
#define INCH_1                 (1)            /* ADC12 Input Channel 1 */
325
#define INCH_2                 (2)            /* ADC12 Input Channel 2 */
326
#define INCH_3                 (3)            /* ADC12 Input Channel 3 */
327
#define INCH_4                 (4)            /* ADC12 Input Channel 4 */
328
#define INCH_5                 (5)            /* ADC12 Input Channel 5 */
329
#define INCH_6                 (6)            /* ADC12 Input Channel 6 */
330
#define INCH_7                 (7)            /* ADC12 Input Channel 7 */
331
#define INCH_8                 (8)            /* ADC12 Input Channel 8 */
332
#define INCH_9                 (9)            /* ADC12 Input Channel 9 */
333
#define INCH_10                (10)           /* ADC12 Input Channel 10 */
334
#define INCH_11                (11)           /* ADC12 Input Channel 11 */
335
#define INCH_12                (12)           /* ADC12 Input Channel 12 */
336
#define INCH_13                (13)           /* ADC12 Input Channel 13 */
337
#define INCH_14                (14)           /* ADC12 Input Channel 14 */
338
#define INCH_15                (15)           /* ADC12 Input Channel 15 */
339
 
340
#define SREF_0                 (0*0x10u)      /* ADC12 Select Reference 0 */
341
#define SREF_1                 (1*0x10u)      /* ADC12 Select Reference 1 */
342
#define SREF_2                 (2*0x10u)      /* ADC12 Select Reference 2 */
343
#define SREF_3                 (3*0x10u)      /* ADC12 Select Reference 3 */
344
#define SREF_4                 (4*0x10u)      /* ADC12 Select Reference 4 */
345
#define SREF_5                 (5*0x10u)      /* ADC12 Select Reference 5 */
346
#define SREF_6                 (6*0x10u)      /* ADC12 Select Reference 6 */
347
#define SREF_7                 (7*0x10u)      /* ADC12 Select Reference 7 */
348
 
349
/* ADC12IV Definitions */
350
#define ADC12IV_NONE           (0x0000)       /* No Interrupt pending */
351
#define ADC12IV_ADC12OVIFG     (0x0002)       /* ADC12OVIFG */
352
#define ADC12IV_ADC12TOVIFG    (0x0004)       /* ADC12TOVIFG */
353
#define ADC12IV_ADC12IFG0      (0x0006)       /* ADC12IFG0 */
354
#define ADC12IV_ADC12IFG1      (0x0008)       /* ADC12IFG1 */
355
#define ADC12IV_ADC12IFG2      (0x000A)       /* ADC12IFG2 */
356
#define ADC12IV_ADC12IFG3      (0x000C)       /* ADC12IFG3 */
357
#define ADC12IV_ADC12IFG4      (0x000E)       /* ADC12IFG4 */
358
#define ADC12IV_ADC12IFG5      (0x0010)       /* ADC12IFG5 */
359
#define ADC12IV_ADC12IFG6      (0x0012)       /* ADC12IFG6 */
360
#define ADC12IV_ADC12IFG7      (0x0014)       /* ADC12IFG7 */
361
#define ADC12IV_ADC12IFG8      (0x0016)       /* ADC12IFG8 */
362
#define ADC12IV_ADC12IFG9      (0x0018)       /* ADC12IFG9 */
363
#define ADC12IV_ADC12IFG10     (0x001A)       /* ADC12IFG10 */
364
#define ADC12IV_ADC12IFG11     (0x001C)       /* ADC12IFG11 */
365
#define ADC12IV_ADC12IFG12     (0x001E)       /* ADC12IFG12 */
366
#define ADC12IV_ADC12IFG13     (0x0020)       /* ADC12IFG13 */
367
#define ADC12IV_ADC12IFG14     (0x0022)       /* ADC12IFG14 */
368
#define ADC12IV_ADC12IFG15     (0x0024)       /* ADC12IFG15 */
369
 
370
/************************************************************
371
* Basic Clock Module
372
************************************************************/
373
#define __MSP430_HAS_BC2__                    /* Definition to show that Module is available */
374
 
375
SFR_8BIT(DCOCTL);                             /* DCO Clock Frequency Control */
376
SFR_8BIT(BCSCTL1);                            /* Basic Clock System Control 1 */
377
SFR_8BIT(BCSCTL2);                            /* Basic Clock System Control 2 */
378
SFR_8BIT(BCSCTL3);                            /* Basic Clock System Control 3 */
379
 
380
#define MOD0                   (0x01)         /* Modulation Bit 0 */
381
#define MOD1                   (0x02)         /* Modulation Bit 1 */
382
#define MOD2                   (0x04)         /* Modulation Bit 2 */
383
#define MOD3                   (0x08)         /* Modulation Bit 3 */
384
#define MOD4                   (0x10)         /* Modulation Bit 4 */
385
#define DCO0                   (0x20)         /* DCO Select Bit 0 */
386
#define DCO1                   (0x40)         /* DCO Select Bit 1 */
387
#define DCO2                   (0x80)         /* DCO Select Bit 2 */
388
 
389
#define RSEL0                  (0x01)         /* Range Select Bit 0 */
390
#define RSEL1                  (0x02)         /* Range Select Bit 1 */
391
#define RSEL2                  (0x04)         /* Range Select Bit 2 */
392
#define RSEL3                  (0x08)         /* Range Select Bit 3 */
393
#define DIVA0                  (0x10)         /* ACLK Divider 0 */
394
#define DIVA1                  (0x20)         /* ACLK Divider 1 */
395
#define XTS                    (0x40)         /* LFXTCLK 0:Low Freq. / 1: High Freq. */
396
#define XT2OFF                 (0x80)         /* Enable XT2CLK */
397
 
398
#define DIVA_0                 (0x00)         /* ACLK Divider 0: /1 */
399
#define DIVA_1                 (0x10)         /* ACLK Divider 1: /2 */
400
#define DIVA_2                 (0x20)         /* ACLK Divider 2: /4 */
401
#define DIVA_3                 (0x30)         /* ACLK Divider 3: /8 */
402
 
403
#define DCOR                   (0x01)         /* Enable External Resistor : 1 */
404
#define DIVS0                  (0x02)         /* SMCLK Divider 0 */
405
#define DIVS1                  (0x04)         /* SMCLK Divider 1 */
406
#define SELS                   (0x08)         /* SMCLK Source Select 0:DCOCLK / 1:XT2CLK/LFXTCLK */
407
#define DIVM0                  (0x10)         /* MCLK Divider 0 */
408
#define DIVM1                  (0x20)         /* MCLK Divider 1 */
409
#define SELM0                  (0x40)         /* MCLK Source Select 0 */
410
#define SELM1                  (0x80)         /* MCLK Source Select 1 */
411
 
412
#define DIVS_0                 (0x00)         /* SMCLK Divider 0: /1 */
413
#define DIVS_1                 (0x02)         /* SMCLK Divider 1: /2 */
414
#define DIVS_2                 (0x04)         /* SMCLK Divider 2: /4 */
415
#define DIVS_3                 (0x06)         /* SMCLK Divider 3: /8 */
416
 
417
#define DIVM_0                 (0x00)         /* MCLK Divider 0: /1 */
418
#define DIVM_1                 (0x10)         /* MCLK Divider 1: /2 */
419
#define DIVM_2                 (0x20)         /* MCLK Divider 2: /4 */
420
#define DIVM_3                 (0x30)         /* MCLK Divider 3: /8 */
421
 
422
#define SELM_0                 (0x00)         /* MCLK Source Select 0: DCOCLK */
423
#define SELM_1                 (0x40)         /* MCLK Source Select 1: DCOCLK */
424
#define SELM_2                 (0x80)         /* MCLK Source Select 2: XT2CLK/LFXTCLK */
425
#define SELM_3                 (0xC0)         /* MCLK Source Select 3: LFXTCLK */
426
 
427
#define LFXT1OF                (0x01)         /* Low/high Frequency Oscillator Fault Flag */
428
#define XT2OF                  (0x02)         /* High frequency oscillator 2 fault flag */
429
#define XCAP0                  (0x04)         /* XIN/XOUT Cap 0 */
430
#define XCAP1                  (0x08)         /* XIN/XOUT Cap 1 */
431
#define LFXT1S0                (0x10)         /* Mode 0 for LFXT1 (XTS = 0) */
432
#define LFXT1S1                (0x20)         /* Mode 1 for LFXT1 (XTS = 0) */
433
#define XT2S0                  (0x40)         /* Mode 0 for XT2 */
434
#define XT2S1                  (0x80)         /* Mode 1 for XT2 */
435
 
436
#define XCAP_0                 (0x00)         /* XIN/XOUT Cap : 0 pF */
437
#define XCAP_1                 (0x04)         /* XIN/XOUT Cap : 6 pF */
438
#define XCAP_2                 (0x08)         /* XIN/XOUT Cap : 10 pF */
439
#define XCAP_3                 (0x0C)         /* XIN/XOUT Cap : 12.5 pF */
440
 
441
#define LFXT1S_0               (0x00)         /* Mode 0 for LFXT1 : Normal operation */
442
#define LFXT1S_1               (0x10)         /* Mode 1 for LFXT1 : Reserved */
443
#define LFXT1S_2               (0x20)         /* Mode 2 for LFXT1 : VLO */
444
#define LFXT1S_3               (0x30)         /* Mode 3 for LFXT1 : Digital input signal */
445
 
446
#define XT2S_0                 (0x00)         /* Mode 0 for XT2 : 0.4 - 1 MHz */
447
#define XT2S_1                 (0x40)         /* Mode 1 for XT2 : 1 - 4 MHz */
448
#define XT2S_2                 (0x80)         /* Mode 2 for XT2 : 2 - 16 MHz */
449
#define XT2S_3                 (0xC0)         /* Mode 3 for XT2 : Digital input signal */
450
 
451
/************************************************************
452
* Comparator A
453
************************************************************/
454
#define __MSP430_HAS_CAPLUS__                 /* Definition to show that Module is available */
455
 
456
SFR_8BIT(CACTL1);                             /* Comparator A Control 1 */
457
SFR_8BIT(CACTL2);                             /* Comparator A Control 2 */
458
SFR_8BIT(CAPD);                               /* Comparator A Port Disable */
459
 
460
#define CAIFG                  (0x01)         /* Comp. A Interrupt Flag */
461
#define CAIE                   (0x02)         /* Comp. A Interrupt Enable */
462
#define CAIES                  (0x04)         /* Comp. A Int. Edge Select: 0:rising / 1:falling */
463
#define CAON                   (0x08)         /* Comp. A enable */
464
#define CAREF0                 (0x10)         /* Comp. A Internal Reference Select 0 */
465
#define CAREF1                 (0x20)         /* Comp. A Internal Reference Select 1 */
466
#define CARSEL                 (0x40)         /* Comp. A Internal Reference Enable */
467
#define CAEX                   (0x80)         /* Comp. A Exchange Inputs */
468
 
469
#define CAREF_0                (0x00)         /* Comp. A Int. Ref. Select 0 : Off */
470
#define CAREF_1                (0x10)         /* Comp. A Int. Ref. Select 1 : 0.25*Vcc */
471
#define CAREF_2                (0x20)         /* Comp. A Int. Ref. Select 2 : 0.5*Vcc */
472
#define CAREF_3                (0x30)         /* Comp. A Int. Ref. Select 3 : Vt*/
473
 
474
#define CAOUT                  (0x01)         /* Comp. A Output */
475
#define CAF                    (0x02)         /* Comp. A Enable Output Filter */
476
#define P2CA0                  (0x04)         /* Comp. A +Terminal Multiplexer */
477
#define P2CA1                  (0x08)         /* Comp. A -Terminal Multiplexer */
478
#define P2CA2                  (0x10)         /* Comp. A -Terminal Multiplexer */
479
#define P2CA3                  (0x20)         /* Comp. A -Terminal Multiplexer */
480
#define P2CA4                  (0x40)         /* Comp. A +Terminal Multiplexer */
481
#define CASHORT                (0x80)         /* Comp. A Short + and - Terminals */
482
 
483
#define CAPD0                  (0x01)         /* Comp. A Disable Input Buffer of Port Register .0 */
484
#define CAPD1                  (0x02)         /* Comp. A Disable Input Buffer of Port Register .1 */
485
#define CAPD2                  (0x04)         /* Comp. A Disable Input Buffer of Port Register .2 */
486
#define CAPD3                  (0x08)         /* Comp. A Disable Input Buffer of Port Register .3 */
487
#define CAPD4                  (0x10)         /* Comp. A Disable Input Buffer of Port Register .4 */
488
#define CAPD5                  (0x20)         /* Comp. A Disable Input Buffer of Port Register .5 */
489
#define CAPD6                  (0x40)         /* Comp. A Disable Input Buffer of Port Register .6 */
490
#define CAPD7                  (0x80)         /* Comp. A Disable Input Buffer of Port Register .7 */
491
 
492
/*************************************************************
493
* Flash Memory
494
*************************************************************/
495
#define __MSP430_HAS_FLASH2__                 /* Definition to show that Module is available */
496
 
497
SFR_16BIT(FCTL1);                             /* FLASH Control 1 */
498
SFR_16BIT(FCTL2);                             /* FLASH Control 2 */
499
SFR_16BIT(FCTL3);                             /* FLASH Control 3 */
500
SFR_16BIT(FCTL4);                             /* FLASH Control 4 */
501
 
502
#define FRKEY                  (0x9600)       /* Flash key returned by read */
503
#define FWKEY                  (0xA500)       /* Flash key for write */
504
#define FXKEY                  (0x3300)       /* for use with XOR instruction */
505
 
506
#define ERASE                  (0x0002)       /* Enable bit for Flash segment erase */
507
#define MERAS                  (0x0004)       /* Enable bit for Flash mass erase */
508
#define EEI                    (0x0008)       /* Enable Erase Interrupts */
509
#define EEIEX                  (0x0010)       /* Enable Emergency Interrupt Exit */
510
#define WRT                    (0x0040)       /* Enable bit for Flash write */
511
#define BLKWRT                 (0x0080)       /* Enable bit for Flash segment write */
512
#define SEGWRT                 (0x0080)       /* old definition */ /* Enable bit for Flash segment write */
513
 
514
#define FN0                    (0x0001)       /* Divide Flash clock by 1 to 64 using FN0 to FN5 according to: */
515
#define FN1                    (0x0002)       /*  32*FN5 + 16*FN4 + 8*FN3 + 4*FN2 + 2*FN1 + FN0 + 1 */
516
#ifndef FN2
517
#define FN2                    (0x0004)
518
#endif
519
#ifndef FN3
520
#define FN3                    (0x0008)
521
#endif
522
#ifndef FN4
523
#define FN4                    (0x0010)
524
#endif
525
#define FN5                    (0x0020)
526
#define FSSEL0                 (0x0040)       /* Flash clock select 0 */        /* to distinguish from USART SSELx */
527
#define FSSEL1                 (0x0080)       /* Flash clock select 1 */
528
 
529
#define FSSEL_0                (0x0000)       /* Flash clock select: 0 - ACLK */
530
#define FSSEL_1                (0x0040)       /* Flash clock select: 1 - MCLK */
531
#define FSSEL_2                (0x0080)       /* Flash clock select: 2 - SMCLK */
532
#define FSSEL_3                (0x00C0)       /* Flash clock select: 3 - SMCLK */
533
 
534
#define BUSY                   (0x0001)       /* Flash busy: 1 */
535
#define KEYV                   (0x0002)       /* Flash Key violation flag */
536
#define ACCVIFG                (0x0004)       /* Flash Access violation flag */
537
#define WAIT                   (0x0008)       /* Wait flag for segment write */
538
#define LOCK                   (0x0010)       /* Lock bit: 1 - Flash is locked (read only) */
539
#define EMEX                   (0x0020)       /* Flash Emergency Exit */
540
#define LOCKA                  (0x0040)       /* Segment A Lock bit: read = 1 - Segment is locked (read only) */
541
#define FAIL                   (0x0080)       /* Last Program or Erase failed */
542
 
543
#define MGR0                   (0x0010)       /* Marginal read 0 mode. */
544
#define MGR1                   (0x0020)       /* Marginal read 1 mode. */
545
 
546
/************************************************************
547
* HARDWARE MULTIPLIER
548
************************************************************/
549
#define __MSP430_HAS_MPY__                    /* Definition to show that Module is available */
550
 
551
SFR_16BIT(MPY);                               /* Multiply Unsigned/Operand 1 */
552
SFR_16BIT(MPYS);                              /* Multiply Signed/Operand 1 */
553
SFR_16BIT(MAC);                               /* Multiply Unsigned and Accumulate/Operand 1 */
554
SFR_16BIT(MACS);                              /* Multiply Signed and Accumulate/Operand 1 */
555
SFR_16BIT(OP2);                               /* Operand 2 */
556
SFR_16BIT(RESLO);                             /* Result Low Word */
557
SFR_16BIT(RESHI);                             /* Result High Word */
558
SFR_16BIT(SUMEXT);                            /* Sum Extend */
559
 
560
/************************************************************
561
* DIGITAL I/O Port1/2 Pull up / Pull down Resistors
562
************************************************************/
563
#define __MSP430_HAS_PORT1_R__                /* Definition to show that Module is available */
564
#define __MSP430_HAS_PORT2_R__                /* Definition to show that Module is available */
565
 
566
SFR_8BIT(P1IN);                               /* Port 1 Input */
567
SFR_8BIT(P1OUT);                              /* Port 1 Output */
568
SFR_8BIT(P1DIR);                              /* Port 1 Direction */
569
SFR_8BIT(P1IFG);                              /* Port 1 Interrupt Flag */
570
SFR_8BIT(P1IES);                              /* Port 1 Interrupt Edge Select */
571
SFR_8BIT(P1IE);                               /* Port 1 Interrupt Enable */
572
SFR_8BIT(P1SEL);                              /* Port 1 Selection */
573
SFR_8BIT(P1REN);                              /* Port 1 Resistor Enable */
574
 
575
SFR_8BIT(P2IN);                               /* Port 2 Input */
576
SFR_8BIT(P2OUT);                              /* Port 2 Output */
577
SFR_8BIT(P2DIR);                              /* Port 2 Direction */
578
SFR_8BIT(P2IFG);                              /* Port 2 Interrupt Flag */
579
SFR_8BIT(P2IES);                              /* Port 2 Interrupt Edge Select */
580
SFR_8BIT(P2IE);                               /* Port 2 Interrupt Enable */
581
SFR_8BIT(P2SEL);                              /* Port 2 Selection */
582
SFR_8BIT(P2REN);                              /* Port 2 Resistor Enable */
583
 
584
/************************************************************
585
* DIGITAL I/O Port3/4 Pull up / Pull down Resistors
586
************************************************************/
587
#define __MSP430_HAS_PORT3_R__                /* Definition to show that Module is available */
588
#define __MSP430_HAS_PORT4_R__                /* Definition to show that Module is available */
589
 
590
SFR_8BIT(P3IN);                               /* Port 3 Input */
591
SFR_8BIT(P3OUT);                              /* Port 3 Output */
592
SFR_8BIT(P3DIR);                              /* Port 3 Direction */
593
SFR_8BIT(P3SEL);                              /* Port 3 Selection */
594
SFR_8BIT(P3REN);                              /* Port 3 Resistor Enable */
595
 
596
SFR_8BIT(P4IN);                               /* Port 4 Input */
597
SFR_8BIT(P4OUT);                              /* Port 4 Output */
598
SFR_8BIT(P4DIR);                              /* Port 4 Direction */
599
SFR_8BIT(P4SEL);                              /* Port 4 Selection */
600
SFR_8BIT(P4REN);                              /* Port 4 Resistor Enable */
601
 
602
/************************************************************
603
* DIGITAL I/O Port5/6 Pull up / Pull down Resistors
604
************************************************************/
605
#define __MSP430_HAS_PORT5_R__                /* Definition to show that Module is available */
606
#define __MSP430_HAS_PORT6_R__                /* Definition to show that Module is available */
607
 
608
SFR_8BIT(P5IN);                               /* Port 5 Input */
609
SFR_8BIT(P5OUT);                              /* Port 5 Output */
610
SFR_8BIT(P5DIR);                              /* Port 5 Direction */
611
SFR_8BIT(P5SEL);                              /* Port 5 Selection */
612
SFR_8BIT(P5REN);                              /* Port 5 Resistor Enable */
613
 
614
SFR_8BIT(P6IN);                               /* Port 6 Input */
615
SFR_8BIT(P6OUT);                              /* Port 6 Output */
616
SFR_8BIT(P6DIR);                              /* Port 6 Direction */
617
SFR_8BIT(P6SEL);                              /* Port 6 Selection */
618
SFR_8BIT(P6REN);                              /* Port 6 Resistor Enable */
619
 
620
/************************************************************
621
* Brown-Out, Supply Voltage Supervision (SVS)
622
************************************************************/
623
#define __MSP430_HAS_SVS__                    /* Definition to show that Module is available */
624
 
625
SFR_8BIT(SVSCTL);                             /* SVS Control */
626
#define SVSFG                  (0x01)         /* SVS Flag */
627
#define SVSOP                  (0x02)         /* SVS output (read only) */
628
#define SVSON                  (0x04)         /* Switches the SVS on/off */
629
#define PORON                  (0x08)         /* Enable POR Generation if Low Voltage */
630
#define VLD0                   (0x10)
631
#define VLD1                   (0x20)
632
#define VLD2                   (0x40)
633
#define VLD3                   (0x80)
634
 
635
#define VLDON                  (0x10)
636
#define VLDOFF                 (0x00)
637
#define VLD_1_8V               (0x10)
638
 
639
/************************************************************
640
* Timer A3
641
************************************************************/
642
#define __MSP430_HAS_TA3__                    /* Definition to show that Module is available */
643
 
644
SFR_16BIT(TAIV);                              /* Timer A Interrupt Vector Word */
645
SFR_16BIT(TACTL);                             /* Timer A Control */
646
SFR_16BIT(TACCTL0);                           /* Timer A Capture/Compare Control 0 */
647
SFR_16BIT(TACCTL1);                           /* Timer A Capture/Compare Control 1 */
648
SFR_16BIT(TACCTL2);                           /* Timer A Capture/Compare Control 2 */
649
SFR_16BIT(TAR);                               /* Timer A Counter Register */
650
SFR_16BIT(TACCR0);                            /* Timer A Capture/Compare 0 */
651
SFR_16BIT(TACCR1);                            /* Timer A Capture/Compare 1 */
652
SFR_16BIT(TACCR2);                            /* Timer A Capture/Compare 2 */
653
 
654
/* Alternate register names */
655
#define CCTL0                  TACCTL0        /* Timer A Capture/Compare Control 0 */
656
#define CCTL1                  TACCTL1        /* Timer A Capture/Compare Control 1 */
657
#define CCTL2                  TACCTL2        /* Timer A Capture/Compare Control 2 */
658
#define CCR0                   TACCR0         /* Timer A Capture/Compare 0 */
659
#define CCR1                   TACCR1         /* Timer A Capture/Compare 1 */
660
#define CCR2                   TACCR2         /* Timer A Capture/Compare 2 */
661
#define CCTL0_                 TACCTL0_       /* Timer A Capture/Compare Control 0 */
662
#define CCTL1_                 TACCTL1_       /* Timer A Capture/Compare Control 1 */
663
#define CCTL2_                 TACCTL2_       /* Timer A Capture/Compare Control 2 */
664
#define CCR0_                  TACCR0_        /* Timer A Capture/Compare 0 */
665
#define CCR1_                  TACCR1_        /* Timer A Capture/Compare 1 */
666
#define CCR2_                  TACCR2_        /* Timer A Capture/Compare 2 */
667
/* Alternate register names - 5xx style */
668
#define TA0IV                  TAIV           /* Timer A Interrupt Vector Word */
669
#define TA0CTL                 TACTL          /* Timer A Control */
670
#define TA0CCTL0               TACCTL0        /* Timer A Capture/Compare Control 0 */
671
#define TA0CCTL1               TACCTL1        /* Timer A Capture/Compare Control 1 */
672
#define TA0CCTL2               TACCTL2        /* Timer A Capture/Compare Control 2 */
673
#define TA0R                   TAR            /* Timer A Counter Register */
674
#define TA0CCR0                TACCR0         /* Timer A Capture/Compare 0 */
675
#define TA0CCR1                TACCR1         /* Timer A Capture/Compare 1 */
676
#define TA0CCR2                TACCR2         /* Timer A Capture/Compare 2 */
677
#define TA0IV_                 TAIV_          /* Timer A Interrupt Vector Word */
678
#define TA0CTL_                TACTL_         /* Timer A Control */
679
#define TA0CCTL0_              TACCTL0_       /* Timer A Capture/Compare Control 0 */
680
#define TA0CCTL1_              TACCTL1_       /* Timer A Capture/Compare Control 1 */
681
#define TA0CCTL2_              TACCTL2_       /* Timer A Capture/Compare Control 2 */
682
#define TA0R_                  TAR_           /* Timer A Counter Register */
683
#define TA0CCR0_               TACCR0_        /* Timer A Capture/Compare 0 */
684
#define TA0CCR1_               TACCR1_        /* Timer A Capture/Compare 1 */
685
#define TA0CCR2_               TACCR2_        /* Timer A Capture/Compare 2 */
686
 
687
#define TASSEL1                (0x0200)       /* Timer A clock source select 0 */
688
#define TASSEL0                (0x0100)       /* Timer A clock source select 1 */
689
#define ID1                    (0x0080)       /* Timer A clock input divider 1 */
690
#define ID0                    (0x0040)       /* Timer A clock input divider 0 */
691
#define MC1                    (0x0020)       /* Timer A mode control 1 */
692
#define MC0                    (0x0010)       /* Timer A mode control 0 */
693
#define TACLR                  (0x0004)       /* Timer A counter clear */
694
#define TAIE                   (0x0002)       /* Timer A counter interrupt enable */
695
#define TAIFG                  (0x0001)       /* Timer A counter interrupt flag */
696
 
697
#define MC_0                   (0*0x10u)      /* Timer A mode control: 0 - Stop */
698
#define MC_1                   (1*0x10u)      /* Timer A mode control: 1 - Up to CCR0 */
699
#define MC_2                   (2*0x10u)      /* Timer A mode control: 2 - Continous up */
700
#define MC_3                   (3*0x10u)      /* Timer A mode control: 3 - Up/Down */
701
#define ID_0                   (0*0x40u)      /* Timer A input divider: 0 - /1 */
702
#define ID_1                   (1*0x40u)      /* Timer A input divider: 1 - /2 */
703
#define ID_2                   (2*0x40u)      /* Timer A input divider: 2 - /4 */
704
#define ID_3                   (3*0x40u)      /* Timer A input divider: 3 - /8 */
705
#define TASSEL_0               (0*0x100u)     /* Timer A clock source select: 0 - TACLK */
706
#define TASSEL_1               (1*0x100u)     /* Timer A clock source select: 1 - ACLK  */
707
#define TASSEL_2               (2*0x100u)     /* Timer A clock source select: 2 - SMCLK */
708
#define TASSEL_3               (3*0x100u)     /* Timer A clock source select: 3 - INCLK */
709
 
710
#define CM1                    (0x8000)       /* Capture mode 1 */
711
#define CM0                    (0x4000)       /* Capture mode 0 */
712
#define CCIS1                  (0x2000)       /* Capture input select 1 */
713
#define CCIS0                  (0x1000)       /* Capture input select 0 */
714
#define SCS                    (0x0800)       /* Capture sychronize */
715
#define SCCI                   (0x0400)       /* Latched capture signal (read) */
716
#define CAP                    (0x0100)       /* Capture mode: 1 /Compare mode : 0 */
717
#define OUTMOD2                (0x0080)       /* Output mode 2 */
718
#define OUTMOD1                (0x0040)       /* Output mode 1 */
719
#define OUTMOD0                (0x0020)       /* Output mode 0 */
720
#define CCIE                   (0x0010)       /* Capture/compare interrupt enable */
721
#define CCI                    (0x0008)       /* Capture input signal (read) */
722
#define OUT                    (0x0004)       /* PWM Output signal if output mode 0 */
723
#define COV                    (0x0002)       /* Capture/compare overflow flag */
724
#define CCIFG                  (0x0001)       /* Capture/compare interrupt flag */
725
 
726
#define OUTMOD_0               (0*0x20u)      /* PWM output mode: 0 - output only */
727
#define OUTMOD_1               (1*0x20u)      /* PWM output mode: 1 - set */
728
#define OUTMOD_2               (2*0x20u)      /* PWM output mode: 2 - PWM toggle/reset */
729
#define OUTMOD_3               (3*0x20u)      /* PWM output mode: 3 - PWM set/reset */
730
#define OUTMOD_4               (4*0x20u)      /* PWM output mode: 4 - toggle */
731
#define OUTMOD_5               (5*0x20u)      /* PWM output mode: 5 - Reset */
732
#define OUTMOD_6               (6*0x20u)      /* PWM output mode: 6 - PWM toggle/set */
733
#define OUTMOD_7               (7*0x20u)      /* PWM output mode: 7 - PWM reset/set */
734
#define CCIS_0                 (0*0x1000u)    /* Capture input select: 0 - CCIxA */
735
#define CCIS_1                 (1*0x1000u)    /* Capture input select: 1 - CCIxB */
736
#define CCIS_2                 (2*0x1000u)    /* Capture input select: 2 - GND */
737
#define CCIS_3                 (3*0x1000u)    /* Capture input select: 3 - Vcc */
738
#define CM_0                   (0*0x4000u)    /* Capture mode: 0 - disabled */
739
#define CM_1                   (1*0x4000u)    /* Capture mode: 1 - pos. edge */
740
#define CM_2                   (2*0x4000u)    /* Capture mode: 1 - neg. edge */
741
#define CM_3                   (3*0x4000u)    /* Capture mode: 1 - both edges */
742
 
743
/* TA3IV Definitions */
744
#define TAIV_NONE              (0x0000)       /* No Interrupt pending */
745
#define TAIV_TACCR1            (0x0002)       /* TACCR1_CCIFG */
746
#define TAIV_TACCR2            (0x0004)       /* TACCR2_CCIFG */
747
#define TAIV_6                 (0x0006)       /* Reserved */
748
#define TAIV_8                 (0x0008)       /* Reserved */
749
#define TAIV_TAIFG             (0x000A)       /* TAIFG */
750
 
751
/************************************************************
752
* Timer B7
753
************************************************************/
754
#define __MSP430_HAS_TB7__                    /* Definition to show that Module is available */
755
 
756
SFR_16BIT(TBIV);                              /* Timer B Interrupt Vector Word */
757
SFR_16BIT(TBCTL);                             /* Timer B Control */
758
SFR_16BIT(TBCCTL0);                           /* Timer B Capture/Compare Control 0 */
759
SFR_16BIT(TBCCTL1);                           /* Timer B Capture/Compare Control 1 */
760
SFR_16BIT(TBCCTL2);                           /* Timer B Capture/Compare Control 2 */
761
SFR_16BIT(TBCCTL3);                           /* Timer B Capture/Compare Control 3 */
762
SFR_16BIT(TBCCTL4);                           /* Timer B Capture/Compare Control 4 */
763
SFR_16BIT(TBCCTL5);                           /* Timer B Capture/Compare Control 5 */
764
SFR_16BIT(TBCCTL6);                           /* Timer B Capture/Compare Control 6 */
765
SFR_16BIT(TBR);                               /* Timer B Counter Register */
766
SFR_16BIT(TBCCR0);                            /* Timer B Capture/Compare 0 */
767
SFR_16BIT(TBCCR1);                            /* Timer B Capture/Compare 1 */
768
SFR_16BIT(TBCCR2);                            /* Timer B Capture/Compare 2 */
769
SFR_16BIT(TBCCR3);                            /* Timer B Capture/Compare 3 */
770
SFR_16BIT(TBCCR4);                            /* Timer B Capture/Compare 4 */
771
SFR_16BIT(TBCCR5);                            /* Timer B Capture/Compare 5 */
772
SFR_16BIT(TBCCR6);                            /* Timer B Capture/Compare 6 */
773
 
774
/* Alternate register names - 5xx style */
775
#define TB0IV                  TBIV           /* Timer B Interrupt Vector Word */
776
#define TB0CTL                 TBCTL          /* Timer B Control */
777
#define TB0CCTL0               TBCCTL0        /* Timer B Capture/Compare Control 0 */
778
#define TB0CCTL1               TBCCTL1        /* Timer B Capture/Compare Control 1 */
779
#define TB0CCTL2               TBCCTL2        /* Timer B Capture/Compare Control 2 */
780
#define TB0CCTL3               TBCCTL3        /* Timer B Capture/Compare Control 3 */
781
#define TB0CCTL4               TBCCTL4        /* Timer B Capture/Compare Control 4 */
782
#define TB0CCTL5               TBCCTL5        /* Timer B Capture/Compare Control 5 */
783
#define TB0CCTL6               TBCCTL6        /* Timer B Capture/Compare Control 6 */
784
#define TB0R                   TBR            /* Timer B Counter Register */
785
#define TB0CCR0                TBCCR0         /* Timer B Capture/Compare 0 */
786
#define TB0CCR1                TBCCR1         /* Timer B Capture/Compare 1 */
787
#define TB0CCR2                TBCCR2         /* Timer B Capture/Compare 2 */
788
#define TB0CCR3                TBCCR3         /* Timer B Capture/Compare 3 */
789
#define TB0CCR4                TBCCR4         /* Timer B Capture/Compare 4 */
790
#define TB0CCR5                TBCCR5         /* Timer B Capture/Compare 5 */
791
#define TB0CCR6                TBCCR6         /* Timer B Capture/Compare 6 */
792
#define TB0IV_                 TBIV_          /* Timer B Interrupt Vector Word */
793
#define TB0CTL_                TBCTL_         /* Timer B Control */
794
#define TB0CCTL0_              TBCCTL0_       /* Timer B Capture/Compare Control 0 */
795
#define TB0CCTL1_              TBCCTL1_       /* Timer B Capture/Compare Control 1 */
796
#define TB0CCTL2_              TBCCTL2_       /* Timer B Capture/Compare Control 2 */
797
#define TB0CCTL3_              TBCCTL3_       /* Timer B Capture/Compare Control 3 */
798
#define TB0CCTL4_              TBCCTL4_       /* Timer B Capture/Compare Control 4 */
799
#define TB0CCTL5_              TBCCTL5_       /* Timer B Capture/Compare Control 5 */
800
#define TB0CCTL6_              TBCCTL6_       /* Timer B Capture/Compare Control 6 */
801
#define TB0R_                  TBR_           /* Timer B Counter Register */
802
#define TB0CCR0_               TBCCR0_        /* Timer B Capture/Compare 0 */
803
#define TB0CCR1_               TBCCR1_        /* Timer B Capture/Compare 1 */
804
#define TB0CCR2_               TBCCR2_        /* Timer B Capture/Compare 2 */
805
#define TB0CCR3_               TBCCR3_        /* Timer B Capture/Compare 3 */
806
#define TB0CCR4_               TBCCR4_        /* Timer B Capture/Compare 4 */
807
#define TB0CCR5_               TBCCR5_        /* Timer B Capture/Compare 5 */
808
#define TB0CCR6_               TBCCR6_        /* Timer B Capture/Compare 6 */
809
 
810
#define TBCLGRP1               (0x4000)       /* Timer B Compare latch load group 1 */
811
#define TBCLGRP0               (0x2000)       /* Timer B Compare latch load group 0 */
812
#define CNTL1                  (0x1000)       /* Counter lenght 1 */
813
#define CNTL0                  (0x0800)       /* Counter lenght 0 */
814
#define TBSSEL1                (0x0200)       /* Clock source 1 */
815
#define TBSSEL0                (0x0100)       /* Clock source 0 */
816
#define TBCLR                  (0x0004)       /* Timer B counter clear */
817
#define TBIE                   (0x0002)       /* Timer B interrupt enable */
818
#define TBIFG                  (0x0001)       /* Timer B interrupt flag */
819
 
820
#define SHR1                   (0x4000)       /* Timer B Compare latch load group 1 */
821
#define SHR0                   (0x2000)       /* Timer B Compare latch load group 0 */
822
 
823
#define TBSSEL_0               (0*0x0100u)    /* Clock Source: TBCLK */
824
#define TBSSEL_1               (1*0x0100u)    /* Clock Source: ACLK  */
825
#define TBSSEL_2               (2*0x0100u)    /* Clock Source: SMCLK */
826
#define TBSSEL_3               (3*0x0100u)    /* Clock Source: INCLK */
827
#define CNTL_0                 (0*0x0800u)    /* Counter lenght: 16 bit */
828
#define CNTL_1                 (1*0x0800u)    /* Counter lenght: 12 bit */
829
#define CNTL_2                 (2*0x0800u)    /* Counter lenght: 10 bit */
830
#define CNTL_3                 (3*0x0800u)    /* Counter lenght:  8 bit */
831
#define SHR_0                  (0*0x2000u)    /* Timer B Group: 0 - individually */
832
#define SHR_1                  (1*0x2000u)    /* Timer B Group: 1 - 3 groups (1-2, 3-4, 5-6) */
833
#define SHR_2                  (2*0x2000u)    /* Timer B Group: 2 - 2 groups (1-3, 4-6)*/
834
#define SHR_3                  (3*0x2000u)    /* Timer B Group: 3 - 1 group (all) */
835
#define TBCLGRP_0              (0*0x2000u)    /* Timer B Group: 0 - individually */
836
#define TBCLGRP_1              (1*0x2000u)    /* Timer B Group: 1 - 3 groups (1-2, 3-4, 5-6) */
837
#define TBCLGRP_2              (2*0x2000u)    /* Timer B Group: 2 - 2 groups (1-3, 4-6)*/
838
#define TBCLGRP_3              (3*0x2000u)    /* Timer B Group: 3 - 1 group (all) */
839
 
840
/* Additional Timer B Control Register bits are defined in Timer A */
841
#define CLLD1                  (0x0400)       /* Compare latch load source 1 */
842
#define CLLD0                  (0x0200)       /* Compare latch load source 0 */
843
 
844
#define SLSHR1                 (0x0400)       /* Compare latch load source 1 */
845
#define SLSHR0                 (0x0200)       /* Compare latch load source 0 */
846
 
847
#define SLSHR_0                (0*0x0200u)    /* Compare latch load sourec : 0 - immediate */
848
#define SLSHR_1                (1*0x0200u)    /* Compare latch load sourec : 1 - TBR counts to 0 */
849
#define SLSHR_2                (2*0x0200u)    /* Compare latch load sourec : 2 - up/down */
850
#define SLSHR_3                (3*0x0200u)    /* Compare latch load sourec : 3 - TBR counts to TBCTL0 */
851
 
852
#define CLLD_0                 (0*0x0200u)    /* Compare latch load sourec : 0 - immediate */
853
#define CLLD_1                 (1*0x0200u)    /* Compare latch load sourec : 1 - TBR counts to 0 */
854
#define CLLD_2                 (2*0x0200u)    /* Compare latch load sourec : 2 - up/down */
855
#define CLLD_3                 (3*0x0200u)    /* Compare latch load sourec : 3 - TBR counts to TBCTL0 */
856
 
857
/* TB7IV Definitions */
858
#define TBIV_NONE              (0x0000)       /* No Interrupt pending */
859
#define TBIV_TBCCR1            (0x0002)       /* TBCCR1_CCIFG */
860
#define TBIV_TBCCR2            (0x0004)       /* TBCCR2_CCIFG */
861
#define TBIV_TBCCR3            (0x0006)       /* TBCCR3_CCIFG */
862
#define TBIV_TBCCR4            (0x0008)       /* TBCCR4_CCIFG */
863
#define TBIV_TBCCR5            (0x000A)       /* TBCCR3_CCIFG */
864
#define TBIV_TBCCR6            (0x000C)       /* TBCCR4_CCIFG */
865
#define TBIV_TBIFG             (0x000E)       /* TBIFG */
866
 
867
/************************************************************
868
* USCI
869
************************************************************/
870
#define __MSP430_HAS_USCI__                   /* Definition to show that Module is available */
871
#define __MSP430_HAS_USCI_AB0__                /* Definition to show that Module is available */
872
#define __MSP430_HAS_USCI_AB1__                /* Definition to show that Module is available */
873
 
874
SFR_8BIT(UCA0CTL0);                           /* USCI A0 Control Register 0 */
875
SFR_8BIT(UCA0CTL1);                           /* USCI A0 Control Register 1 */
876
SFR_8BIT(UCA0BR0);                            /* USCI A0 Baud Rate 0 */
877
SFR_8BIT(UCA0BR1);                            /* USCI A0 Baud Rate 1 */
878
SFR_8BIT(UCA0MCTL);                           /* USCI A0 Modulation Control */
879
SFR_8BIT(UCA0STAT);                           /* USCI A0 Status Register */
880
SFR_8BIT(UCA0RXBUF);                          /* USCI A0 Receive Buffer */
881
SFR_8BIT(UCA0TXBUF);                          /* USCI A0 Transmit Buffer */
882
SFR_8BIT(UCA0ABCTL);                          /* USCI A0 LIN Control */
883
SFR_8BIT(UCA0IRTCTL);                         /* USCI A0 IrDA Transmit Control */
884
SFR_8BIT(UCA0IRRCTL);                         /* USCI A0 IrDA Receive Control */
885
 
886
 
887
 
888
SFR_8BIT(UCB0CTL0);                           /* USCI B0 Control Register 0 */
889
SFR_8BIT(UCB0CTL1);                           /* USCI B0 Control Register 1 */
890
SFR_8BIT(UCB0BR0);                            /* USCI B0 Baud Rate 0 */
891
SFR_8BIT(UCB0BR1);                            /* USCI B0 Baud Rate 1 */
892
SFR_8BIT(UCB0I2CIE);                          /* USCI B0 I2C Interrupt Enable Register */
893
SFR_8BIT(UCB0STAT);                           /* USCI B0 Status Register */
894
SFR_8BIT(UCB0RXBUF);                          /* USCI B0 Receive Buffer */
895
SFR_8BIT(UCB0TXBUF);                          /* USCI B0 Transmit Buffer */
896
SFR_16BIT(UCB0I2COA);                         /* USCI B0 I2C Own Address */
897
SFR_16BIT(UCB0I2CSA);                         /* USCI B0 I2C Slave Address */
898
 
899
SFR_8BIT(UCA1CTL0);                           /* USCI A1 Control Register 0 */
900
SFR_8BIT(UCA1CTL1);                           /* USCI A1 Control Register 1 */
901
SFR_8BIT(UCA1BR0);                            /* USCI A1 Baud Rate 0 */
902
SFR_8BIT(UCA1BR1);                            /* USCI A1 Baud Rate 1 */
903
SFR_8BIT(UCA1MCTL);                           /* USCI A1 Modulation Control */
904
SFR_8BIT(UCA1STAT);                           /* USCI A1 Status Register */
905
SFR_8BIT(UCA1RXBUF);                          /* USCI A1 Receive Buffer */
906
SFR_8BIT(UCA1TXBUF);                          /* USCI A1 Transmit Buffer */
907
SFR_8BIT(UCA1ABCTL);                          /* USCI A1 LIN Control */
908
SFR_8BIT(UCA1IRTCTL);                         /* USCI A1 IrDA Transmit Control */
909
SFR_8BIT(UCA1IRRCTL);                         /* USCI A1 IrDA Receive Control */
910
 
911
 
912
 
913
SFR_8BIT(UCB1CTL0);                           /* USCI B1 Control Register 0 */
914
SFR_8BIT(UCB1CTL1);                           /* USCI B1 Control Register 1 */
915
SFR_8BIT(UCB1BR0);                            /* USCI B1 Baud Rate 0 */
916
SFR_8BIT(UCB1BR1);                            /* USCI B1 Baud Rate 1 */
917
SFR_8BIT(UCB1I2CIE);                          /* USCI B1 I2C Interrupt Enable Register */
918
SFR_8BIT(UCB1STAT);                           /* USCI B1 Status Register */
919
SFR_8BIT(UCB1RXBUF);                          /* USCI B1 Receive Buffer */
920
SFR_8BIT(UCB1TXBUF);                          /* USCI B1 Transmit Buffer */
921
SFR_16BIT(UCB1I2COA);                         /* USCI B1 I2C Own Address */
922
SFR_16BIT(UCB1I2CSA);                         /* USCI B1 I2C Slave Address */
923
 
924
// UART-Mode Bits
925
#define UCPEN                  (0x80)         /* Async. Mode: Parity enable */
926
#define UCPAR                  (0x40)         /* Async. Mode: Parity     0:odd / 1:even */
927
#define UCMSB                  (0x20)         /* Async. Mode: MSB first  0:LSB / 1:MSB */
928
#define UC7BIT                 (0x10)         /* Async. Mode: Data Bits  0:8-bits / 1:7-bits */
929
#define UCSPB                  (0x08)         /* Async. Mode: Stop Bits  0:one / 1: two */
930
#define UCMODE1                (0x04)         /* Async. Mode: USCI Mode 1 */
931
#define UCMODE0                (0x02)         /* Async. Mode: USCI Mode 0 */
932
#define UCSYNC                 (0x01)         /* Sync-Mode  0:UART-Mode / 1:SPI-Mode */
933
 
934
// SPI-Mode Bits
935
#define UCCKPH                 (0x80)         /* Sync. Mode: Clock Phase */
936
#define UCCKPL                 (0x40)         /* Sync. Mode: Clock Polarity */
937
#define UCMST                  (0x08)         /* Sync. Mode: Master Select */
938
 
939
// I2C-Mode Bits
940
#define UCA10                  (0x80)         /* 10-bit Address Mode */
941
#define UCSLA10                (0x40)         /* 10-bit Slave Address Mode */
942
#define UCMM                   (0x20)         /* Multi-Master Environment */
943
//#define res               (0x10)    /* reserved */
944
#define UCMODE_0               (0x00)         /* Sync. Mode: USCI Mode: 0 */
945
#define UCMODE_1               (0x02)         /* Sync. Mode: USCI Mode: 1 */
946
#define UCMODE_2               (0x04)         /* Sync. Mode: USCI Mode: 2 */
947
#define UCMODE_3               (0x06)         /* Sync. Mode: USCI Mode: 3 */
948
 
949
// UART-Mode Bits
950
#define UCSSEL1                (0x80)         /* USCI 0 Clock Source Select 1 */
951
#define UCSSEL0                (0x40)         /* USCI 0 Clock Source Select 0 */
952
#define UCRXEIE                (0x20)         /* RX Error interrupt enable */
953
#define UCBRKIE                (0x10)         /* Break interrupt enable */
954
#define UCDORM                 (0x08)         /* Dormant (Sleep) Mode */
955
#define UCTXADDR               (0x04)         /* Send next Data as Address */
956
#define UCTXBRK                (0x02)         /* Send next Data as Break */
957
#define UCSWRST                (0x01)         /* USCI Software Reset */
958
 
959
// SPI-Mode Bits
960
//#define res               (0x20)    /* reserved */
961
//#define res               (0x10)    /* reserved */
962
//#define res               (0x08)    /* reserved */
963
//#define res               (0x04)    /* reserved */
964
//#define res               (0x02)    /* reserved */
965
 
966
// I2C-Mode Bits
967
//#define res               (0x20)    /* reserved */
968
#define UCTR                   (0x10)         /* Transmit/Receive Select/Flag */
969
#define UCTXNACK               (0x08)         /* Transmit NACK */
970
#define UCTXSTP                (0x04)         /* Transmit STOP */
971
#define UCTXSTT                (0x02)         /* Transmit START */
972
#define UCSSEL_0               (0x00)         /* USCI 0 Clock Source: 0 */
973
#define UCSSEL_1               (0x40)         /* USCI 0 Clock Source: 1 */
974
#define UCSSEL_2               (0x80)         /* USCI 0 Clock Source: 2 */
975
#define UCSSEL_3               (0xC0)         /* USCI 0 Clock Source: 3 */
976
 
977
#define UCBRF3                 (0x80)         /* USCI First Stage Modulation Select 3 */
978
#define UCBRF2                 (0x40)         /* USCI First Stage Modulation Select 2 */
979
#define UCBRF1                 (0x20)         /* USCI First Stage Modulation Select 1 */
980
#define UCBRF0                 (0x10)         /* USCI First Stage Modulation Select 0 */
981
#define UCBRS2                 (0x08)         /* USCI Second Stage Modulation Select 2 */
982
#define UCBRS1                 (0x04)         /* USCI Second Stage Modulation Select 1 */
983
#define UCBRS0                 (0x02)         /* USCI Second Stage Modulation Select 0 */
984
#define UCOS16                 (0x01)         /* USCI 16-times Oversampling enable */
985
 
986
#define UCBRF_0                (0x00)         /* USCI First Stage Modulation: 0 */
987
#define UCBRF_1                (0x10)         /* USCI First Stage Modulation: 1 */
988
#define UCBRF_2                (0x20)         /* USCI First Stage Modulation: 2 */
989
#define UCBRF_3                (0x30)         /* USCI First Stage Modulation: 3 */
990
#define UCBRF_4                (0x40)         /* USCI First Stage Modulation: 4 */
991
#define UCBRF_5                (0x50)         /* USCI First Stage Modulation: 5 */
992
#define UCBRF_6                (0x60)         /* USCI First Stage Modulation: 6 */
993
#define UCBRF_7                (0x70)         /* USCI First Stage Modulation: 7 */
994
#define UCBRF_8                (0x80)         /* USCI First Stage Modulation: 8 */
995
#define UCBRF_9                (0x90)         /* USCI First Stage Modulation: 9 */
996
#define UCBRF_10               (0xA0)         /* USCI First Stage Modulation: A */
997
#define UCBRF_11               (0xB0)         /* USCI First Stage Modulation: B */
998
#define UCBRF_12               (0xC0)         /* USCI First Stage Modulation: C */
999
#define UCBRF_13               (0xD0)         /* USCI First Stage Modulation: D */
1000
#define UCBRF_14               (0xE0)         /* USCI First Stage Modulation: E */
1001
#define UCBRF_15               (0xF0)         /* USCI First Stage Modulation: F */
1002
 
1003
#define UCBRS_0                (0x00)         /* USCI Second Stage Modulation: 0 */
1004
#define UCBRS_1                (0x02)         /* USCI Second Stage Modulation: 1 */
1005
#define UCBRS_2                (0x04)         /* USCI Second Stage Modulation: 2 */
1006
#define UCBRS_3                (0x06)         /* USCI Second Stage Modulation: 3 */
1007
#define UCBRS_4                (0x08)         /* USCI Second Stage Modulation: 4 */
1008
#define UCBRS_5                (0x0A)         /* USCI Second Stage Modulation: 5 */
1009
#define UCBRS_6                (0x0C)         /* USCI Second Stage Modulation: 6 */
1010
#define UCBRS_7                (0x0E)         /* USCI Second Stage Modulation: 7 */
1011
 
1012
#define UCLISTEN               (0x80)         /* USCI Listen mode */
1013
#define UCFE                   (0x40)         /* USCI Frame Error Flag */
1014
#define UCOE                   (0x20)         /* USCI Overrun Error Flag */
1015
#define UCPE                   (0x10)         /* USCI Parity Error Flag */
1016
#define UCBRK                  (0x08)         /* USCI Break received */
1017
#define UCRXERR                (0x04)         /* USCI RX Error Flag */
1018
#define UCADDR                 (0x02)         /* USCI Address received Flag */
1019
#define UCBUSY                 (0x01)         /* USCI Busy Flag */
1020
#define UCIDLE                 (0x02)         /* USCI Idle line detected Flag */
1021
 
1022
//#define res               (0x80)    /* reserved */
1023
//#define res               (0x40)    /* reserved */
1024
//#define res               (0x20)    /* reserved */
1025
//#define res               (0x10)    /* reserved */
1026
#define UCNACKIE               (0x08)         /* NACK Condition interrupt enable */
1027
#define UCSTPIE                (0x04)         /* STOP Condition interrupt enable */
1028
#define UCSTTIE                (0x02)         /* START Condition interrupt enable */
1029
#define UCALIE                 (0x01)         /* Arbitration Lost interrupt enable */
1030
 
1031
#define UCSCLLOW               (0x40)         /* SCL low */
1032
#define UCGC                   (0x20)         /* General Call address received Flag */
1033
#define UCBBUSY                (0x10)         /* Bus Busy Flag */
1034
#define UCNACKIFG              (0x08)         /* NAK Condition interrupt Flag */
1035
#define UCSTPIFG               (0x04)         /* STOP Condition interrupt Flag */
1036
#define UCSTTIFG               (0x02)         /* START Condition interrupt Flag */
1037
#define UCALIFG                (0x01)         /* Arbitration Lost interrupt Flag */
1038
 
1039
#define UCIRTXPL5              (0x80)         /* IRDA Transmit Pulse Length 5 */
1040
#define UCIRTXPL4              (0x40)         /* IRDA Transmit Pulse Length 4 */
1041
#define UCIRTXPL3              (0x20)         /* IRDA Transmit Pulse Length 3 */
1042
#define UCIRTXPL2              (0x10)         /* IRDA Transmit Pulse Length 2 */
1043
#define UCIRTXPL1              (0x08)         /* IRDA Transmit Pulse Length 1 */
1044
#define UCIRTXPL0              (0x04)         /* IRDA Transmit Pulse Length 0 */
1045
#define UCIRTXCLK              (0x02)         /* IRDA Transmit Pulse Clock Select */
1046
#define UCIREN                 (0x01)         /* IRDA Encoder/Decoder enable */
1047
 
1048
#define UCIRRXFL5              (0x80)         /* IRDA Receive Filter Length 5 */
1049
#define UCIRRXFL4              (0x40)         /* IRDA Receive Filter Length 4 */
1050
#define UCIRRXFL3              (0x20)         /* IRDA Receive Filter Length 3 */
1051
#define UCIRRXFL2              (0x10)         /* IRDA Receive Filter Length 2 */
1052
#define UCIRRXFL1              (0x08)         /* IRDA Receive Filter Length 1 */
1053
#define UCIRRXFL0              (0x04)         /* IRDA Receive Filter Length 0 */
1054
#define UCIRRXPL               (0x02)         /* IRDA Receive Input Polarity */
1055
#define UCIRRXFE               (0x01)         /* IRDA Receive Filter enable */
1056
 
1057
//#define res               (0x80)    /* reserved */
1058
//#define res               (0x40)    /* reserved */
1059
#define UCDELIM1               (0x20)         /* Break Sync Delimiter 1 */
1060
#define UCDELIM0               (0x10)         /* Break Sync Delimiter 0 */
1061
#define UCSTOE                 (0x08)         /* Sync-Field Timeout error */
1062
#define UCBTOE                 (0x04)         /* Break Timeout error */
1063
//#define res               (0x02)    /* reserved */
1064
#define UCABDEN                (0x01)         /* Auto Baud Rate detect enable */
1065
 
1066
#define UCGCEN                 (0x8000)       /* I2C General Call enable */
1067
#define UCOA9                  (0x0200)       /* I2C Own Address 9 */
1068
#define UCOA8                  (0x0100)       /* I2C Own Address 8 */
1069
#define UCOA7                  (0x0080)       /* I2C Own Address 7 */
1070
#define UCOA6                  (0x0040)       /* I2C Own Address 6 */
1071
#define UCOA5                  (0x0020)       /* I2C Own Address 5 */
1072
#define UCOA4                  (0x0010)       /* I2C Own Address 4 */
1073
#define UCOA3                  (0x0008)       /* I2C Own Address 3 */
1074
#define UCOA2                  (0x0004)       /* I2C Own Address 2 */
1075
#define UCOA1                  (0x0002)       /* I2C Own Address 1 */
1076
#define UCOA0                  (0x0001)       /* I2C Own Address 0 */
1077
 
1078
#define UCSA9                  (0x0200)       /* I2C Slave Address 9 */
1079
#define UCSA8                  (0x0100)       /* I2C Slave Address 8 */
1080
#define UCSA7                  (0x0080)       /* I2C Slave Address 7 */
1081
#define UCSA6                  (0x0040)       /* I2C Slave Address 6 */
1082
#define UCSA5                  (0x0020)       /* I2C Slave Address 5 */
1083
#define UCSA4                  (0x0010)       /* I2C Slave Address 4 */
1084
#define UCSA3                  (0x0008)       /* I2C Slave Address 3 */
1085
#define UCSA2                  (0x0004)       /* I2C Slave Address 2 */
1086
#define UCSA1                  (0x0002)       /* I2C Slave Address 1 */
1087
#define UCSA0                  (0x0001)       /* I2C Slave Address 0 */
1088
 
1089
/************************************************************
1090
* WATCHDOG TIMER
1091
************************************************************/
1092
#define __MSP430_HAS_WDT__                    /* Definition to show that Module is available */
1093
 
1094
SFR_16BIT(WDTCTL);                            /* Watchdog Timer Control */
1095
/* The bit names have been prefixed with "WDT" */
1096
#define WDTIS0                 (0x0001)
1097
#define WDTIS1                 (0x0002)
1098
#define WDTSSEL                (0x0004)
1099
#define WDTCNTCL               (0x0008)
1100
#define WDTTMSEL               (0x0010)
1101
#define WDTNMI                 (0x0020)
1102
#define WDTNMIES               (0x0040)
1103
#define WDTHOLD                (0x0080)
1104
 
1105
#define WDTPW                  (0x5A00)
1106
 
1107
/* WDT-interval times [1ms] coded with Bits 0-2 */
1108
/* WDT is clocked by fSMCLK (assumed 1MHz) */
1109
#define WDT_MDLY_32         (WDTPW+WDTTMSEL+WDTCNTCL)                         /* 32ms interval (default) */
1110
#define WDT_MDLY_8          (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS0)                  /* 8ms     " */
1111
#define WDT_MDLY_0_5        (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS1)                  /* 0.5ms   " */
1112
#define WDT_MDLY_0_064      (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS1+WDTIS0)           /* 0.064ms " */
1113
/* WDT is clocked by fACLK (assumed 32KHz) */
1114
#define WDT_ADLY_1000       (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL)                 /* 1000ms  " */
1115
#define WDT_ADLY_250        (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS0)          /* 250ms   " */
1116
#define WDT_ADLY_16         (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS1)          /* 16ms    " */
1117
#define WDT_ADLY_1_9        (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS1+WDTIS0)   /* 1.9ms   " */
1118
/* Watchdog mode -> reset after expired time */
1119
/* WDT is clocked by fSMCLK (assumed 1MHz) */
1120
#define WDT_MRST_32         (WDTPW+WDTCNTCL)                                  /* 32ms interval (default) */
1121
#define WDT_MRST_8          (WDTPW+WDTCNTCL+WDTIS0)                           /* 8ms     " */
1122
#define WDT_MRST_0_5        (WDTPW+WDTCNTCL+WDTIS1)                           /* 0.5ms   " */
1123
#define WDT_MRST_0_064      (WDTPW+WDTCNTCL+WDTIS1+WDTIS0)                    /* 0.064ms " */
1124
/* WDT is clocked by fACLK (assumed 32KHz) */
1125
#define WDT_ARST_1000       (WDTPW+WDTCNTCL+WDTSSEL)                          /* 1000ms  " */
1126
#define WDT_ARST_250        (WDTPW+WDTCNTCL+WDTSSEL+WDTIS0)                   /* 250ms   " */
1127
#define WDT_ARST_16         (WDTPW+WDTCNTCL+WDTSSEL+WDTIS1)                   /* 16ms    " */
1128
#define WDT_ARST_1_9        (WDTPW+WDTCNTCL+WDTSSEL+WDTIS1+WDTIS0)            /* 1.9ms   " */
1129
 
1130
/* INTERRUPT CONTROL */
1131
/* These two bits are defined in the Special Function Registers */
1132
/* #define WDTIE               0x01 */
1133
/* #define WDTIFG              0x01 */
1134
 
1135
/************************************************************
1136
* Calibration Data in Info Mem
1137
************************************************************/
1138
 
1139
/* TLV Calibration Data Structure */
1140
#define TAG_DCO_30             (0x01)         /* Tag for DCO30  Calibration Data */
1141
#define TAG_ADC12_1            (0x08)         /* Tag for ADC12_1 Calibration Data */
1142
#define TAG_EMPTY              (0xFE)         /* Tag for Empty Data Field in Calibration Data */
1143
 
1144
#ifndef __DisableCalData
1145
SFR_16BIT(TLV_CHECKSUM);                      /* TLV CHECK SUM */
1146
SFR_8BIT(TLV_DCO_30_TAG);                     /* TLV TAG_DCO30 TAG */
1147
SFR_8BIT(TLV_DCO_30_LEN);                     /* TLV TAG_DCO30 LEN */
1148
SFR_8BIT(TLV_ADC12_1_TAG);                    /* TLV ADC12_1 TAG */
1149
SFR_8BIT(TLV_ADC12_1_LEN);                    /* TLV ADC12_1 LEN */
1150
#endif
1151
 
1152
#define CAL_ADC_25T85          (0x0007)       /* Index for 2.5V/85Deg Cal. Value */
1153
#define CAL_ADC_25T30          (0x0006)       /* Index for 2.5V/30Deg Cal. Value */
1154
#define CAL_ADC_25VREF_FACTOR  (0x0005)       /* Index for 2.5V Ref. Factor */
1155
#define CAL_ADC_15T85          (0x0004)       /* Index for 1.5V/85Deg Cal. Value */
1156
#define CAL_ADC_15T30          (0x0003)       /* Index for 1.5V/30Deg Cal. Value */
1157
#define CAL_ADC_15VREF_FACTOR  (0x0002)       /* Index for ADC 1.5V Ref. Factor */
1158
#define CAL_ADC_OFFSET         (0x0001)       /* Index for ADC Offset */
1159
#define CAL_ADC_GAIN_FACTOR    (0x0000)       /* Index for ADC Gain Factor */
1160
 
1161
#define CAL_DCO_16MHZ          (0x0000)       /* Index for DCOCTL  Calibration Data for 16MHz */
1162
#define CAL_BC1_16MHZ          (0x0001)       /* Index for BCSCTL1 Calibration Data for 16MHz */
1163
#define CAL_DCO_12MHZ          (0x0002)       /* Index for DCOCTL  Calibration Data for 12MHz */
1164
#define CAL_BC1_12MHZ          (0x0003)       /* Index for BCSCTL1 Calibration Data for 12MHz */
1165
#define CAL_DCO_8MHZ           (0x0004)       /* Index for DCOCTL  Calibration Data for 8MHz */
1166
#define CAL_BC1_8MHZ           (0x0005)       /* Index for BCSCTL1 Calibration Data for 8MHz */
1167
#define CAL_DCO_1MHZ           (0x0006)       /* Index for DCOCTL  Calibration Data for 1MHz */
1168
#define CAL_BC1_1MHZ           (0x0007)       /* Index for BCSCTL1 Calibration Data for 1MHz */
1169
 
1170
 
1171
/************************************************************
1172
* Calibration Data in Info Mem
1173
************************************************************/
1174
 
1175
#ifndef __DisableCalData
1176
 
1177
SFR_8BIT(CALDCO_16MHZ);                       /* DCOCTL  Calibration Data for 16MHz */
1178
SFR_8BIT(CALBC1_16MHZ);                       /* BCSCTL1 Calibration Data for 16MHz */
1179
SFR_8BIT(CALDCO_12MHZ);                       /* DCOCTL  Calibration Data for 12MHz */
1180
SFR_8BIT(CALBC1_12MHZ);                       /* BCSCTL1 Calibration Data for 12MHz */
1181
SFR_8BIT(CALDCO_8MHZ);                        /* DCOCTL  Calibration Data for 8MHz */
1182
SFR_8BIT(CALBC1_8MHZ);                        /* BCSCTL1 Calibration Data for 8MHz */
1183
SFR_8BIT(CALDCO_1MHZ);                        /* DCOCTL  Calibration Data for 1MHz */
1184
SFR_8BIT(CALBC1_1MHZ);                        /* BCSCTL1 Calibration Data for 1MHz */
1185
 
1186
#endif /* #ifndef __DisableCalData */
1187
 
1188
/************************************************************
1189
* Interrupt Vectors (offset from 0xFFC0)
1190
************************************************************/
1191
 
1192
#define VECTOR_NAME(name)       name##_ptr
1193
#define EMIT_PRAGMA(x)          _Pragma(#x)
1194
#define CREATE_VECTOR(name)     void (* const VECTOR_NAME(name))(void) = &name
1195
#define PLACE_VECTOR(vector,section) EMIT_PRAGMA(DATA_SECTION(vector,section))
1196
#define ISR_VECTOR(func,offset) CREATE_VECTOR(func); \
1197
                                PLACE_VECTOR(VECTOR_NAME(func), offset)
1198
 
1199
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1200
#define RESERVED0_VECTOR        ".int00"                    /* 0xFFC0 Reserved Int. Vector 0 */
1201
#else
1202
#define RESERVED0_VECTOR        (0 * 1u)                     /* 0xFFC0 Reserved Int. Vector 0 */
1203
/*#define RESERVED0_ISR(func)     ISR_VECTOR(func, ".int00")  */ /* 0xFFC0 Reserved Int. Vector 0 */ /* CCE V2 Style */
1204
#endif
1205
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1206
#define RESERVED1_VECTOR        ".int01"                    /* 0xFFC2 Reserved Int. Vector 1 */
1207
#else
1208
#define RESERVED1_VECTOR        (1 * 1u)                     /* 0xFFC2 Reserved Int. Vector 1 */
1209
/*#define RESERVED1_ISR(func)     ISR_VECTOR(func, ".int01")  */ /* 0xFFC2 Reserved Int. Vector 1 */ /* CCE V2 Style */
1210
#endif
1211
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1212
#define RESERVED2_VECTOR        ".int02"                    /* 0xFFC4 Reserved Int. Vector 2 */
1213
#else
1214
#define RESERVED2_VECTOR        (2 * 1u)                     /* 0xFFC4 Reserved Int. Vector 2 */
1215
/*#define RESERVED2_ISR(func)     ISR_VECTOR(func, ".int02")  */ /* 0xFFC4 Reserved Int. Vector 2 */ /* CCE V2 Style */
1216
#endif
1217
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1218
#define RESERVED3_VECTOR        ".int03"                    /* 0xFFC6 Reserved Int. Vector 3 */
1219
#else
1220
#define RESERVED3_VECTOR        (3 * 1u)                     /* 0xFFC6 Reserved Int. Vector 3 */
1221
/*#define RESERVED3_ISR(func)     ISR_VECTOR(func, ".int03")  */ /* 0xFFC6 Reserved Int. Vector 3 */ /* CCE V2 Style */
1222
#endif
1223
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1224
#define RESERVED4_VECTOR        ".int04"                    /* 0xFFC8 Reserved Int. Vector 4 */
1225
#else
1226
#define RESERVED4_VECTOR        (4 * 1u)                     /* 0xFFC8 Reserved Int. Vector 4 */
1227
/*#define RESERVED4_ISR(func)     ISR_VECTOR(func, ".int04")  */ /* 0xFFC8 Reserved Int. Vector 4 */ /* CCE V2 Style */
1228
#endif
1229
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1230
#define RESERVED5_VECTOR        ".int05"                    /* 0xFFCA Reserved Int. Vector 5 */
1231
#else
1232
#define RESERVED5_VECTOR        (5 * 1u)                     /* 0xFFCA Reserved Int. Vector 5 */
1233
/*#define RESERVED5_ISR(func)     ISR_VECTOR(func, ".int05")  */ /* 0xFFCA Reserved Int. Vector 5 */ /* CCE V2 Style */
1234
#endif
1235
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1236
#define RESERVED6_VECTOR        ".int06"                    /* 0xFFCC Reserved Int. Vector 6 */
1237
#else
1238
#define RESERVED6_VECTOR        (6 * 1u)                     /* 0xFFCC Reserved Int. Vector 6 */
1239
/*#define RESERVED6_ISR(func)     ISR_VECTOR(func, ".int06")  */ /* 0xFFCC Reserved Int. Vector 6 */ /* CCE V2 Style */
1240
#endif
1241
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1242
#define RESERVED7_VECTOR        ".int07"                    /* 0xFFCE Reserved Int. Vector 7 */
1243
#else
1244
#define RESERVED7_VECTOR        (7 * 1u)                     /* 0xFFCE Reserved Int. Vector 7 */
1245
/*#define RESERVED7_ISR(func)     ISR_VECTOR(func, ".int07")  */ /* 0xFFCE Reserved Int. Vector 7 */ /* CCE V2 Style */
1246
#endif
1247
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1248
#define RESERVED8_VECTOR        ".int08"                    /* 0xFFD0 Reserved Int. Vector 8 */
1249
#else
1250
#define RESERVED8_VECTOR        (8 * 1u)                     /* 0xFFD0 Reserved Int. Vector 8 */
1251
/*#define RESERVED8_ISR(func)     ISR_VECTOR(func, ".int08")  */ /* 0xFFD0 Reserved Int. Vector 8 */ /* CCE V2 Style */
1252
#endif
1253
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1254
#define RESERVED9_VECTOR        ".int09"                    /* 0xFFD2 Reserved Int. Vector 9 */
1255
#else
1256
#define RESERVED9_VECTOR        (9 * 1u)                     /* 0xFFD2 Reserved Int. Vector 9 */
1257
/*#define RESERVED9_ISR(func)     ISR_VECTOR(func, ".int09")  */ /* 0xFFD2 Reserved Int. Vector 9 */ /* CCE V2 Style */
1258
#endif
1259
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1260
#define RESERVED10_VECTOR       ".int10"                    /* 0xFFD4 Reserved Int. Vector 10 */
1261
#else
1262
#define RESERVED10_VECTOR       (10 * 1u)                    /* 0xFFD4 Reserved Int. Vector 10 */
1263
/*#define RESERVED10_ISR(func)    ISR_VECTOR(func, ".int10")  */ /* 0xFFD4 Reserved Int. Vector 10 */ /* CCE V2 Style */
1264
#endif
1265
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1266
#define RESERVED11_VECTOR       ".int11"                    /* 0xFFD6 Reserved Int. Vector 11 */
1267
#else
1268
#define RESERVED11_VECTOR       (11 * 1u)                    /* 0xFFD6 Reserved Int. Vector 11 */
1269
/*#define RESERVED11_ISR(func)    ISR_VECTOR(func, ".int11")  */ /* 0xFFD6 Reserved Int. Vector 11 */ /* CCE V2 Style */
1270
#endif
1271
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1272
#define RESERVED12_VECTOR       ".int12"                    /* 0xFFD8 Reserved Int. Vector 12 */
1273
#else
1274
#define RESERVED12_VECTOR       (12 * 1u)                    /* 0xFFD8 Reserved Int. Vector 12 */
1275
/*#define RESERVED12_ISR(func)    ISR_VECTOR(func, ".int12")  */ /* 0xFFD8 Reserved Int. Vector 12 */ /* CCE V2 Style */
1276
#endif
1277
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1278
#define RESERVED13_VECTOR       ".int13"                    /* 0xFFDA Reserved Int. Vector 13 */
1279
#else
1280
#define RESERVED13_VECTOR       (13 * 1u)                    /* 0xFFDA Reserved Int. Vector 13 */
1281
/*#define RESERVED13_ISR(func)    ISR_VECTOR(func, ".int13")  */ /* 0xFFDA Reserved Int. Vector 13 */ /* CCE V2 Style */
1282
#endif
1283
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1284
#define RESERVED14_VECTOR       ".int14"                    /* 0xFFDC Reserved Int. Vector 14 */
1285
#else
1286
#define RESERVED14_VECTOR       (14 * 1u)                    /* 0xFFDC Reserved Int. Vector 14 */
1287
/*#define RESERVED14_ISR(func)    ISR_VECTOR(func, ".int14")  */ /* 0xFFDC Reserved Int. Vector 14 */ /* CCE V2 Style */
1288
#endif
1289
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1290
#define RESERVED15_VECTOR       ".int15"                    /* 0xFFDE Reserved Int. Vector 15 */
1291
#else
1292
#define RESERVED15_VECTOR       (15 * 1u)                    /* 0xFFDE Reserved Int. Vector 15 */
1293
/*#define RESERVED15_ISR(func)    ISR_VECTOR(func, ".int15")  */ /* 0xFFDE Reserved Int. Vector 15 */ /* CCE V2 Style */
1294
#endif
1295
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1296
#define USCIAB1TX_VECTOR        ".int16"                    /* 0xFFE0 USCI A1/B1 Transmit */
1297
#else
1298
#define USCIAB1TX_VECTOR        (16 * 1u)                    /* 0xFFE0 USCI A1/B1 Transmit */
1299
/*#define USCIAB1TX_ISR(func)     ISR_VECTOR(func, ".int16")  */ /* 0xFFE0 USCI A1/B1 Transmit */ /* CCE V2 Style */
1300
#endif
1301
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1302
#define USCIAB1RX_VECTOR        ".int17"                    /* 0xFFE2 USCI A1/B1 Receive */
1303
#else
1304
#define USCIAB1RX_VECTOR        (17 * 1u)                    /* 0xFFE2 USCI A1/B1 Receive */
1305
/*#define USCIAB1RX_ISR(func)     ISR_VECTOR(func, ".int17")  */ /* 0xFFE2 USCI A1/B1 Receive */ /* CCE V2 Style */
1306
#endif
1307
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1308
#define PORT1_VECTOR            ".int18"                    /* 0xFFE4 Port 1 */
1309
#else
1310
#define PORT1_VECTOR            (18 * 1u)                    /* 0xFFE4 Port 1 */
1311
/*#define PORT1_ISR(func)         ISR_VECTOR(func, ".int18")  */ /* 0xFFE4 Port 1 */ /* CCE V2 Style */
1312
#endif
1313
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1314
#define PORT2_VECTOR            ".int19"                    /* 0xFFE6 Port 2 */
1315
#else
1316
#define PORT2_VECTOR            (19 * 1u)                    /* 0xFFE6 Port 2 */
1317
/*#define PORT2_ISR(func)         ISR_VECTOR(func, ".int19")  */ /* 0xFFE6 Port 2 */ /* CCE V2 Style */
1318
#endif
1319
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1320
#define RESERVED20_VECTOR       ".int20"                    /* 0xFFE8 Reserved Int. Vector 20 */
1321
#else
1322
#define RESERVED20_VECTOR       (20 * 1u)                    /* 0xFFE8 Reserved Int. Vector 20 */
1323
/*#define RESERVED20_ISR(func)    ISR_VECTOR(func, ".int20")  */ /* 0xFFE8 Reserved Int. Vector 20 */ /* CCE V2 Style */
1324
#endif
1325
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1326
#define ADC12_VECTOR            ".int21"                    /* 0xFFEA ADC */
1327
#else
1328
#define ADC12_VECTOR            (21 * 1u)                    /* 0xFFEA ADC */
1329
/*#define ADC12_ISR(func)         ISR_VECTOR(func, ".int21")  */ /* 0xFFEA ADC */ /* CCE V2 Style */
1330
#endif
1331
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1332
#define USCIAB0TX_VECTOR        ".int22"                    /* 0xFFEC USCI A0/B0 Transmit */
1333
#else
1334
#define USCIAB0TX_VECTOR        (22 * 1u)                    /* 0xFFEC USCI A0/B0 Transmit */
1335
/*#define USCIAB0TX_ISR(func)     ISR_VECTOR(func, ".int22")  */ /* 0xFFEC USCI A0/B0 Transmit */ /* CCE V2 Style */
1336
#endif
1337
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1338
#define USCIAB0RX_VECTOR        ".int23"                    /* 0xFFEE USCI A0/B0 Receive */
1339
#else
1340
#define USCIAB0RX_VECTOR        (23 * 1u)                    /* 0xFFEE USCI A0/B0 Receive */
1341
/*#define USCIAB0RX_ISR(func)     ISR_VECTOR(func, ".int23")  */ /* 0xFFEE USCI A0/B0 Receive */ /* CCE V2 Style */
1342
#endif
1343
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1344
#define TIMERA1_VECTOR          ".int24"                    /* 0xFFF0 Timer A CC1-2, TA */
1345
#else
1346
#define TIMERA1_VECTOR          (24 * 1u)                    /* 0xFFF0 Timer A CC1-2, TA */
1347
/*#define TIMERA1_ISR(func)       ISR_VECTOR(func, ".int24")  */ /* 0xFFF0 Timer A CC1-2, TA */ /* CCE V2 Style */
1348
#endif
1349
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1350
#define TIMERA0_VECTOR          ".int25"                    /* 0xFFF2 Timer A CC0 */
1351
#else
1352
#define TIMERA0_VECTOR          (25 * 1u)                    /* 0xFFF2 Timer A CC0 */
1353
/*#define TIMERA0_ISR(func)       ISR_VECTOR(func, ".int25")  */ /* 0xFFF2 Timer A CC0 */ /* CCE V2 Style */
1354
#endif
1355
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1356
#define WDT_VECTOR              ".int26"                    /* 0xFFF4 Watchdog Timer */
1357
#else
1358
#define WDT_VECTOR              (26 * 1u)                    /* 0xFFF4 Watchdog Timer */
1359
/*#define WDT_ISR(func)           ISR_VECTOR(func, ".int26")  */ /* 0xFFF4 Watchdog Timer */ /* CCE V2 Style */
1360
#endif
1361
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1362
#define COMPARATORA_VECTOR      ".int27"                    /* 0xFFF6 Comparator A */
1363
#else
1364
#define COMPARATORA_VECTOR      (27 * 1u)                    /* 0xFFF6 Comparator A */
1365
/*#define COMPARATORA_ISR(func)   ISR_VECTOR(func, ".int27")  */ /* 0xFFF6 Comparator A */ /* CCE V2 Style */
1366
#endif
1367
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1368
#define TIMERB1_VECTOR          ".int28"                    /* 0xFFF8 Timer B CC1-6, TB */
1369
#else
1370
#define TIMERB1_VECTOR          (28 * 1u)                    /* 0xFFF8 Timer B CC1-6, TB */
1371
/*#define TIMERB1_ISR(func)       ISR_VECTOR(func, ".int28")  */ /* 0xFFF8 Timer B CC1-6, TB */ /* CCE V2 Style */
1372
#endif
1373
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1374
#define TIMERB0_VECTOR          ".int29"                    /* 0xFFFA Timer B CC0 */
1375
#else
1376
#define TIMERB0_VECTOR          (29 * 1u)                    /* 0xFFFA Timer B CC0 */
1377
/*#define TIMERB0_ISR(func)       ISR_VECTOR(func, ".int29")  */ /* 0xFFFA Timer B CC0 */ /* CCE V2 Style */
1378
#endif
1379
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1380
#define NMI_VECTOR              ".int30"                    /* 0xFFFC Non-maskable */
1381
#else
1382
#define NMI_VECTOR              (30 * 1u)                    /* 0xFFFC Non-maskable */
1383
/*#define NMI_ISR(func)           ISR_VECTOR(func, ".int30")  */ /* 0xFFFC Non-maskable */ /* CCE V2 Style */
1384
#endif
1385
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1386
#define RESET_VECTOR            ".reset"                    /* 0xFFFE Reset [Highest Priority] */
1387
#else
1388
#define RESET_VECTOR            (31 * 1u)                    /* 0xFFFE Reset [Highest Priority] */
1389
/*#define RESET_ISR(func)         ISR_VECTOR(func, ".int31")  */ /* 0xFFFE Reset [Highest Priority] */ /* CCE V2 Style */
1390
#endif
1391
 
1392
/************************************************************
1393
* End of Modules
1394
************************************************************/
1395
 
1396
#ifdef __cplusplus
1397
}
1398
#endif /* extern "C" */
1399
 
1400
#endif /* #ifndef __msp430x24x */
1401