Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2850 dpurdie 1
/******************************************************************************/
2
/* Legacy Header File                                                         */
3
/* Not recommended for use in new projects.                                   */
4
/* Please use the msp430.h file or the device specific header file            */
5
/******************************************************************************/
6
 
7
/********************************************************************
8
*
9
* Standard register and bit definitions for the Texas Instruments
10
* MSP430 microcontroller.
11
*
12
* This file supports assembler and C development for
13
* msp430x552x devices.
14
*
15
* Texas Instruments, Version 1.4
16
*
17
* Rev. 1.0, Setup
18
* Rev. 1.1, Fixed Error in DMA Trigger Definitons
19
* Rev. 1.2, fixed SYSUNIV_BUSIFG definition
20
*           fixed wrong bit definition in PM5CTL0 (LOCKLPM5)
21
* Rev. 1.3, Changed access type of DMAxSZ registers to word only
22
* Rev. 1.4  Changed access type of TimerA/B registers to word only
23
*
24
********************************************************************/
25
 
26
#ifndef __msp430x552x
27
#define __msp430x552x
28
 
29
#ifdef __cplusplus
30
extern "C" {
31
#endif
32
 
33
 
34
/*----------------------------------------------------------------------------*/
35
/* PERIPHERAL FILE MAP                                                        */
36
/*----------------------------------------------------------------------------*/
37
 
38
/* External references resolved by a device-specific linker command file */
39
#define SFR_8BIT(address)   extern volatile unsigned char address
40
#define SFR_16BIT(address)  extern volatile unsigned int address
41
//#define SFR_20BIT(address)  extern volatile unsigned int address
42
typedef void (* __SFR_FARPTR)();
43
#define SFR_20BIT(address) extern __SFR_FARPTR address
44
#define SFR_32BIT(address)  extern volatile unsigned long address
45
 
46
 
47
 
48
/************************************************************
49
* STANDARD BITS
50
************************************************************/
51
 
52
#define BIT0                   (0x0001)
53
#define BIT1                   (0x0002)
54
#define BIT2                   (0x0004)
55
#define BIT3                   (0x0008)
56
#define BIT4                   (0x0010)
57
#define BIT5                   (0x0020)
58
#define BIT6                   (0x0040)
59
#define BIT7                   (0x0080)
60
#define BIT8                   (0x0100)
61
#define BIT9                   (0x0200)
62
#define BITA                   (0x0400)
63
#define BITB                   (0x0800)
64
#define BITC                   (0x1000)
65
#define BITD                   (0x2000)
66
#define BITE                   (0x4000)
67
#define BITF                   (0x8000)
68
 
69
/************************************************************
70
* STATUS REGISTER BITS
71
************************************************************/
72
 
73
#define C                      (0x0001)
74
#define Z                      (0x0002)
75
#define N                      (0x0004)
76
#define V                      (0x0100)
77
#define GIE                    (0x0008)
78
#define CPUOFF                 (0x0010)
79
#define OSCOFF                 (0x0020)
80
#define SCG0                   (0x0040)
81
#define SCG1                   (0x0080)
82
 
83
/* Low Power Modes coded with Bits 4-7 in SR */
84
 
85
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
86
#define LPM0                   (CPUOFF)
87
#define LPM1                   (SCG0+CPUOFF)
88
#define LPM2                   (SCG1+CPUOFF)
89
#define LPM3                   (SCG1+SCG0+CPUOFF)
90
#define LPM4                   (SCG1+SCG0+OSCOFF+CPUOFF)
91
/* End #defines for assembler */
92
 
93
#else /* Begin #defines for C */
94
#define LPM0_bits              (CPUOFF)
95
#define LPM1_bits              (SCG0+CPUOFF)
96
#define LPM2_bits              (SCG1+CPUOFF)
97
#define LPM3_bits              (SCG1+SCG0+CPUOFF)
98
#define LPM4_bits              (SCG1+SCG0+OSCOFF+CPUOFF)
99
 
100
#include "in430.h"
101
 
102
#define LPM0         _bis_SR_register(LPM0_bits)         /* Enter Low Power Mode 0 */
103
#define LPM0_EXIT    _bic_SR_register_on_exit(LPM0_bits) /* Exit Low Power Mode 0 */
104
#define LPM1         _bis_SR_register(LPM1_bits)         /* Enter Low Power Mode 1 */
105
#define LPM1_EXIT    _bic_SR_register_on_exit(LPM1_bits) /* Exit Low Power Mode 1 */
106
#define LPM2         _bis_SR_register(LPM2_bits)         /* Enter Low Power Mode 2 */
107
#define LPM2_EXIT    _bic_SR_register_on_exit(LPM2_bits) /* Exit Low Power Mode 2 */
108
#define LPM3         _bis_SR_register(LPM3_bits)         /* Enter Low Power Mode 3 */
109
#define LPM3_EXIT    _bic_SR_register_on_exit(LPM3_bits) /* Exit Low Power Mode 3 */
110
#define LPM4         _bis_SR_register(LPM4_bits)         /* Enter Low Power Mode 4 */
111
#define LPM4_EXIT    _bic_SR_register_on_exit(LPM4_bits) /* Exit Low Power Mode 4 */
112
#endif /* End #defines for C */
113
 
114
/************************************************************
115
* CPU
116
************************************************************/
117
#define __MSP430_HAS_MSP430XV2_CPU__                /* Definition to show that it has MSP430XV2 CPU */
118
 
119
/************************************************************
120
* PERIPHERAL FILE MAP
121
************************************************************/
122
 
123
/************************************************************
124
* ADC12 PLUS
125
************************************************************/
126
#define __MSP430_HAS_ADC12_PLUS__                /* Definition to show that Module is available */
127
#define __MSP430_BASEADDRESS_ADC12_PLUS__ 0x0700
128
 
129
SFR_16BIT(ADC12CTL0);                         /* ADC12+ Control 0 */
130
SFR_8BIT(ADC12CTL0_L);                        /* ADC12+ Control 0 */
131
SFR_8BIT(ADC12CTL0_H);                        /* ADC12+ Control 0 */
132
SFR_16BIT(ADC12CTL1);                         /* ADC12+ Control 1 */
133
SFR_8BIT(ADC12CTL1_L);                        /* ADC12+ Control 1 */
134
SFR_8BIT(ADC12CTL1_H);                        /* ADC12+ Control 1 */
135
SFR_16BIT(ADC12CTL2);                         /* ADC12+ Control 2 */
136
SFR_8BIT(ADC12CTL2_L);                        /* ADC12+ Control 2 */
137
SFR_8BIT(ADC12CTL2_H);                        /* ADC12+ Control 2 */
138
SFR_16BIT(ADC12IFG);                          /* ADC12+ Interrupt Flag */
139
SFR_8BIT(ADC12IFG_L);                         /* ADC12+ Interrupt Flag */
140
SFR_8BIT(ADC12IFG_H);                         /* ADC12+ Interrupt Flag */
141
SFR_16BIT(ADC12IE);                           /* ADC12+ Interrupt Enable */
142
SFR_8BIT(ADC12IE_L);                          /* ADC12+ Interrupt Enable */
143
SFR_8BIT(ADC12IE_H);                          /* ADC12+ Interrupt Enable */
144
SFR_16BIT(ADC12IV);                           /* ADC12+ Interrupt Vector Word */
145
SFR_8BIT(ADC12IV_L);                          /* ADC12+ Interrupt Vector Word */
146
SFR_8BIT(ADC12IV_H);                          /* ADC12+ Interrupt Vector Word */
147
 
148
SFR_16BIT(ADC12MEM0);                         /* ADC12 Conversion Memory 0 */
149
SFR_8BIT(ADC12MEM0_L);                        /* ADC12 Conversion Memory 0 */
150
SFR_8BIT(ADC12MEM0_H);                        /* ADC12 Conversion Memory 0 */
151
SFR_16BIT(ADC12MEM1);                         /* ADC12 Conversion Memory 1 */
152
SFR_8BIT(ADC12MEM1_L);                        /* ADC12 Conversion Memory 1 */
153
SFR_8BIT(ADC12MEM1_H);                        /* ADC12 Conversion Memory 1 */
154
SFR_16BIT(ADC12MEM2);                         /* ADC12 Conversion Memory 2 */
155
SFR_8BIT(ADC12MEM2_L);                        /* ADC12 Conversion Memory 2 */
156
SFR_8BIT(ADC12MEM2_H);                        /* ADC12 Conversion Memory 2 */
157
SFR_16BIT(ADC12MEM3);                         /* ADC12 Conversion Memory 3 */
158
SFR_8BIT(ADC12MEM3_L);                        /* ADC12 Conversion Memory 3 */
159
SFR_8BIT(ADC12MEM3_H);                        /* ADC12 Conversion Memory 3 */
160
SFR_16BIT(ADC12MEM4);                         /* ADC12 Conversion Memory 4 */
161
SFR_8BIT(ADC12MEM4_L);                        /* ADC12 Conversion Memory 4 */
162
SFR_8BIT(ADC12MEM4_H);                        /* ADC12 Conversion Memory 4 */
163
SFR_16BIT(ADC12MEM5);                         /* ADC12 Conversion Memory 5 */
164
SFR_8BIT(ADC12MEM5_L);                        /* ADC12 Conversion Memory 5 */
165
SFR_8BIT(ADC12MEM5_H);                        /* ADC12 Conversion Memory 5 */
166
SFR_16BIT(ADC12MEM6);                         /* ADC12 Conversion Memory 6 */
167
SFR_8BIT(ADC12MEM6_L);                        /* ADC12 Conversion Memory 6 */
168
SFR_8BIT(ADC12MEM6_H);                        /* ADC12 Conversion Memory 6 */
169
SFR_16BIT(ADC12MEM7);                         /* ADC12 Conversion Memory 7 */
170
SFR_8BIT(ADC12MEM7_L);                        /* ADC12 Conversion Memory 7 */
171
SFR_8BIT(ADC12MEM7_H);                        /* ADC12 Conversion Memory 7 */
172
SFR_16BIT(ADC12MEM8);                         /* ADC12 Conversion Memory 8 */
173
SFR_8BIT(ADC12MEM8_L);                        /* ADC12 Conversion Memory 8 */
174
SFR_8BIT(ADC12MEM8_H);                        /* ADC12 Conversion Memory 8 */
175
SFR_16BIT(ADC12MEM9);                         /* ADC12 Conversion Memory 9 */
176
SFR_8BIT(ADC12MEM9_L);                        /* ADC12 Conversion Memory 9 */
177
SFR_8BIT(ADC12MEM9_H);                        /* ADC12 Conversion Memory 9 */
178
SFR_16BIT(ADC12MEM10);                        /* ADC12 Conversion Memory 10 */
179
SFR_8BIT(ADC12MEM10_L);                       /* ADC12 Conversion Memory 10 */
180
SFR_8BIT(ADC12MEM10_H);                       /* ADC12 Conversion Memory 10 */
181
SFR_16BIT(ADC12MEM11);                        /* ADC12 Conversion Memory 11 */
182
SFR_8BIT(ADC12MEM11_L);                       /* ADC12 Conversion Memory 11 */
183
SFR_8BIT(ADC12MEM11_H);                       /* ADC12 Conversion Memory 11 */
184
SFR_16BIT(ADC12MEM12);                        /* ADC12 Conversion Memory 12 */
185
SFR_8BIT(ADC12MEM12_L);                       /* ADC12 Conversion Memory 12 */
186
SFR_8BIT(ADC12MEM12_H);                       /* ADC12 Conversion Memory 12 */
187
SFR_16BIT(ADC12MEM13);                        /* ADC12 Conversion Memory 13 */
188
SFR_8BIT(ADC12MEM13_L);                       /* ADC12 Conversion Memory 13 */
189
SFR_8BIT(ADC12MEM13_H);                       /* ADC12 Conversion Memory 13 */
190
SFR_16BIT(ADC12MEM14);                        /* ADC12 Conversion Memory 14 */
191
SFR_8BIT(ADC12MEM14_L);                       /* ADC12 Conversion Memory 14 */
192
SFR_8BIT(ADC12MEM14_H);                       /* ADC12 Conversion Memory 14 */
193
SFR_16BIT(ADC12MEM15);                        /* ADC12 Conversion Memory 15 */
194
SFR_8BIT(ADC12MEM15_L);                       /* ADC12 Conversion Memory 15 */
195
SFR_8BIT(ADC12MEM15_H);                       /* ADC12 Conversion Memory 15 */
196
#define ADC12MEM_              ADC12MEM       /* ADC12 Conversion Memory */
197
#ifdef __ASM_HEADER__
198
#define ADC12MEM               ADC12MEM0      /* ADC12 Conversion Memory (for assembler) */
199
#else
200
#define ADC12MEM               ((int*)        &ADC12MEM0) /* ADC12 Conversion Memory (for C) */
201
#endif
202
 
203
SFR_8BIT(ADC12MCTL0);                         /* ADC12 Memory Control 0 */
204
SFR_8BIT(ADC12MCTL1);                         /* ADC12 Memory Control 1 */
205
SFR_8BIT(ADC12MCTL2);                         /* ADC12 Memory Control 2 */
206
SFR_8BIT(ADC12MCTL3);                         /* ADC12 Memory Control 3 */
207
SFR_8BIT(ADC12MCTL4);                         /* ADC12 Memory Control 4 */
208
SFR_8BIT(ADC12MCTL5);                         /* ADC12 Memory Control 5 */
209
SFR_8BIT(ADC12MCTL6);                         /* ADC12 Memory Control 6 */
210
SFR_8BIT(ADC12MCTL7);                         /* ADC12 Memory Control 7 */
211
SFR_8BIT(ADC12MCTL8);                         /* ADC12 Memory Control 8 */
212
SFR_8BIT(ADC12MCTL9);                         /* ADC12 Memory Control 9 */
213
SFR_8BIT(ADC12MCTL10);                        /* ADC12 Memory Control 10 */
214
SFR_8BIT(ADC12MCTL11);                        /* ADC12 Memory Control 11 */
215
SFR_8BIT(ADC12MCTL12);                        /* ADC12 Memory Control 12 */
216
SFR_8BIT(ADC12MCTL13);                        /* ADC12 Memory Control 13 */
217
SFR_8BIT(ADC12MCTL14);                        /* ADC12 Memory Control 14 */
218
SFR_8BIT(ADC12MCTL15);                        /* ADC12 Memory Control 15 */
219
#define ADC12MCTL_             ADC12MCTL      /* ADC12 Memory Control */
220
#ifdef __ASM_HEADER__
221
#define ADC12MCTL              ADC12MCTL0     /* ADC12 Memory Control (for assembler) */
222
#else
223
#define ADC12MCTL              ((char*)       &ADC12MCTL0) /* ADC12 Memory Control (for C) */
224
#endif
225
 
226
/* ADC12CTL0 Control Bits */
227
#define ADC12SC                (0x0001)       /* ADC12 Start Conversion */
228
#define ADC12ENC               (0x0002)       /* ADC12 Enable Conversion */
229
#define ADC12TOVIE             (0x0004)       /* ADC12 Timer Overflow interrupt enable */
230
#define ADC12OVIE              (0x0008)       /* ADC12 Overflow interrupt enable */
231
#define ADC12ON                (0x0010)       /* ADC12 On/enable */
232
#define ADC12REFON             (0x0020)       /* ADC12 Reference on */
233
#define ADC12REF2_5V           (0x0040)       /* ADC12 Ref 0:1.5V / 1:2.5V */
234
#define ADC12MSC               (0x0080)       /* ADC12 Multiple SampleConversion */
235
#define ADC12SHT00             (0x0100)       /* ADC12 Sample Hold 0 Select Bit: 0 */
236
#define ADC12SHT01             (0x0200)       /* ADC12 Sample Hold 0 Select Bit: 1 */
237
#define ADC12SHT02             (0x0400)       /* ADC12 Sample Hold 0 Select Bit: 2 */
238
#define ADC12SHT03             (0x0800)       /* ADC12 Sample Hold 0 Select Bit: 3 */
239
#define ADC12SHT10             (0x1000)       /* ADC12 Sample Hold 1 Select Bit: 0 */
240
#define ADC12SHT11             (0x2000)       /* ADC12 Sample Hold 1 Select Bit: 1 */
241
#define ADC12SHT12             (0x4000)       /* ADC12 Sample Hold 1 Select Bit: 2 */
242
#define ADC12SHT13             (0x8000)       /* ADC12 Sample Hold 1 Select Bit: 3 */
243
 
244
/* ADC12CTL0 Control Bits */
245
#define ADC12SC_L              (0x0001)       /* ADC12 Start Conversion */
246
#define ADC12ENC_L             (0x0002)       /* ADC12 Enable Conversion */
247
#define ADC12TOVIE_L           (0x0004)       /* ADC12 Timer Overflow interrupt enable */
248
#define ADC12OVIE_L            (0x0008)       /* ADC12 Overflow interrupt enable */
249
#define ADC12ON_L              (0x0010)       /* ADC12 On/enable */
250
#define ADC12REFON_L           (0x0020)       /* ADC12 Reference on */
251
#define ADC12REF2_5V_L         (0x0040)       /* ADC12 Ref 0:1.5V / 1:2.5V */
252
#define ADC12MSC_L             (0x0080)       /* ADC12 Multiple SampleConversion */
253
 
254
/* ADC12CTL0 Control Bits */
255
#define ADC12SHT00_H           (0x0001)       /* ADC12 Sample Hold 0 Select Bit: 0 */
256
#define ADC12SHT01_H           (0x0002)       /* ADC12 Sample Hold 0 Select Bit: 1 */
257
#define ADC12SHT02_H           (0x0004)       /* ADC12 Sample Hold 0 Select Bit: 2 */
258
#define ADC12SHT03_H           (0x0008)       /* ADC12 Sample Hold 0 Select Bit: 3 */
259
#define ADC12SHT10_H           (0x0010)       /* ADC12 Sample Hold 1 Select Bit: 0 */
260
#define ADC12SHT11_H           (0x0020)       /* ADC12 Sample Hold 1 Select Bit: 1 */
261
#define ADC12SHT12_H           (0x0040)       /* ADC12 Sample Hold 1 Select Bit: 2 */
262
#define ADC12SHT13_H           (0x0080)       /* ADC12 Sample Hold 1 Select Bit: 3 */
263
 
264
#define ADC12SHT0_0            (0*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 0 */
265
#define ADC12SHT0_1            (1*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 1 */
266
#define ADC12SHT0_2            (2*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 2 */
267
#define ADC12SHT0_3            (3*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 3 */
268
#define ADC12SHT0_4            (4*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 4 */
269
#define ADC12SHT0_5            (5*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 5 */
270
#define ADC12SHT0_6            (6*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 6 */
271
#define ADC12SHT0_7            (7*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 7 */
272
#define ADC12SHT0_8            (8*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 8 */
273
#define ADC12SHT0_9            (9*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 9 */
274
#define ADC12SHT0_10           (10*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 10 */
275
#define ADC12SHT0_11           (11*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 11 */
276
#define ADC12SHT0_12           (12*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 12 */
277
#define ADC12SHT0_13           (13*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 13 */
278
#define ADC12SHT0_14           (14*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 14 */
279
#define ADC12SHT0_15           (15*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 15 */
280
 
281
#define ADC12SHT1_0            (0*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 0 */
282
#define ADC12SHT1_1            (1*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 1 */
283
#define ADC12SHT1_2            (2*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 2 */
284
#define ADC12SHT1_3            (3*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 3 */
285
#define ADC12SHT1_4            (4*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 4 */
286
#define ADC12SHT1_5            (5*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 5 */
287
#define ADC12SHT1_6            (6*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 6 */
288
#define ADC12SHT1_7            (7*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 7 */
289
#define ADC12SHT1_8            (8*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 8 */
290
#define ADC12SHT1_9            (9*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 9 */
291
#define ADC12SHT1_10           (10*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 10 */
292
#define ADC12SHT1_11           (11*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 11 */
293
#define ADC12SHT1_12           (12*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 12 */
294
#define ADC12SHT1_13           (13*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 13 */
295
#define ADC12SHT1_14           (14*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 14 */
296
#define ADC12SHT1_15           (15*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 15 */
297
 
298
/* ADC12CTL1 Control Bits */
299
#define ADC12BUSY              (0x0001)       /* ADC12 Busy */
300
#define ADC12CONSEQ0           (0x0002)       /* ADC12 Conversion Sequence Select Bit: 0 */
301
#define ADC12CONSEQ1           (0x0004)       /* ADC12 Conversion Sequence Select Bit: 1 */
302
#define ADC12SSEL0             (0x0008)       /* ADC12 Clock Source Select Bit: 0 */
303
#define ADC12SSEL1             (0x0010)       /* ADC12 Clock Source Select Bit: 1 */
304
#define ADC12DIV0              (0x0020)       /* ADC12 Clock Divider Select Bit: 0 */
305
#define ADC12DIV1              (0x0040)       /* ADC12 Clock Divider Select Bit: 1 */
306
#define ADC12DIV2              (0x0080)       /* ADC12 Clock Divider Select Bit: 2 */
307
#define ADC12ISSH              (0x0100)       /* ADC12 Invert Sample Hold Signal */
308
#define ADC12SHP               (0x0200)       /* ADC12 Sample/Hold Pulse Mode */
309
#define ADC12SHS0              (0x0400)       /* ADC12 Sample/Hold Source Bit: 0 */
310
#define ADC12SHS1              (0x0800)       /* ADC12 Sample/Hold Source Bit: 1 */
311
#define ADC12CSTARTADD0        (0x1000)       /* ADC12 Conversion Start Address Bit: 0 */
312
#define ADC12CSTARTADD1        (0x2000)       /* ADC12 Conversion Start Address Bit: 1 */
313
#define ADC12CSTARTADD2        (0x4000)       /* ADC12 Conversion Start Address Bit: 2 */
314
#define ADC12CSTARTADD3        (0x8000)       /* ADC12 Conversion Start Address Bit: 3 */
315
 
316
/* ADC12CTL1 Control Bits */
317
#define ADC12BUSY_L            (0x0001)       /* ADC12 Busy */
318
#define ADC12CONSEQ0_L         (0x0002)       /* ADC12 Conversion Sequence Select Bit: 0 */
319
#define ADC12CONSEQ1_L         (0x0004)       /* ADC12 Conversion Sequence Select Bit: 1 */
320
#define ADC12SSEL0_L           (0x0008)       /* ADC12 Clock Source Select Bit: 0 */
321
#define ADC12SSEL1_L           (0x0010)       /* ADC12 Clock Source Select Bit: 1 */
322
#define ADC12DIV0_L            (0x0020)       /* ADC12 Clock Divider Select Bit: 0 */
323
#define ADC12DIV1_L            (0x0040)       /* ADC12 Clock Divider Select Bit: 1 */
324
#define ADC12DIV2_L            (0x0080)       /* ADC12 Clock Divider Select Bit: 2 */
325
 
326
/* ADC12CTL1 Control Bits */
327
#define ADC12ISSH_H            (0x0001)       /* ADC12 Invert Sample Hold Signal */
328
#define ADC12SHP_H             (0x0002)       /* ADC12 Sample/Hold Pulse Mode */
329
#define ADC12SHS0_H            (0x0004)       /* ADC12 Sample/Hold Source Bit: 0 */
330
#define ADC12SHS1_H            (0x0008)       /* ADC12 Sample/Hold Source Bit: 1 */
331
#define ADC12CSTARTADD0_H      (0x0010)       /* ADC12 Conversion Start Address Bit: 0 */
332
#define ADC12CSTARTADD1_H      (0x0020)       /* ADC12 Conversion Start Address Bit: 1 */
333
#define ADC12CSTARTADD2_H      (0x0040)       /* ADC12 Conversion Start Address Bit: 2 */
334
#define ADC12CSTARTADD3_H      (0x0080)       /* ADC12 Conversion Start Address Bit: 3 */
335
 
336
#define ADC12CONSEQ_0          (0*2u)         /* ADC12 Conversion Sequence Select: 0 */
337
#define ADC12CONSEQ_1          (1*2u)         /* ADC12 Conversion Sequence Select: 1 */
338
#define ADC12CONSEQ_2          (2*2u)         /* ADC12 Conversion Sequence Select: 2 */
339
#define ADC12CONSEQ_3          (3*2u)         /* ADC12 Conversion Sequence Select: 3 */
340
 
341
#define ADC12SSEL_0            (0*8u)         /* ADC12 Clock Source Select: 0 */
342
#define ADC12SSEL_1            (1*8u)         /* ADC12 Clock Source Select: 1 */
343
#define ADC12SSEL_2            (2*8u)         /* ADC12 Clock Source Select: 2 */
344
#define ADC12SSEL_3            (3*8u)         /* ADC12 Clock Source Select: 3 */
345
 
346
#define ADC12DIV_0             (0*0x20u)      /* ADC12 Clock Divider Select: 0 */
347
#define ADC12DIV_1             (1*0x20u)      /* ADC12 Clock Divider Select: 1 */
348
#define ADC12DIV_2             (2*0x20u)      /* ADC12 Clock Divider Select: 2 */
349
#define ADC12DIV_3             (3*0x20u)      /* ADC12 Clock Divider Select: 3 */
350
#define ADC12DIV_4             (4*0x20u)      /* ADC12 Clock Divider Select: 4 */
351
#define ADC12DIV_5             (5*0x20u)      /* ADC12 Clock Divider Select: 5 */
352
#define ADC12DIV_6             (6*0x20u)      /* ADC12 Clock Divider Select: 6 */
353
#define ADC12DIV_7             (7*0x20u)      /* ADC12 Clock Divider Select: 7 */
354
 
355
#define ADC12SHS_0             (0*0x400u)     /* ADC12 Sample/Hold Source: 0 */
356
#define ADC12SHS_1             (1*0x400u)     /* ADC12 Sample/Hold Source: 1 */
357
#define ADC12SHS_2             (2*0x400u)     /* ADC12 Sample/Hold Source: 2 */
358
#define ADC12SHS_3             (3*0x400u)     /* ADC12 Sample/Hold Source: 3 */
359
 
360
#define ADC12CSTARTADD_0       (0*0x1000u)    /* ADC12 Conversion Start Address: 0 */
361
#define ADC12CSTARTADD_1       (1*0x1000u)    /* ADC12 Conversion Start Address: 1 */
362
#define ADC12CSTARTADD_2       (2*0x1000u)    /* ADC12 Conversion Start Address: 2 */
363
#define ADC12CSTARTADD_3       (3*0x1000u)    /* ADC12 Conversion Start Address: 3 */
364
#define ADC12CSTARTADD_4       (4*0x1000u)    /* ADC12 Conversion Start Address: 4 */
365
#define ADC12CSTARTADD_5       (5*0x1000u)    /* ADC12 Conversion Start Address: 5 */
366
#define ADC12CSTARTADD_6       (6*0x1000u)    /* ADC12 Conversion Start Address: 6 */
367
#define ADC12CSTARTADD_7       (7*0x1000u)    /* ADC12 Conversion Start Address: 7 */
368
#define ADC12CSTARTADD_8       (8*0x1000u)    /* ADC12 Conversion Start Address: 8 */
369
#define ADC12CSTARTADD_9       (9*0x1000u)    /* ADC12 Conversion Start Address: 9 */
370
#define ADC12CSTARTADD_10      (10*0x1000u)   /* ADC12 Conversion Start Address: 10 */
371
#define ADC12CSTARTADD_11      (11*0x1000u)   /* ADC12 Conversion Start Address: 11 */
372
#define ADC12CSTARTADD_12      (12*0x1000u)   /* ADC12 Conversion Start Address: 12 */
373
#define ADC12CSTARTADD_13      (13*0x1000u)   /* ADC12 Conversion Start Address: 13 */
374
#define ADC12CSTARTADD_14      (14*0x1000u)   /* ADC12 Conversion Start Address: 14 */
375
#define ADC12CSTARTADD_15      (15*0x1000u)   /* ADC12 Conversion Start Address: 15 */
376
 
377
/* ADC12CTL2 Control Bits */
378
#define ADC12REFBURST          (0x0001)       /* ADC12+ Reference Burst */
379
#define ADC12REFOUT            (0x0002)       /* ADC12+ Reference Out */
380
#define ADC12SR                (0x0004)       /* ADC12+ Sampling Rate */
381
#define ADC12DF                (0x0008)       /* ADC12+ Data Format */
382
#define ADC12RES0              (0x0010)       /* ADC12+ Resolution Bit: 0 */
383
#define ADC12RES1              (0x0020)       /* ADC12+ Resolution Bit: 1 */
384
#define ADC12TCOFF             (0x0080)       /* ADC12+ Temperature Sensor Off */
385
#define ADC12PDIV              (0x0100)       /* ADC12+ predivider 0:/1   1:/4 */
386
 
387
/* ADC12CTL2 Control Bits */
388
#define ADC12REFBURST_L        (0x0001)       /* ADC12+ Reference Burst */
389
#define ADC12REFOUT_L          (0x0002)       /* ADC12+ Reference Out */
390
#define ADC12SR_L              (0x0004)       /* ADC12+ Sampling Rate */
391
#define ADC12DF_L              (0x0008)       /* ADC12+ Data Format */
392
#define ADC12RES0_L            (0x0010)       /* ADC12+ Resolution Bit: 0 */
393
#define ADC12RES1_L            (0x0020)       /* ADC12+ Resolution Bit: 1 */
394
#define ADC12TCOFF_L           (0x0080)       /* ADC12+ Temperature Sensor Off */
395
 
396
/* ADC12CTL2 Control Bits */
397
#define ADC12PDIV_H            (0x0001)       /* ADC12+ predivider 0:/1   1:/4 */
398
 
399
#define ADC12RES_0             (0x0000)       /* ADC12+ Resolution : 8 Bit */
400
#define ADC12RES_1             (0x0010)       /* ADC12+ Resolution : 10 Bit */
401
#define ADC12RES_2             (0x0020)       /* ADC12+ Resolution : 12 Bit */
402
#define ADC12RES_3             (0x0030)       /* ADC12+ Resolution : reserved */
403
 
404
/* ADC12MCTLx Control Bits */
405
#define ADC12INCH0             (0x0001)       /* ADC12 Input Channel Select Bit 0 */
406
#define ADC12INCH1             (0x0002)       /* ADC12 Input Channel Select Bit 1 */
407
#define ADC12INCH2             (0x0004)       /* ADC12 Input Channel Select Bit 2 */
408
#define ADC12INCH3             (0x0008)       /* ADC12 Input Channel Select Bit 3 */
409
#define ADC12SREF0             (0x0010)       /* ADC12 Select Reference Bit 0 */
410
#define ADC12SREF1             (0x0020)       /* ADC12 Select Reference Bit 1 */
411
#define ADC12SREF2             (0x0040)       /* ADC12 Select Reference Bit 2 */
412
#define ADC12EOS               (0x0080)       /* ADC12 End of Sequence */
413
 
414
#define ADC12INCH_0            (0x0000)       /* ADC12 Input Channel 0 */
415
#define ADC12INCH_1            (0x0001)       /* ADC12 Input Channel 1 */
416
#define ADC12INCH_2            (0x0002)       /* ADC12 Input Channel 2 */
417
#define ADC12INCH_3            (0x0003)       /* ADC12 Input Channel 3 */
418
#define ADC12INCH_4            (0x0004)       /* ADC12 Input Channel 4 */
419
#define ADC12INCH_5            (0x0005)       /* ADC12 Input Channel 5 */
420
#define ADC12INCH_6            (0x0006)       /* ADC12 Input Channel 6 */
421
#define ADC12INCH_7            (0x0007)       /* ADC12 Input Channel 7 */
422
#define ADC12INCH_8            (0x0008)       /* ADC12 Input Channel 8 */
423
#define ADC12INCH_9            (0x0009)       /* ADC12 Input Channel 9 */
424
#define ADC12INCH_10           (0x000A)       /* ADC12 Input Channel 10 */
425
#define ADC12INCH_11           (0x000B)       /* ADC12 Input Channel 11 */
426
#define ADC12INCH_12           (0x000C)       /* ADC12 Input Channel 12 */
427
#define ADC12INCH_13           (0x000D)       /* ADC12 Input Channel 13 */
428
#define ADC12INCH_14           (0x000E)       /* ADC12 Input Channel 14 */
429
#define ADC12INCH_15           (0x000F)       /* ADC12 Input Channel 15 */
430
 
431
#define ADC12SREF_0            (0*0x10u)      /* ADC12 Select Reference 0 */
432
#define ADC12SREF_1            (1*0x10u)      /* ADC12 Select Reference 1 */
433
#define ADC12SREF_2            (2*0x10u)      /* ADC12 Select Reference 2 */
434
#define ADC12SREF_3            (3*0x10u)      /* ADC12 Select Reference 3 */
435
#define ADC12SREF_4            (4*0x10u)      /* ADC12 Select Reference 4 */
436
#define ADC12SREF_5            (5*0x10u)      /* ADC12 Select Reference 5 */
437
#define ADC12SREF_6            (6*0x10u)      /* ADC12 Select Reference 6 */
438
#define ADC12SREF_7            (7*0x10u)      /* ADC12 Select Reference 7 */
439
 
440
#define ADC12IE0               (0x0001)       /* ADC12 Memory 0      Interrupt Enable */
441
#define ADC12IE1               (0x0002)       /* ADC12 Memory 1      Interrupt Enable */
442
#define ADC12IE2               (0x0004)       /* ADC12 Memory 2      Interrupt Enable */
443
#define ADC12IE3               (0x0008)       /* ADC12 Memory 3      Interrupt Enable */
444
#define ADC12IE4               (0x0010)       /* ADC12 Memory 4      Interrupt Enable */
445
#define ADC12IE5               (0x0020)       /* ADC12 Memory 5      Interrupt Enable */
446
#define ADC12IE6               (0x0040)       /* ADC12 Memory 6      Interrupt Enable */
447
#define ADC12IE7               (0x0080)       /* ADC12 Memory 7      Interrupt Enable */
448
#define ADC12IE8               (0x0100)       /* ADC12 Memory 8      Interrupt Enable */
449
#define ADC12IE9               (0x0200)       /* ADC12 Memory 9      Interrupt Enable */
450
#define ADC12IE10              (0x0400)       /* ADC12 Memory 10      Interrupt Enable */
451
#define ADC12IE11              (0x0800)       /* ADC12 Memory 11      Interrupt Enable */
452
#define ADC12IE12              (0x1000)       /* ADC12 Memory 12      Interrupt Enable */
453
#define ADC12IE13              (0x2000)       /* ADC12 Memory 13      Interrupt Enable */
454
#define ADC12IE14              (0x4000)       /* ADC12 Memory 14      Interrupt Enable */
455
#define ADC12IE15              (0x8000)       /* ADC12 Memory 15      Interrupt Enable */
456
 
457
#define ADC12IE0_L             (0x0001)       /* ADC12 Memory 0      Interrupt Enable */
458
#define ADC12IE1_L             (0x0002)       /* ADC12 Memory 1      Interrupt Enable */
459
#define ADC12IE2_L             (0x0004)       /* ADC12 Memory 2      Interrupt Enable */
460
#define ADC12IE3_L             (0x0008)       /* ADC12 Memory 3      Interrupt Enable */
461
#define ADC12IE4_L             (0x0010)       /* ADC12 Memory 4      Interrupt Enable */
462
#define ADC12IE5_L             (0x0020)       /* ADC12 Memory 5      Interrupt Enable */
463
#define ADC12IE6_L             (0x0040)       /* ADC12 Memory 6      Interrupt Enable */
464
#define ADC12IE7_L             (0x0080)       /* ADC12 Memory 7      Interrupt Enable */
465
 
466
#define ADC12IE8_H             (0x0001)       /* ADC12 Memory 8      Interrupt Enable */
467
#define ADC12IE9_H             (0x0002)       /* ADC12 Memory 9      Interrupt Enable */
468
#define ADC12IE10_H            (0x0004)       /* ADC12 Memory 10      Interrupt Enable */
469
#define ADC12IE11_H            (0x0008)       /* ADC12 Memory 11      Interrupt Enable */
470
#define ADC12IE12_H            (0x0010)       /* ADC12 Memory 12      Interrupt Enable */
471
#define ADC12IE13_H            (0x0020)       /* ADC12 Memory 13      Interrupt Enable */
472
#define ADC12IE14_H            (0x0040)       /* ADC12 Memory 14      Interrupt Enable */
473
#define ADC12IE15_H            (0x0080)       /* ADC12 Memory 15      Interrupt Enable */
474
 
475
#define ADC12IFG0              (0x0001)       /* ADC12 Memory 0      Interrupt Flag */
476
#define ADC12IFG1              (0x0002)       /* ADC12 Memory 1      Interrupt Flag */
477
#define ADC12IFG2              (0x0004)       /* ADC12 Memory 2      Interrupt Flag */
478
#define ADC12IFG3              (0x0008)       /* ADC12 Memory 3      Interrupt Flag */
479
#define ADC12IFG4              (0x0010)       /* ADC12 Memory 4      Interrupt Flag */
480
#define ADC12IFG5              (0x0020)       /* ADC12 Memory 5      Interrupt Flag */
481
#define ADC12IFG6              (0x0040)       /* ADC12 Memory 6      Interrupt Flag */
482
#define ADC12IFG7              (0x0080)       /* ADC12 Memory 7      Interrupt Flag */
483
#define ADC12IFG8              (0x0100)       /* ADC12 Memory 8      Interrupt Flag */
484
#define ADC12IFG9              (0x0200)       /* ADC12 Memory 9      Interrupt Flag */
485
#define ADC12IFG10             (0x0400)       /* ADC12 Memory 10      Interrupt Flag */
486
#define ADC12IFG11             (0x0800)       /* ADC12 Memory 11      Interrupt Flag */
487
#define ADC12IFG12             (0x1000)       /* ADC12 Memory 12      Interrupt Flag */
488
#define ADC12IFG13             (0x2000)       /* ADC12 Memory 13      Interrupt Flag */
489
#define ADC12IFG14             (0x4000)       /* ADC12 Memory 14      Interrupt Flag */
490
#define ADC12IFG15             (0x8000)       /* ADC12 Memory 15      Interrupt Flag */
491
 
492
#define ADC12IFG0_L            (0x0001)       /* ADC12 Memory 0      Interrupt Flag */
493
#define ADC12IFG1_L            (0x0002)       /* ADC12 Memory 1      Interrupt Flag */
494
#define ADC12IFG2_L            (0x0004)       /* ADC12 Memory 2      Interrupt Flag */
495
#define ADC12IFG3_L            (0x0008)       /* ADC12 Memory 3      Interrupt Flag */
496
#define ADC12IFG4_L            (0x0010)       /* ADC12 Memory 4      Interrupt Flag */
497
#define ADC12IFG5_L            (0x0020)       /* ADC12 Memory 5      Interrupt Flag */
498
#define ADC12IFG6_L            (0x0040)       /* ADC12 Memory 6      Interrupt Flag */
499
#define ADC12IFG7_L            (0x0080)       /* ADC12 Memory 7      Interrupt Flag */
500
 
501
#define ADC12IFG8_H            (0x0001)       /* ADC12 Memory 8      Interrupt Flag */
502
#define ADC12IFG9_H            (0x0002)       /* ADC12 Memory 9      Interrupt Flag */
503
#define ADC12IFG10_H           (0x0004)       /* ADC12 Memory 10      Interrupt Flag */
504
#define ADC12IFG11_H           (0x0008)       /* ADC12 Memory 11      Interrupt Flag */
505
#define ADC12IFG12_H           (0x0010)       /* ADC12 Memory 12      Interrupt Flag */
506
#define ADC12IFG13_H           (0x0020)       /* ADC12 Memory 13      Interrupt Flag */
507
#define ADC12IFG14_H           (0x0040)       /* ADC12 Memory 14      Interrupt Flag */
508
#define ADC12IFG15_H           (0x0080)       /* ADC12 Memory 15      Interrupt Flag */
509
 
510
/* ADC12IV Definitions */
511
#define ADC12IV_NONE           (0x0000)       /* No Interrupt pending */
512
#define ADC12IV_ADC12OVIFG     (0x0002)       /* ADC12OVIFG */
513
#define ADC12IV_ADC12TOVIFG    (0x0004)       /* ADC12TOVIFG */
514
#define ADC12IV_ADC12IFG0      (0x0006)       /* ADC12IFG0 */
515
#define ADC12IV_ADC12IFG1      (0x0008)       /* ADC12IFG1 */
516
#define ADC12IV_ADC12IFG2      (0x000A)       /* ADC12IFG2 */
517
#define ADC12IV_ADC12IFG3      (0x000C)       /* ADC12IFG3 */
518
#define ADC12IV_ADC12IFG4      (0x000E)       /* ADC12IFG4 */
519
#define ADC12IV_ADC12IFG5      (0x0010)       /* ADC12IFG5 */
520
#define ADC12IV_ADC12IFG6      (0x0012)       /* ADC12IFG6 */
521
#define ADC12IV_ADC12IFG7      (0x0014)       /* ADC12IFG7 */
522
#define ADC12IV_ADC12IFG8      (0x0016)       /* ADC12IFG8 */
523
#define ADC12IV_ADC12IFG9      (0x0018)       /* ADC12IFG9 */
524
#define ADC12IV_ADC12IFG10     (0x001A)       /* ADC12IFG10 */
525
#define ADC12IV_ADC12IFG11     (0x001C)       /* ADC12IFG11 */
526
#define ADC12IV_ADC12IFG12     (0x001E)       /* ADC12IFG12 */
527
#define ADC12IV_ADC12IFG13     (0x0020)       /* ADC12IFG13 */
528
#define ADC12IV_ADC12IFG14     (0x0022)       /* ADC12IFG14 */
529
#define ADC12IV_ADC12IFG15     (0x0024)       /* ADC12IFG15 */
530
 
531
/************************************************************
532
* Comparator B
533
************************************************************/
534
#define __MSP430_HAS_COMPB__                  /* Definition to show that Module is available */
535
#define __MSP430_BASEADDRESS_COMPB__ 0x08C0
536
 
537
SFR_16BIT(CBCTL0);                            /* Comparator B Control Register 0 */
538
SFR_8BIT(CBCTL0_L);                           /* Comparator B Control Register 0 */
539
SFR_8BIT(CBCTL0_H);                           /* Comparator B Control Register 0 */
540
SFR_16BIT(CBCTL1);                            /* Comparator B Control Register 1 */
541
SFR_8BIT(CBCTL1_L);                           /* Comparator B Control Register 1 */
542
SFR_8BIT(CBCTL1_H);                           /* Comparator B Control Register 1 */
543
SFR_16BIT(CBCTL2);                            /* Comparator B Control Register 2 */
544
SFR_8BIT(CBCTL2_L);                           /* Comparator B Control Register 2 */
545
SFR_8BIT(CBCTL2_H);                           /* Comparator B Control Register 2 */
546
SFR_16BIT(CBCTL3);                            /* Comparator B Control Register 3 */
547
SFR_8BIT(CBCTL3_L);                           /* Comparator B Control Register 3 */
548
SFR_8BIT(CBCTL3_H);                           /* Comparator B Control Register 3 */
549
SFR_16BIT(CBINT);                             /* Comparator B Interrupt Register */
550
SFR_8BIT(CBINT_L);                            /* Comparator B Interrupt Register */
551
SFR_8BIT(CBINT_H);                            /* Comparator B Interrupt Register */
552
SFR_16BIT(CBIV);                              /* Comparator B Interrupt Vector Word */
553
 
554
/* CBCTL0 Control Bits */
555
#define CBIPSEL0               (0x0001)       /* Comp. B Pos. Channel Input Select 0 */
556
#define CBIPSEL1               (0x0002)       /* Comp. B Pos. Channel Input Select 1 */
557
#define CBIPSEL2               (0x0004)       /* Comp. B Pos. Channel Input Select 2 */
558
#define CBIPSEL3               (0x0008)       /* Comp. B Pos. Channel Input Select 3 */
559
//#define RESERVED            (0x0010)  /* Comp. B */
560
//#define RESERVED            (0x0020)  /* Comp. B */
561
//#define RESERVED            (0x0040)  /* Comp. B */
562
#define CBIPEN                 (0x0080)       /* Comp. B Pos. Channel Input Enable */
563
#define CBIMSEL0               (0x0100)       /* Comp. B Neg. Channel Input Select 0 */
564
#define CBIMSEL1               (0x0200)       /* Comp. B Neg. Channel Input Select 1 */
565
#define CBIMSEL2               (0x0400)       /* Comp. B Neg. Channel Input Select 2 */
566
#define CBIMSEL3               (0x0800)       /* Comp. B Neg. Channel Input Select 3 */
567
//#define RESERVED            (0x1000)  /* Comp. B */
568
//#define RESERVED            (0x2000)  /* Comp. B */
569
//#define RESERVED            (0x4000)  /* Comp. B */
570
#define CBIMEN                 (0x8000)       /* Comp. B Neg. Channel Input Enable */
571
 
572
/* CBCTL0 Control Bits */
573
#define CBIPSEL0_L             (0x0001)       /* Comp. B Pos. Channel Input Select 0 */
574
#define CBIPSEL1_L             (0x0002)       /* Comp. B Pos. Channel Input Select 1 */
575
#define CBIPSEL2_L             (0x0004)       /* Comp. B Pos. Channel Input Select 2 */
576
#define CBIPSEL3_L             (0x0008)       /* Comp. B Pos. Channel Input Select 3 */
577
//#define RESERVED            (0x0010)  /* Comp. B */
578
//#define RESERVED            (0x0020)  /* Comp. B */
579
//#define RESERVED            (0x0040)  /* Comp. B */
580
#define CBIPEN_L               (0x0080)       /* Comp. B Pos. Channel Input Enable */
581
//#define RESERVED            (0x1000)  /* Comp. B */
582
//#define RESERVED            (0x2000)  /* Comp. B */
583
//#define RESERVED            (0x4000)  /* Comp. B */
584
 
585
/* CBCTL0 Control Bits */
586
//#define RESERVED            (0x0010)  /* Comp. B */
587
//#define RESERVED            (0x0020)  /* Comp. B */
588
//#define RESERVED            (0x0040)  /* Comp. B */
589
#define CBIMSEL0_H             (0x0001)       /* Comp. B Neg. Channel Input Select 0 */
590
#define CBIMSEL1_H             (0x0002)       /* Comp. B Neg. Channel Input Select 1 */
591
#define CBIMSEL2_H             (0x0004)       /* Comp. B Neg. Channel Input Select 2 */
592
#define CBIMSEL3_H             (0x0008)       /* Comp. B Neg. Channel Input Select 3 */
593
//#define RESERVED            (0x1000)  /* Comp. B */
594
//#define RESERVED            (0x2000)  /* Comp. B */
595
//#define RESERVED            (0x4000)  /* Comp. B */
596
#define CBIMEN_H               (0x0080)       /* Comp. B Neg. Channel Input Enable */
597
 
598
#define CBIPSEL_0              (0x0000)       /* Comp. B V+ terminal Input Select: Channel 0 */
599
#define CBIPSEL_1              (0x0001)       /* Comp. B V+ terminal Input Select: Channel 1 */
600
#define CBIPSEL_2              (0x0002)       /* Comp. B V+ terminal Input Select: Channel 2 */
601
#define CBIPSEL_3              (0x0003)       /* Comp. B V+ terminal Input Select: Channel 3 */
602
#define CBIPSEL_4              (0x0004)       /* Comp. B V+ terminal Input Select: Channel 4 */
603
#define CBIPSEL_5              (0x0005)       /* Comp. B V+ terminal Input Select: Channel 5 */
604
#define CBIPSEL_6              (0x0006)       /* Comp. B V+ terminal Input Select: Channel 6 */
605
#define CBIPSEL_7              (0x0007)       /* Comp. B V+ terminal Input Select: Channel 7 */
606
#define CBIPSEL_8              (0x0008)       /* Comp. B V+ terminal Input Select: Channel 8 */
607
#define CBIPSEL_9              (0x0009)       /* Comp. B V+ terminal Input Select: Channel 9 */
608
#define CBIPSEL_10             (0x000A)       /* Comp. B V+ terminal Input Select: Channel 10 */
609
#define CBIPSEL_11             (0x000B)       /* Comp. B V+ terminal Input Select: Channel 11 */
610
#define CBIPSEL_12             (0x000C)       /* Comp. B V+ terminal Input Select: Channel 12 */
611
#define CBIPSEL_13             (0x000D)       /* Comp. B V+ terminal Input Select: Channel 13 */
612
#define CBIPSEL_14             (0x000E)       /* Comp. B V+ terminal Input Select: Channel 14 */
613
#define CBIPSEL_15             (0x000F)       /* Comp. B V+ terminal Input Select: Channel 15 */
614
 
615
#define CBIMSEL_0              (0x0000)       /* Comp. B V- Terminal Input Select: Channel 0 */
616
#define CBIMSEL_1              (0x0100)       /* Comp. B V- Terminal Input Select: Channel 1 */
617
#define CBIMSEL_2              (0x0200)       /* Comp. B V- Terminal Input Select: Channel 2 */
618
#define CBIMSEL_3              (0x0300)       /* Comp. B V- Terminal Input Select: Channel 3 */
619
#define CBIMSEL_4              (0x0400)       /* Comp. B V- Terminal Input Select: Channel 4 */
620
#define CBIMSEL_5              (0x0500)       /* Comp. B V- Terminal Input Select: Channel 5 */
621
#define CBIMSEL_6              (0x0600)       /* Comp. B V- Terminal Input Select: Channel 6 */
622
#define CBIMSEL_7              (0x0700)       /* Comp. B V- Terminal Input Select: Channel 7 */
623
#define CBIMSEL_8              (0x0800)       /* Comp. B V- terminal Input Select: Channel 8 */
624
#define CBIMSEL_9              (0x0900)       /* Comp. B V- terminal Input Select: Channel 9 */
625
#define CBIMSEL_10             (0x0A00)       /* Comp. B V- terminal Input Select: Channel 10 */
626
#define CBIMSEL_11             (0x0B00)       /* Comp. B V- terminal Input Select: Channel 11 */
627
#define CBIMSEL_12             (0x0C00)       /* Comp. B V- terminal Input Select: Channel 12 */
628
#define CBIMSEL_13             (0x0D00)       /* Comp. B V- terminal Input Select: Channel 13 */
629
#define CBIMSEL_14             (0x0E00)       /* Comp. B V- terminal Input Select: Channel 14 */
630
#define CBIMSEL_15             (0x0F00)       /* Comp. B V- terminal Input Select: Channel 15 */
631
 
632
/* CBCTL1 Control Bits */
633
#define CBOUT                  (0x0001)       /* Comp. B Output */
634
#define CBOUTPOL               (0x0002)       /* Comp. B Output Polarity */
635
#define CBF                    (0x0004)       /* Comp. B Enable Output Filter */
636
#define CBIES                  (0x0008)       /* Comp. B Interrupt Edge Select */
637
#define CBSHORT                (0x0010)       /* Comp. B Input Short */
638
#define CBEX                   (0x0020)       /* Comp. B Exchange Inputs */
639
#define CBFDLY0                (0x0040)       /* Comp. B Filter delay Bit 0 */
640
#define CBFDLY1                (0x0080)       /* Comp. B Filter delay Bit 1 */
641
#define CBPWRMD0               (0x0100)       /* Comp. B Power Mode Bit 0 */
642
#define CBPWRMD1               (0x0200)       /* Comp. B Power Mode Bit 1 */
643
#define CBON                   (0x0400)       /* Comp. B enable */
644
#define CBMRVL                 (0x0800)       /* Comp. B CBMRV Level */
645
#define CBMRVS                 (0x1000)       /* Comp. B Output selects between VREF0 or VREF1*/
646
//#define RESERVED            (0x2000)  /* Comp. B */
647
//#define RESERVED            (0x4000)  /* Comp. B */
648
//#define RESERVED            (0x8000)  /* Comp. B */
649
 
650
/* CBCTL1 Control Bits */
651
#define CBOUT_L                (0x0001)       /* Comp. B Output */
652
#define CBOUTPOL_L             (0x0002)       /* Comp. B Output Polarity */
653
#define CBF_L                  (0x0004)       /* Comp. B Enable Output Filter */
654
#define CBIES_L                (0x0008)       /* Comp. B Interrupt Edge Select */
655
#define CBSHORT_L              (0x0010)       /* Comp. B Input Short */
656
#define CBEX_L                 (0x0020)       /* Comp. B Exchange Inputs */
657
#define CBFDLY0_L              (0x0040)       /* Comp. B Filter delay Bit 0 */
658
#define CBFDLY1_L              (0x0080)       /* Comp. B Filter delay Bit 1 */
659
//#define RESERVED            (0x2000)  /* Comp. B */
660
//#define RESERVED            (0x4000)  /* Comp. B */
661
//#define RESERVED            (0x8000)  /* Comp. B */
662
 
663
/* CBCTL1 Control Bits */
664
#define CBPWRMD0_H             (0x0001)       /* Comp. B Power Mode Bit 0 */
665
#define CBPWRMD1_H             (0x0002)       /* Comp. B Power Mode Bit 1 */
666
#define CBON_H                 (0x0004)       /* Comp. B enable */
667
#define CBMRVL_H               (0x0008)       /* Comp. B CBMRV Level */
668
#define CBMRVS_H               (0x0010)       /* Comp. B Output selects between VREF0 or VREF1*/
669
//#define RESERVED            (0x2000)  /* Comp. B */
670
//#define RESERVED            (0x4000)  /* Comp. B */
671
//#define RESERVED            (0x8000)  /* Comp. B */
672
 
673
#define CBFDLY_0               (0x0000)       /* Comp. B Filter delay 0 : 450ns */
674
#define CBFDLY_1               (0x0040)       /* Comp. B Filter delay 1 : 900ns */
675
#define CBFDLY_2               (0x0080)       /* Comp. B Filter delay 2 : 1800ns */
676
#define CBFDLY_3               (0x00C0)       /* Comp. B Filter delay 3 : 3600ns */
677
 
678
#define CBPWRMD_0              (0x0000)       /* Comp. B Power Mode 0 : High speed */
679
#define CBPWRMD_1              (0x0100)       /* Comp. B Power Mode 1 : Normal */
680
#define CBPWRMD_2              (0x0200)       /* Comp. B Power Mode 2 : Ultra-Low*/
681
#define CBPWRMD_3              (0x0300)       /* Comp. B Power Mode 3 : Reserved */
682
 
683
/* CBCTL2 Control Bits */
684
#define CBREF00                (0x0001)       /* Comp. B Reference 0 Resistor Select Bit : 0 */
685
#define CBREF01                (0x0002)       /* Comp. B Reference 0 Resistor Select Bit : 1 */
686
#define CBREF02                (0x0004)       /* Comp. B Reference 0 Resistor Select Bit : 2 */
687
#define CBREF03                (0x0008)       /* Comp. B Reference 0 Resistor Select Bit : 3 */
688
#define CBREF04                (0x0010)       /* Comp. B Reference 0 Resistor Select Bit : 4 */
689
#define CBRSEL                 (0x0020)       /* Comp. B Reference select */
690
#define CBRS0                  (0x0040)       /* Comp. B Reference Source Bit : 0 */
691
#define CBRS1                  (0x0080)       /* Comp. B Reference Source Bit : 1 */
692
#define CBREF10                (0x0100)       /* Comp. B Reference 1 Resistor Select Bit : 0 */
693
#define CBREF11                (0x0200)       /* Comp. B Reference 1 Resistor Select Bit : 1 */
694
#define CBREF12                (0x0400)       /* Comp. B Reference 1 Resistor Select Bit : 2 */
695
#define CBREF13                (0x0800)       /* Comp. B Reference 1 Resistor Select Bit : 3 */
696
#define CBREF14                (0x1000)       /* Comp. B Reference 1 Resistor Select Bit : 4 */
697
#define CBREFL0                (0x2000)       /* Comp. B Reference voltage level Bit : 0 */
698
#define CBREFL1                (0x4000)       /* Comp. B Reference voltage level Bit : 1 */
699
#define CBREFACC               (0x8000)       /* Comp. B Reference Accuracy */
700
 
701
/* CBCTL2 Control Bits */
702
#define CBREF00_L              (0x0001)       /* Comp. B Reference 0 Resistor Select Bit : 0 */
703
#define CBREF01_L              (0x0002)       /* Comp. B Reference 0 Resistor Select Bit : 1 */
704
#define CBREF02_L              (0x0004)       /* Comp. B Reference 0 Resistor Select Bit : 2 */
705
#define CBREF03_L              (0x0008)       /* Comp. B Reference 0 Resistor Select Bit : 3 */
706
#define CBREF04_L              (0x0010)       /* Comp. B Reference 0 Resistor Select Bit : 4 */
707
#define CBRSEL_L               (0x0020)       /* Comp. B Reference select */
708
#define CBRS0_L                (0x0040)       /* Comp. B Reference Source Bit : 0 */
709
#define CBRS1_L                (0x0080)       /* Comp. B Reference Source Bit : 1 */
710
 
711
/* CBCTL2 Control Bits */
712
#define CBREF10_H              (0x0001)       /* Comp. B Reference 1 Resistor Select Bit : 0 */
713
#define CBREF11_H              (0x0002)       /* Comp. B Reference 1 Resistor Select Bit : 1 */
714
#define CBREF12_H              (0x0004)       /* Comp. B Reference 1 Resistor Select Bit : 2 */
715
#define CBREF13_H              (0x0008)       /* Comp. B Reference 1 Resistor Select Bit : 3 */
716
#define CBREF14_H              (0x0010)       /* Comp. B Reference 1 Resistor Select Bit : 4 */
717
#define CBREFL0_H              (0x0020)       /* Comp. B Reference voltage level Bit : 0 */
718
#define CBREFL1_H              (0x0040)       /* Comp. B Reference voltage level Bit : 1 */
719
#define CBREFACC_H             (0x0080)       /* Comp. B Reference Accuracy */
720
 
721
#define CBREF0_0               (0x0000)       /* Comp. B Int. Ref.0 Select 0 : 1/32 */
722
#define CBREF0_1               (0x0001)       /* Comp. B Int. Ref.0 Select 1 : 2/32 */
723
#define CBREF0_2               (0x0002)       /* Comp. B Int. Ref.0 Select 2 : 3/32 */
724
#define CBREF0_3               (0x0003)       /* Comp. B Int. Ref.0 Select 3 : 4/32 */
725
#define CBREF0_4               (0x0004)       /* Comp. B Int. Ref.0 Select 4 : 5/32 */
726
#define CBREF0_5               (0x0005)       /* Comp. B Int. Ref.0 Select 5 : 6/32 */
727
#define CBREF0_6               (0x0006)       /* Comp. B Int. Ref.0 Select 6 : 7/32 */
728
#define CBREF0_7               (0x0007)       /* Comp. B Int. Ref.0 Select 7 : 8/32 */
729
#define CBREF0_8               (0x0008)       /* Comp. B Int. Ref.0 Select 0 : 9/32 */
730
#define CBREF0_9               (0x0009)       /* Comp. B Int. Ref.0 Select 1 : 10/32 */
731
#define CBREF0_10              (0x000A)       /* Comp. B Int. Ref.0 Select 2 : 11/32 */
732
#define CBREF0_11              (0x000B)       /* Comp. B Int. Ref.0 Select 3 : 12/32 */
733
#define CBREF0_12              (0x000C)       /* Comp. B Int. Ref.0 Select 4 : 13/32 */
734
#define CBREF0_13              (0x000D)       /* Comp. B Int. Ref.0 Select 5 : 14/32 */
735
#define CBREF0_14              (0x000E)       /* Comp. B Int. Ref.0 Select 6 : 15/32 */
736
#define CBREF0_15              (0x000F)       /* Comp. B Int. Ref.0 Select 7 : 16/32 */
737
#define CBREF0_16              (0x0010)       /* Comp. B Int. Ref.0 Select 0 : 17/32 */
738
#define CBREF0_17              (0x0011)       /* Comp. B Int. Ref.0 Select 1 : 18/32 */
739
#define CBREF0_18              (0x0012)       /* Comp. B Int. Ref.0 Select 2 : 19/32 */
740
#define CBREF0_19              (0x0013)       /* Comp. B Int. Ref.0 Select 3 : 20/32 */
741
#define CBREF0_20              (0x0014)       /* Comp. B Int. Ref.0 Select 4 : 21/32 */
742
#define CBREF0_21              (0x0015)       /* Comp. B Int. Ref.0 Select 5 : 22/32 */
743
#define CBREF0_22              (0x0016)       /* Comp. B Int. Ref.0 Select 6 : 23/32 */
744
#define CBREF0_23              (0x0017)       /* Comp. B Int. Ref.0 Select 7 : 24/32 */
745
#define CBREF0_24              (0x0018)       /* Comp. B Int. Ref.0 Select 0 : 25/32 */
746
#define CBREF0_25              (0x0019)       /* Comp. B Int. Ref.0 Select 1 : 26/32 */
747
#define CBREF0_26              (0x001A)       /* Comp. B Int. Ref.0 Select 2 : 27/32 */
748
#define CBREF0_27              (0x001B)       /* Comp. B Int. Ref.0 Select 3 : 28/32 */
749
#define CBREF0_28              (0x001C)       /* Comp. B Int. Ref.0 Select 4 : 29/32 */
750
#define CBREF0_29              (0x001D)       /* Comp. B Int. Ref.0 Select 5 : 30/32 */
751
#define CBREF0_30              (0x001E)       /* Comp. B Int. Ref.0 Select 6 : 31/32 */
752
#define CBREF0_31              (0x001F)       /* Comp. B Int. Ref.0 Select 7 : 32/32 */
753
 
754
#define CBRS_0                 (0x0000)       /* Comp. B Reference Source 0 : Off */
755
#define CBRS_1                 (0x0040)       /* Comp. B Reference Source 1 : Vcc */
756
#define CBRS_2                 (0x0080)       /* Comp. B Reference Source 2 : Shared Ref. */
757
#define CBRS_3                 (0x00C0)       /* Comp. B Reference Source 3 : Shared Ref. / Off */
758
 
759
#define CBREF1_0               (0x0000)       /* Comp. B Int. Ref.1 Select 0 : 1/32 */
760
#define CBREF1_1               (0x0100)       /* Comp. B Int. Ref.1 Select 1 : 2/32 */
761
#define CBREF1_2               (0x0200)       /* Comp. B Int. Ref.1 Select 2 : 3/32 */
762
#define CBREF1_3               (0x0300)       /* Comp. B Int. Ref.1 Select 3 : 4/32 */
763
#define CBREF1_4               (0x0400)       /* Comp. B Int. Ref.1 Select 4 : 5/32 */
764
#define CBREF1_5               (0x0500)       /* Comp. B Int. Ref.1 Select 5 : 6/32 */
765
#define CBREF1_6               (0x0600)       /* Comp. B Int. Ref.1 Select 6 : 7/32 */
766
#define CBREF1_7               (0x0700)       /* Comp. B Int. Ref.1 Select 7 : 8/32 */
767
#define CBREF1_8               (0x0800)       /* Comp. B Int. Ref.1 Select 0 : 9/32 */
768
#define CBREF1_9               (0x0900)       /* Comp. B Int. Ref.1 Select 1 : 10/32 */
769
#define CBREF1_10              (0x0A00)       /* Comp. B Int. Ref.1 Select 2 : 11/32 */
770
#define CBREF1_11              (0x0B00)       /* Comp. B Int. Ref.1 Select 3 : 12/32 */
771
#define CBREF1_12              (0x0C00)       /* Comp. B Int. Ref.1 Select 4 : 13/32 */
772
#define CBREF1_13              (0x0D00)       /* Comp. B Int. Ref.1 Select 5 : 14/32 */
773
#define CBREF1_14              (0x0E00)       /* Comp. B Int. Ref.1 Select 6 : 15/32 */
774
#define CBREF1_15              (0x0F00)       /* Comp. B Int. Ref.1 Select 7 : 16/32 */
775
#define CBREF1_16              (0x1000)       /* Comp. B Int. Ref.1 Select 0 : 17/32 */
776
#define CBREF1_17              (0x1100)       /* Comp. B Int. Ref.1 Select 1 : 18/32 */
777
#define CBREF1_18              (0x1200)       /* Comp. B Int. Ref.1 Select 2 : 19/32 */
778
#define CBREF1_19              (0x1300)       /* Comp. B Int. Ref.1 Select 3 : 20/32 */
779
#define CBREF1_20              (0x1400)       /* Comp. B Int. Ref.1 Select 4 : 21/32 */
780
#define CBREF1_21              (0x1500)       /* Comp. B Int. Ref.1 Select 5 : 22/32 */
781
#define CBREF1_22              (0x1600)       /* Comp. B Int. Ref.1 Select 6 : 23/32 */
782
#define CBREF1_23              (0x1700)       /* Comp. B Int. Ref.1 Select 7 : 24/32 */
783
#define CBREF1_24              (0x1800)       /* Comp. B Int. Ref.1 Select 0 : 25/32 */
784
#define CBREF1_25              (0x1900)       /* Comp. B Int. Ref.1 Select 1 : 26/32 */
785
#define CBREF1_26              (0x1A00)       /* Comp. B Int. Ref.1 Select 2 : 27/32 */
786
#define CBREF1_27              (0x1B00)       /* Comp. B Int. Ref.1 Select 3 : 28/32 */
787
#define CBREF1_28              (0x1C00)       /* Comp. B Int. Ref.1 Select 4 : 29/32 */
788
#define CBREF1_29              (0x1D00)       /* Comp. B Int. Ref.1 Select 5 : 30/32 */
789
#define CBREF1_30              (0x1E00)       /* Comp. B Int. Ref.1 Select 6 : 31/32 */
790
#define CBREF1_31              (0x1F00)       /* Comp. B Int. Ref.1 Select 7 : 32/32 */
791
 
792
#define CBREFL_0               (0x0000)       /* Comp. B Reference voltage level 0 : None */
793
#define CBREFL_1               (0x2000)       /* Comp. B Reference voltage level 1 : 1.5V */
794
#define CBREFL_2               (0x4000)       /* Comp. B Reference voltage level 2 : 2.0V  */
795
#define CBREFL_3               (0x6000)       /* Comp. B Reference voltage level 3 : 2.5V  */
796
 
797
#define CBPD0                  (0x0001)       /* Comp. B Disable Input Buffer of Port Register .0 */
798
#define CBPD1                  (0x0002)       /* Comp. B Disable Input Buffer of Port Register .1 */
799
#define CBPD2                  (0x0004)       /* Comp. B Disable Input Buffer of Port Register .2 */
800
#define CBPD3                  (0x0008)       /* Comp. B Disable Input Buffer of Port Register .3 */
801
#define CBPD4                  (0x0010)       /* Comp. B Disable Input Buffer of Port Register .4 */
802
#define CBPD5                  (0x0020)       /* Comp. B Disable Input Buffer of Port Register .5 */
803
#define CBPD6                  (0x0040)       /* Comp. B Disable Input Buffer of Port Register .6 */
804
#define CBPD7                  (0x0080)       /* Comp. B Disable Input Buffer of Port Register .7 */
805
#define CBPD8                  (0x0100)       /* Comp. B Disable Input Buffer of Port Register .8 */
806
#define CBPD9                  (0x0200)       /* Comp. B Disable Input Buffer of Port Register .9 */
807
#define CBPD10                 (0x0400)       /* Comp. B Disable Input Buffer of Port Register .10 */
808
#define CBPD11                 (0x0800)       /* Comp. B Disable Input Buffer of Port Register .11 */
809
#define CBPD12                 (0x1000)       /* Comp. B Disable Input Buffer of Port Register .12 */
810
#define CBPD13                 (0x2000)       /* Comp. B Disable Input Buffer of Port Register .13 */
811
#define CBPD14                 (0x4000)       /* Comp. B Disable Input Buffer of Port Register .14 */
812
#define CBPD15                 (0x8000)       /* Comp. B Disable Input Buffer of Port Register .15 */
813
 
814
#define CBPD0_L                (0x0001)       /* Comp. B Disable Input Buffer of Port Register .0 */
815
#define CBPD1_L                (0x0002)       /* Comp. B Disable Input Buffer of Port Register .1 */
816
#define CBPD2_L                (0x0004)       /* Comp. B Disable Input Buffer of Port Register .2 */
817
#define CBPD3_L                (0x0008)       /* Comp. B Disable Input Buffer of Port Register .3 */
818
#define CBPD4_L                (0x0010)       /* Comp. B Disable Input Buffer of Port Register .4 */
819
#define CBPD5_L                (0x0020)       /* Comp. B Disable Input Buffer of Port Register .5 */
820
#define CBPD6_L                (0x0040)       /* Comp. B Disable Input Buffer of Port Register .6 */
821
#define CBPD7_L                (0x0080)       /* Comp. B Disable Input Buffer of Port Register .7 */
822
 
823
#define CBPD8_H                (0x0001)       /* Comp. B Disable Input Buffer of Port Register .8 */
824
#define CBPD9_H                (0x0002)       /* Comp. B Disable Input Buffer of Port Register .9 */
825
#define CBPD10_H               (0x0004)       /* Comp. B Disable Input Buffer of Port Register .10 */
826
#define CBPD11_H               (0x0008)       /* Comp. B Disable Input Buffer of Port Register .11 */
827
#define CBPD12_H               (0x0010)       /* Comp. B Disable Input Buffer of Port Register .12 */
828
#define CBPD13_H               (0x0020)       /* Comp. B Disable Input Buffer of Port Register .13 */
829
#define CBPD14_H               (0x0040)       /* Comp. B Disable Input Buffer of Port Register .14 */
830
#define CBPD15_H               (0x0080)       /* Comp. B Disable Input Buffer of Port Register .15 */
831
 
832
/* CBINT Control Bits */
833
#define CBIFG                  (0x0001)       /* Comp. B Interrupt Flag */
834
#define CBIIFG                 (0x0002)       /* Comp. B Interrupt Flag Inverted Polarity */
835
//#define RESERVED             (0x0004)  /* Comp. B */
836
//#define RESERVED             (0x0008)  /* Comp. B */
837
//#define RESERVED             (0x0010)  /* Comp. B */
838
//#define RESERVED             (0x0020)  /* Comp. B */
839
//#define RESERVED             (0x0040)  /* Comp. B */
840
//#define RESERVED             (0x0080)  /* Comp. B */
841
#define CBIE                   (0x0100)       /* Comp. B Interrupt Enable */
842
#define CBIIE                  (0x0200)       /* Comp. B Interrupt Enable Inverted Polarity */
843
//#define RESERVED             (0x0400)  /* Comp. B */
844
//#define RESERVED             (0x0800)  /* Comp. B */
845
//#define RESERVED             (0x1000)  /* Comp. B */
846
//#define RESERVED             (0x2000)  /* Comp. B */
847
//#define RESERVED             (0x4000)  /* Comp. B */
848
//#define RESERVED             (0x8000)  /* Comp. B */
849
 
850
/* CBINT Control Bits */
851
#define CBIFG_L                (0x0001)       /* Comp. B Interrupt Flag */
852
#define CBIIFG_L               (0x0002)       /* Comp. B Interrupt Flag Inverted Polarity */
853
//#define RESERVED             (0x0004)  /* Comp. B */
854
//#define RESERVED             (0x0008)  /* Comp. B */
855
//#define RESERVED             (0x0010)  /* Comp. B */
856
//#define RESERVED             (0x0020)  /* Comp. B */
857
//#define RESERVED             (0x0040)  /* Comp. B */
858
//#define RESERVED             (0x0080)  /* Comp. B */
859
//#define RESERVED             (0x0400)  /* Comp. B */
860
//#define RESERVED             (0x0800)  /* Comp. B */
861
//#define RESERVED             (0x1000)  /* Comp. B */
862
//#define RESERVED             (0x2000)  /* Comp. B */
863
//#define RESERVED             (0x4000)  /* Comp. B */
864
//#define RESERVED             (0x8000)  /* Comp. B */
865
 
866
/* CBINT Control Bits */
867
//#define RESERVED             (0x0004)  /* Comp. B */
868
//#define RESERVED             (0x0008)  /* Comp. B */
869
//#define RESERVED             (0x0010)  /* Comp. B */
870
//#define RESERVED             (0x0020)  /* Comp. B */
871
//#define RESERVED             (0x0040)  /* Comp. B */
872
//#define RESERVED             (0x0080)  /* Comp. B */
873
#define CBIE_H                 (0x0001)       /* Comp. B Interrupt Enable */
874
#define CBIIE_H                (0x0002)       /* Comp. B Interrupt Enable Inverted Polarity */
875
//#define RESERVED             (0x0400)  /* Comp. B */
876
//#define RESERVED             (0x0800)  /* Comp. B */
877
//#define RESERVED             (0x1000)  /* Comp. B */
878
//#define RESERVED             (0x2000)  /* Comp. B */
879
//#define RESERVED             (0x4000)  /* Comp. B */
880
//#define RESERVED             (0x8000)  /* Comp. B */
881
 
882
/* CBIV Definitions */
883
#define CBIV_NONE              (0x0000)       /* No Interrupt pending */
884
#define CBIV_CBIFG             (0x0002)       /* CBIFG */
885
#define CBIV_CBIIFG            (0x0004)       /* CBIIFG */
886
 
887
/*************************************************************
888
* CRC Module
889
*************************************************************/
890
#define __MSP430_HAS_CRC__                    /* Definition to show that Module is available */
891
#define __MSP430_BASEADDRESS_CRC__ 0x0150
892
 
893
SFR_16BIT(CRCDI);                             /* CRC Data In Register */
894
SFR_8BIT(CRCDI_L);                            /* CRC Data In Register */
895
SFR_8BIT(CRCDI_H);                            /* CRC Data In Register */
896
SFR_16BIT(CRCDIRB);                           /* CRC data in reverse byte Register */
897
SFR_8BIT(CRCDIRB_L);                          /* CRC data in reverse byte Register */
898
SFR_8BIT(CRCDIRB_H);                          /* CRC data in reverse byte Register */
899
SFR_16BIT(CRCINIRES);                         /* CRC Initialisation Register and Result Register */
900
SFR_8BIT(CRCINIRES_L);                        /* CRC Initialisation Register and Result Register */
901
SFR_8BIT(CRCINIRES_H);                        /* CRC Initialisation Register and Result Register */
902
SFR_16BIT(CRCRESR);                           /* CRC reverse result Register */
903
SFR_8BIT(CRCRESR_L);                          /* CRC reverse result Register */
904
SFR_8BIT(CRCRESR_H);                          /* CRC reverse result Register */
905
 
906
/************************************************************
907
* DMA_X
908
************************************************************/
909
#define __MSP430_HAS_DMAX_3__                 /* Definition to show that Module is available */
910
#define __MSP430_BASEADDRESS_DMAX_3__ 0x0500
911
 
912
SFR_16BIT(DMACTL0);                           /* DMA Module Control 0 */
913
SFR_8BIT(DMACTL0_L);                          /* DMA Module Control 0 */
914
SFR_8BIT(DMACTL0_H);                          /* DMA Module Control 0 */
915
SFR_16BIT(DMACTL1);                           /* DMA Module Control 1 */
916
SFR_8BIT(DMACTL1_L);                          /* DMA Module Control 1 */
917
SFR_8BIT(DMACTL1_H);                          /* DMA Module Control 1 */
918
SFR_16BIT(DMACTL2);                           /* DMA Module Control 2 */
919
SFR_8BIT(DMACTL2_L);                          /* DMA Module Control 2 */
920
SFR_8BIT(DMACTL2_H);                          /* DMA Module Control 2 */
921
SFR_16BIT(DMACTL3);                           /* DMA Module Control 3 */
922
SFR_8BIT(DMACTL3_L);                          /* DMA Module Control 3 */
923
SFR_8BIT(DMACTL3_H);                          /* DMA Module Control 3 */
924
SFR_16BIT(DMACTL4);                           /* DMA Module Control 4 */
925
SFR_8BIT(DMACTL4_L);                          /* DMA Module Control 4 */
926
SFR_8BIT(DMACTL4_H);                          /* DMA Module Control 4 */
927
SFR_16BIT(DMAIV);                             /* DMA Interrupt Vector Word */
928
SFR_8BIT(DMAIV_L);                            /* DMA Interrupt Vector Word */
929
SFR_8BIT(DMAIV_H);                            /* DMA Interrupt Vector Word */
930
 
931
SFR_16BIT(DMA0CTL);                           /* DMA Channel 0 Control */
932
SFR_8BIT(DMA0CTL_L);                          /* DMA Channel 0 Control */
933
SFR_8BIT(DMA0CTL_H);                          /* DMA Channel 0 Control */
934
SFR_20BIT(DMA0SA);                            /* DMA Channel 0 Source Address */
935
SFR_16BIT(DMA0SAL);                           /* DMA Channel 0 Source Address */
936
SFR_20BIT(DMA0DA);                            /* DMA Channel 0 Destination Address */
937
SFR_16BIT(DMA0DAL);                           /* DMA Channel 0 Destination Address */
938
SFR_16BIT(DMA0SZ);                            /* DMA Channel 0 Transfer Size */
939
 
940
SFR_16BIT(DMA1CTL);                           /* DMA Channel 1 Control */
941
SFR_8BIT(DMA1CTL_L);                          /* DMA Channel 1 Control */
942
SFR_8BIT(DMA1CTL_H);                          /* DMA Channel 1 Control */
943
SFR_20BIT(DMA1SA);                            /* DMA Channel 1 Source Address */
944
SFR_16BIT(DMA1SAL);                           /* DMA Channel 1 Source Address */
945
SFR_20BIT(DMA1DA);                            /* DMA Channel 1 Destination Address */
946
SFR_16BIT(DMA1DAL);                           /* DMA Channel 1 Destination Address */
947
SFR_16BIT(DMA1SZ);                            /* DMA Channel 1 Transfer Size */
948
 
949
SFR_16BIT(DMA2CTL);                           /* DMA Channel 2 Control */
950
SFR_8BIT(DMA2CTL_L);                          /* DMA Channel 2 Control */
951
SFR_8BIT(DMA2CTL_H);                          /* DMA Channel 2 Control */
952
SFR_20BIT(DMA2SA);                            /* DMA Channel 2 Source Address */
953
SFR_16BIT(DMA2SAL);                           /* DMA Channel 2 Source Address */
954
SFR_20BIT(DMA2DA);                            /* DMA Channel 2 Destination Address */
955
SFR_16BIT(DMA2DAL);                           /* DMA Channel 2 Destination Address */
956
SFR_16BIT(DMA2SZ);                            /* DMA Channel 2 Transfer Size */
957
 
958
/* DMACTL0 Control Bits */
959
#define DMA0TSEL0              (0x0001)       /* DMA channel 0 transfer select bit 0 */
960
#define DMA0TSEL1              (0x0002)       /* DMA channel 0 transfer select bit 1 */
961
#define DMA0TSEL2              (0x0004)       /* DMA channel 0 transfer select bit 2 */
962
#define DMA0TSEL3              (0x0008)       /* DMA channel 0 transfer select bit 3 */
963
#define DMA0TSEL4              (0x0010)       /* DMA channel 0 transfer select bit 4 */
964
#define DMA1TSEL0              (0x0100)       /* DMA channel 1 transfer select bit 0 */
965
#define DMA1TSEL1              (0x0200)       /* DMA channel 1 transfer select bit 1 */
966
#define DMA1TSEL2              (0x0400)       /* DMA channel 1 transfer select bit 2 */
967
#define DMA1TSEL3              (0x0800)       /* DMA channel 1 transfer select bit 3 */
968
#define DMA1TSEL4              (0x1000)       /* DMA channel 1 transfer select bit 4 */
969
 
970
/* DMACTL0 Control Bits */
971
#define DMA0TSEL0_L            (0x0001)       /* DMA channel 0 transfer select bit 0 */
972
#define DMA0TSEL1_L            (0x0002)       /* DMA channel 0 transfer select bit 1 */
973
#define DMA0TSEL2_L            (0x0004)       /* DMA channel 0 transfer select bit 2 */
974
#define DMA0TSEL3_L            (0x0008)       /* DMA channel 0 transfer select bit 3 */
975
#define DMA0TSEL4_L            (0x0010)       /* DMA channel 0 transfer select bit 4 */
976
 
977
/* DMACTL0 Control Bits */
978
#define DMA1TSEL0_H            (0x0001)       /* DMA channel 1 transfer select bit 0 */
979
#define DMA1TSEL1_H            (0x0002)       /* DMA channel 1 transfer select bit 1 */
980
#define DMA1TSEL2_H            (0x0004)       /* DMA channel 1 transfer select bit 2 */
981
#define DMA1TSEL3_H            (0x0008)       /* DMA channel 1 transfer select bit 3 */
982
#define DMA1TSEL4_H            (0x0010)       /* DMA channel 1 transfer select bit 4 */
983
 
984
/* DMACTL01 Control Bits */
985
#define DMA2TSEL0              (0x0001)       /* DMA channel 2 transfer select bit 0 */
986
#define DMA2TSEL1              (0x0002)       /* DMA channel 2 transfer select bit 1 */
987
#define DMA2TSEL2              (0x0004)       /* DMA channel 2 transfer select bit 2 */
988
#define DMA2TSEL3              (0x0008)       /* DMA channel 2 transfer select bit 3 */
989
#define DMA2TSEL4              (0x0010)       /* DMA channel 2 transfer select bit 4 */
990
 
991
/* DMACTL01 Control Bits */
992
#define DMA2TSEL0_L            (0x0001)       /* DMA channel 2 transfer select bit 0 */
993
#define DMA2TSEL1_L            (0x0002)       /* DMA channel 2 transfer select bit 1 */
994
#define DMA2TSEL2_L            (0x0004)       /* DMA channel 2 transfer select bit 2 */
995
#define DMA2TSEL3_L            (0x0008)       /* DMA channel 2 transfer select bit 3 */
996
#define DMA2TSEL4_L            (0x0010)       /* DMA channel 2 transfer select bit 4 */
997
 
998
/* DMACTL01 Control Bits */
999
 
1000
/* DMACTL4 Control Bits */
1001
#define ENNMI                  (0x0001)       /* Enable NMI interruption of DMA */
1002
#define ROUNDROBIN             (0x0002)       /* Round-Robin DMA channel priorities */
1003
#define DMARMWDIS              (0x0004)       /* Inhibited DMA transfers during read-modify-write CPU operations */
1004
 
1005
/* DMACTL4 Control Bits */
1006
#define ENNMI_L                (0x0001)       /* Enable NMI interruption of DMA */
1007
#define ROUNDROBIN_L           (0x0002)       /* Round-Robin DMA channel priorities */
1008
#define DMARMWDIS_L            (0x0004)       /* Inhibited DMA transfers during read-modify-write CPU operations */
1009
 
1010
/* DMACTL4 Control Bits */
1011
 
1012
/* DMAxCTL Control Bits */
1013
#define DMAREQ                 (0x0001)       /* Initiate DMA transfer with DMATSEL */
1014
#define DMAABORT               (0x0002)       /* DMA transfer aborted by NMI */
1015
#define DMAIE                  (0x0004)       /* DMA interrupt enable */
1016
#define DMAIFG                 (0x0008)       /* DMA interrupt flag */
1017
#define DMAEN                  (0x0010)       /* DMA enable */
1018
#define DMALEVEL               (0x0020)       /* DMA level sensitive trigger select */
1019
#define DMASRCBYTE             (0x0040)       /* DMA source byte */
1020
#define DMADSTBYTE             (0x0080)       /* DMA destination byte */
1021
#define DMASRCINCR0            (0x0100)       /* DMA source increment bit 0 */
1022
#define DMASRCINCR1            (0x0200)       /* DMA source increment bit 1 */
1023
#define DMADSTINCR0            (0x0400)       /* DMA destination increment bit 0 */
1024
#define DMADSTINCR1            (0x0800)       /* DMA destination increment bit 1 */
1025
#define DMADT0                 (0x1000)       /* DMA transfer mode bit 0 */
1026
#define DMADT1                 (0x2000)       /* DMA transfer mode bit 1 */
1027
#define DMADT2                 (0x4000)       /* DMA transfer mode bit 2 */
1028
 
1029
/* DMAxCTL Control Bits */
1030
#define DMAREQ_L               (0x0001)       /* Initiate DMA transfer with DMATSEL */
1031
#define DMAABORT_L             (0x0002)       /* DMA transfer aborted by NMI */
1032
#define DMAIE_L                (0x0004)       /* DMA interrupt enable */
1033
#define DMAIFG_L               (0x0008)       /* DMA interrupt flag */
1034
#define DMAEN_L                (0x0010)       /* DMA enable */
1035
#define DMALEVEL_L             (0x0020)       /* DMA level sensitive trigger select */
1036
#define DMASRCBYTE_L           (0x0040)       /* DMA source byte */
1037
#define DMADSTBYTE_L           (0x0080)       /* DMA destination byte */
1038
 
1039
/* DMAxCTL Control Bits */
1040
#define DMASRCINCR0_H          (0x0001)       /* DMA source increment bit 0 */
1041
#define DMASRCINCR1_H          (0x0002)       /* DMA source increment bit 1 */
1042
#define DMADSTINCR0_H          (0x0004)       /* DMA destination increment bit 0 */
1043
#define DMADSTINCR1_H          (0x0008)       /* DMA destination increment bit 1 */
1044
#define DMADT0_H               (0x0010)       /* DMA transfer mode bit 0 */
1045
#define DMADT1_H               (0x0020)       /* DMA transfer mode bit 1 */
1046
#define DMADT2_H               (0x0040)       /* DMA transfer mode bit 2 */
1047
 
1048
#define DMASWDW                (0*0x0040u)    /* DMA transfer: source word to destination word */
1049
#define DMASBDW                (1*0x0040u)    /* DMA transfer: source byte to destination word */
1050
#define DMASWDB                (2*0x0040u)    /* DMA transfer: source word to destination byte */
1051
#define DMASBDB                (3*0x0040u)    /* DMA transfer: source byte to destination byte */
1052
 
1053
#define DMASRCINCR_0           (0*0x0100u)    /* DMA source increment 0: source address unchanged */
1054
#define DMASRCINCR_1           (1*0x0100u)    /* DMA source increment 1: source address unchanged */
1055
#define DMASRCINCR_2           (2*0x0100u)    /* DMA source increment 2: source address decremented */
1056
#define DMASRCINCR_3           (3*0x0100u)    /* DMA source increment 3: source address incremented */
1057
 
1058
#define DMADSTINCR_0           (0*0x0400u)    /* DMA destination increment 0: destination address unchanged */
1059
#define DMADSTINCR_1           (1*0x0400u)    /* DMA destination increment 1: destination address unchanged */
1060
#define DMADSTINCR_2           (2*0x0400u)    /* DMA destination increment 2: destination address decremented */
1061
#define DMADSTINCR_3           (3*0x0400u)    /* DMA destination increment 3: destination address incremented */
1062
 
1063
#define DMADT_0                (0*0x1000u)    /* DMA transfer mode 0: Single transfer */
1064
#define DMADT_1                (1*0x1000u)    /* DMA transfer mode 1: Block transfer */
1065
#define DMADT_2                (2*0x1000u)    /* DMA transfer mode 2: Burst-Block transfer */
1066
#define DMADT_3                (3*0x1000u)    /* DMA transfer mode 3: Burst-Block transfer */
1067
#define DMADT_4                (4*0x1000u)    /* DMA transfer mode 4: Repeated Single transfer */
1068
#define DMADT_5                (5*0x1000u)    /* DMA transfer mode 5: Repeated Block transfer */
1069
#define DMADT_6                (6*0x1000u)    /* DMA transfer mode 6: Repeated Burst-Block transfer */
1070
#define DMADT_7                (7*0x1000u)    /* DMA transfer mode 7: Repeated Burst-Block transfer */
1071
 
1072
/* DMAIV Definitions */
1073
#define DMAIV_NONE             (0x0000)       /* No Interrupt pending */
1074
#define DMAIV_DMA0IFG          (0x0002)       /* DMA0IFG*/
1075
#define DMAIV_DMA1IFG          (0x0004)       /* DMA1IFG*/
1076
#define DMAIV_DMA2IFG          (0x0006)       /* DMA2IFG*/
1077
 
1078
#define DMA0TSEL_0             (0*0x0001u)    /* DMA channel 0 transfer select 0:  DMA_REQ (sw) */
1079
#define DMA0TSEL_1             (1*0x0001u)    /* DMA channel 0 transfer select 1:  Timer0_A (TA0CCR0.IFG) */
1080
#define DMA0TSEL_2             (2*0x0001u)    /* DMA channel 0 transfer select 2:  Timer0_A (TA0CCR2.IFG) */
1081
#define DMA0TSEL_3             (3*0x0001u)    /* DMA channel 0 transfer select 3:  Timer1_A (TA1CCR0.IFG) */
1082
#define DMA0TSEL_4             (4*0x0001u)    /* DMA channel 0 transfer select 4:  Timer1_A (TA1CCR2.IFG) */
1083
#define DMA0TSEL_5             (5*0x0001u)    /* DMA channel 0 transfer select 5:  Timer2_A (TA2CCR0.IFG) */
1084
#define DMA0TSEL_6             (6*0x0001u)    /* DMA channel 0 transfer select 6:  Timer2_A (TA2CCR2.IFG) */
1085
#define DMA0TSEL_7             (7*0x0001u)    /* DMA channel 0 transfer select 7:  TimerB (TB0CCR0.IFG) */
1086
#define DMA0TSEL_8             (8*0x0001u)    /* DMA channel 0 transfer select 8:  TimerB (TB0CCR2.IFG) */
1087
#define DMA0TSEL_9             (9*0x0001u)    /* DMA channel 0 transfer select 9:  Reserved */
1088
#define DMA0TSEL_10            (10*0x0001u)   /* DMA channel 0 transfer select 10: Reserved */
1089
#define DMA0TSEL_11            (11*0x0001u)   /* DMA channel 0 transfer select 11: Reserved */
1090
#define DMA0TSEL_12            (12*0x0001u)   /* DMA channel 0 transfer select 12: Reserved */
1091
#define DMA0TSEL_13            (13*0x0001u)   /* DMA channel 0 transfer select 13: Reserved */
1092
#define DMA0TSEL_14            (14*0x0001u)   /* DMA channel 0 transfer select 14: Reserved */
1093
#define DMA0TSEL_15            (15*0x0001u)   /* DMA channel 0 transfer select 15: Reserved */
1094
#define DMA0TSEL_16            (16*0x0001u)   /* DMA channel 0 transfer select 16: USCIA0 receive */
1095
#define DMA0TSEL_17            (17*0x0001u)   /* DMA channel 0 transfer select 17: USCIA0 transmit */
1096
#define DMA0TSEL_18            (18*0x0001u)   /* DMA channel 0 transfer select 18: USCIB0 receive */
1097
#define DMA0TSEL_19            (19*0x0001u)   /* DMA channel 0 transfer select 19: USCIB0 transmit */
1098
#define DMA0TSEL_20            (20*0x0001u)   /* DMA channel 0 transfer select 20: USCIA1 receive */
1099
#define DMA0TSEL_21            (21*0x0001u)   /* DMA channel 0 transfer select 21: USCIA1 transmit */
1100
#define DMA0TSEL_22            (22*0x0001u)   /* DMA channel 0 transfer select 22: USCIB1 receive */
1101
#define DMA0TSEL_23            (23*0x0001u)   /* DMA channel 0 transfer select 23: USCIB1 transmit */
1102
#define DMA0TSEL_24            (24*0x0001u)   /* DMA channel 0 transfer select 24: ADC12IFGx */
1103
#define DMA0TSEL_25            (25*0x0001u)   /* DMA channel 0 transfer select 25: Reserved */
1104
#define DMA0TSEL_26            (26*0x0001u)   /* DMA channel 0 transfer select 26: Reserved */
1105
#define DMA0TSEL_27            (27*0x0001u)   /* DMA channel 0 transfer select 27: USB FNRXD */
1106
#define DMA0TSEL_28            (28*0x0001u)   /* DMA channel 0 transfer select 28: USB ready */
1107
#define DMA0TSEL_29            (29*0x0001u)   /* DMA channel 0 transfer select 29: Multiplier ready */
1108
#define DMA0TSEL_30            (30*0x0001u)   /* DMA channel 0 transfer select 30: previous DMA channel DMA2IFG */
1109
#define DMA0TSEL_31            (31*0x0001u)   /* DMA channel 0 transfer select 31: ext. Trigger (DMAE0) */
1110
 
1111
#define DMA1TSEL_0             (0*0x0100u)    /* DMA channel 1 transfer select 0:  DMA_REQ (sw) */
1112
#define DMA1TSEL_1             (1*0x0100u)    /* DMA channel 1 transfer select 1:  Timer0_A (TA0CCR0.IFG) */
1113
#define DMA1TSEL_2             (2*0x0100u)    /* DMA channel 1 transfer select 2:  Timer0_A (TA0CCR2.IFG) */
1114
#define DMA1TSEL_3             (3*0x0100u)    /* DMA channel 1 transfer select 3:  Timer1_A (TA1CCR0.IFG) */
1115
#define DMA1TSEL_4             (4*0x0100u)    /* DMA channel 1 transfer select 4:  Timer1_A (TA1CCR2.IFG) */
1116
#define DMA1TSEL_5             (5*0x0100u)    /* DMA channel 1 transfer select 5:  Timer2_A (TA2CCR0.IFG) */
1117
#define DMA1TSEL_6             (6*0x0100u)    /* DMA channel 1 transfer select 6:  Timer2_A (TA2CCR2.IFG) */
1118
#define DMA1TSEL_7             (7*0x0100u)    /* DMA channel 1 transfer select 7:  TimerB (TB0CCR0.IFG) */
1119
#define DMA1TSEL_8             (8*0x0100u)    /* DMA channel 1 transfer select 8:  TimerB (TB0CCR2.IFG) */
1120
#define DMA1TSEL_9             (9*0x0100u)    /* DMA channel 1 transfer select 9:  Reserved */
1121
#define DMA1TSEL_10            (10*0x0100u)   /* DMA channel 1 transfer select 10: Reserved */
1122
#define DMA1TSEL_11            (11*0x0100u)   /* DMA channel 1 transfer select 11: Reserved */
1123
#define DMA1TSEL_12            (12*0x0100u)   /* DMA channel 1 transfer select 12: Reserved */
1124
#define DMA1TSEL_13            (13*0x0100u)   /* DMA channel 1 transfer select 13: Reserved */
1125
#define DMA1TSEL_14            (14*0x0100u)   /* DMA channel 1 transfer select 14: Reserved */
1126
#define DMA1TSEL_15            (15*0x0100u)   /* DMA channel 1 transfer select 15: Reserved */
1127
#define DMA1TSEL_16            (16*0x0100u)   /* DMA channel 1 transfer select 16: USCIA0 receive */
1128
#define DMA1TSEL_17            (17*0x0100u)   /* DMA channel 1 transfer select 17: USCIA0 transmit */
1129
#define DMA1TSEL_18            (18*0x0100u)   /* DMA channel 1 transfer select 18: USCIB0 receive */
1130
#define DMA1TSEL_19            (19*0x0100u)   /* DMA channel 1 transfer select 19: USCIB0 transmit */
1131
#define DMA1TSEL_20            (20*0x0100u)   /* DMA channel 1 transfer select 20: USCIA1 receive */
1132
#define DMA1TSEL_21            (21*0x0100u)   /* DMA channel 1 transfer select 21: USCIA1 transmit */
1133
#define DMA1TSEL_22            (22*0x0100u)   /* DMA channel 1 transfer select 22: USCIB1 receive */
1134
#define DMA1TSEL_23            (23*0x0100u)   /* DMA channel 1 transfer select 23: USCIB1 transmit */
1135
#define DMA1TSEL_24            (24*0x0100u)   /* DMA channel 1 transfer select 24: ADC12IFGx */
1136
#define DMA1TSEL_25            (25*0x0100u)   /* DMA channel 1 transfer select 25: Reserved */
1137
#define DMA1TSEL_26            (26*0x0100u)   /* DMA channel 1 transfer select 26: Reserved */
1138
#define DMA1TSEL_27            (27*0x0100u)   /* DMA channel 1 transfer select 27: USB FNRXD */
1139
#define DMA1TSEL_28            (28*0x0100u)   /* DMA channel 1 transfer select 28: USB ready */
1140
#define DMA1TSEL_29            (29*0x0100u)   /* DMA channel 1 transfer select 29: Multiplier ready */
1141
#define DMA1TSEL_30            (30*0x0100u)   /* DMA channel 1 transfer select 30: previous DMA channel DMA0IFG */
1142
#define DMA1TSEL_31            (31*0x0100u)   /* DMA channel 1 transfer select 31: ext. Trigger (DMAE0) */
1143
 
1144
#define DMA2TSEL_0             (0*0x0001u)    /* DMA channel 2 transfer select 0:  DMA_REQ (sw) */
1145
#define DMA2TSEL_1             (1*0x0001u)    /* DMA channel 2 transfer select 1:  Timer0_A (TA0CCR0.IFG) */
1146
#define DMA2TSEL_2             (2*0x0001u)    /* DMA channel 2 transfer select 2:  Timer0_A (TA0CCR2.IFG) */
1147
#define DMA2TSEL_3             (3*0x0001u)    /* DMA channel 2 transfer select 3:  Timer1_A (TA1CCR0.IFG) */
1148
#define DMA2TSEL_4             (4*0x0001u)    /* DMA channel 2 transfer select 4:  Timer1_A (TA1CCR2.IFG) */
1149
#define DMA2TSEL_5             (5*0x0001u)    /* DMA channel 2 transfer select 5:  Timer2_A (TA2CCR0.IFG) */
1150
#define DMA2TSEL_6             (6*0x0001u)    /* DMA channel 2 transfer select 6:  Timer2_A (TA2CCR2.IFG) */
1151
#define DMA2TSEL_7             (7*0x0001u)    /* DMA channel 2 transfer select 7:  TimerB (TB0CCR0.IFG) */
1152
#define DMA2TSEL_8             (8*0x0001u)    /* DMA channel 2 transfer select 8:  TimerB (TB0CCR2.IFG) */
1153
#define DMA2TSEL_9             (9*0x0001u)    /* DMA channel 2 transfer select 9:  Reserved */
1154
#define DMA2TSEL_10            (10*0x0001u)   /* DMA channel 2 transfer select 10: Reserved */
1155
#define DMA2TSEL_11            (11*0x0001u)   /* DMA channel 2 transfer select 11: Reserved */
1156
#define DMA2TSEL_12            (12*0x0001u)   /* DMA channel 2 transfer select 12: Reserved */
1157
#define DMA2TSEL_13            (13*0x0001u)   /* DMA channel 2 transfer select 13: Reserved */
1158
#define DMA2TSEL_14            (14*0x0001u)   /* DMA channel 2 transfer select 14: Reserved */
1159
#define DMA2TSEL_15            (15*0x0001u)   /* DMA channel 2 transfer select 15: Reserved */
1160
#define DMA2TSEL_16            (16*0x0001u)   /* DMA channel 2 transfer select 16: USCIA0 receive */
1161
#define DMA2TSEL_17            (17*0x0001u)   /* DMA channel 2 transfer select 17: USCIA0 transmit */
1162
#define DMA2TSEL_18            (18*0x0001u)   /* DMA channel 2 transfer select 18: USCIB0 receive */
1163
#define DMA2TSEL_19            (19*0x0001u)   /* DMA channel 2 transfer select 19: USCIB0 transmit */
1164
#define DMA2TSEL_20            (20*0x0001u)   /* DMA channel 2 transfer select 20: USCIA1 receive */
1165
#define DMA2TSEL_21            (21*0x0001u)   /* DMA channel 2 transfer select 21: USCIA1 transmit */
1166
#define DMA2TSEL_22            (22*0x0001u)   /* DMA channel 2 transfer select 22: USCIB1 receive */
1167
#define DMA2TSEL_23            (23*0x0001u)   /* DMA channel 2 transfer select 23: USCIB1 transmit */
1168
#define DMA2TSEL_24            (24*0x0001u)   /* DMA channel 2 transfer select 24: ADC12IFGx */
1169
#define DMA2TSEL_25            (25*0x0001u)   /* DMA channel 2 transfer select 25: Reserved */
1170
#define DMA2TSEL_26            (26*0x0001u)   /* DMA channel 2 transfer select 26: Reserved */
1171
#define DMA2TSEL_27            (27*0x0001u)   /* DMA channel 2 transfer select 27: USB FNRXD */
1172
#define DMA2TSEL_28            (28*0x0001u)   /* DMA channel 2 transfer select 28: USB ready */
1173
#define DMA2TSEL_29            (29*0x0001u)   /* DMA channel 2 transfer select 29: Multiplier ready */
1174
#define DMA2TSEL_30            (30*0x0001u)   /* DMA channel 2 transfer select 30: previous DMA channel DMA1IFG */
1175
#define DMA2TSEL_31            (31*0x0001u)   /* DMA channel 2 transfer select 31: ext. Trigger (DMAE0) */
1176
 
1177
#define DMA0TSEL__DMA_REQ      (0*0x0001u)    /* DMA channel 0 transfer select 0:  DMA_REQ (sw) */
1178
#define DMA0TSEL__TA0CCR0      (1*0x0001u)    /* DMA channel 0 transfer select 1:  Timer0_A (TA0CCR0.IFG) */
1179
#define DMA0TSEL__TA0CCR2      (2*0x0001u)    /* DMA channel 0 transfer select 2:  Timer0_A (TA0CCR2.IFG) */
1180
#define DMA0TSEL__TA1CCR0      (3*0x0001u)    /* DMA channel 0 transfer select 3:  Timer1_A (TA1CCR0.IFG) */
1181
#define DMA0TSEL__TA1CCR2      (4*0x0001u)    /* DMA channel 0 transfer select 4:  Timer1_A (TA1CCR2.IFG) */
1182
#define DMA0TSEL__TA2CCR0      (5*0x0001u)    /* DMA channel 0 transfer select 5:  Timer2_A (TA2CCR0.IFG) */
1183
#define DMA0TSEL__TA2CCR2      (6*0x0001u)    /* DMA channel 0 transfer select 6:  Timer2_A (TA2CCR2.IFG) */
1184
#define DMA0TSEL__TB0CCR0      (7*0x0001u)    /* DMA channel 0 transfer select 7:  TimerB (TB0CCR0.IFG) */
1185
#define DMA0TSEL__TB0CCR2      (8*0x0001u)    /* DMA channel 0 transfer select 8:  TimerB (TB0CCR2.IFG) */
1186
#define DMA0TSEL__RES9         (9*0x0001u)    /* DMA channel 0 transfer select 9:  Reserved */
1187
#define DMA0TSEL__RES10        (10*0x0001u)   /* DMA channel 0 transfer select 10: Reserved */
1188
#define DMA0TSEL__RES11        (11*0x0001u)   /* DMA channel 0 transfer select 11: Reserved */
1189
#define DMA0TSEL__RES12        (12*0x0001u)   /* DMA channel 0 transfer select 12: Reserved */
1190
#define DMA0TSEL__RES13        (13*0x0001u)   /* DMA channel 0 transfer select 13: Reserved */
1191
#define DMA0TSEL__RES14        (14*0x0001u)   /* DMA channel 0 transfer select 14: Reserved */
1192
#define DMA0TSEL__RES15        (15*0x0001u)   /* DMA channel 0 transfer select 15: Reserved */
1193
#define DMA0TSEL__USCIA0RX     (16*0x0001u)   /* DMA channel 0 transfer select 16: USCIA0 receive */
1194
#define DMA0TSEL__USCIA0TX     (17*0x0001u)   /* DMA channel 0 transfer select 17: USCIA0 transmit */
1195
#define DMA0TSEL__USCIB0RX     (18*0x0001u)   /* DMA channel 0 transfer select 18: USCIB0 receive */
1196
#define DMA0TSEL__USCIB0TX     (19*0x0001u)   /* DMA channel 0 transfer select 19: USCIB0 transmit */
1197
#define DMA0TSEL__USCIA1RX     (20*0x0001u)   /* DMA channel 0 transfer select 20: USCIA1 receive */
1198
#define DMA0TSEL__USCIA1TX     (21*0x0001u)   /* DMA channel 0 transfer select 21: USCIA1 transmit */
1199
#define DMA0TSEL__USCIB1RX     (22*0x0001u)   /* DMA channel 0 transfer select 22: USCIB1 receive */
1200
#define DMA0TSEL__USCIB1TX     (23*0x0001u)   /* DMA channel 0 transfer select 23: USCIB1 transmit */
1201
#define DMA0TSEL__ADC12IFG     (24*0x0001u)   /* DMA channel 0 transfer select 24: ADC12IFGx */
1202
#define DMA0TSEL__RES25        (25*0x0001u)   /* DMA channel 0 transfer select 25: Reserved */
1203
#define DMA0TSEL__RES26        (26*0x0001u)   /* DMA channel 0 transfer select 26: Reserved */
1204
#define DMA0TSEL__USB_FNRXD    (27*0x0001u)   /* DMA channel 0 transfer select 27: USB FNRXD */
1205
#define DMA0TSEL__USB_READY    (28*0x0001u)   /* DMA channel 0 transfer select 28: USB ready */
1206
#define DMA0TSEL__MPY          (29*0x0001u)   /* DMA channel 0 transfer select 29: Multiplier ready */
1207
#define DMA0TSEL__DMA2IFG      (30*0x0001u)   /* DMA channel 0 transfer select 30: previous DMA channel DMA2IFG */
1208
#define DMA0TSEL__DMAE0        (31*0x0001u)   /* DMA channel 0 transfer select 31: ext. Trigger (DMAE0) */
1209
 
1210
#define DMA1TSEL__DMA_REQ      (0*0x0100u)    /* DMA channel 1 transfer select 0:  DMA_REQ (sw) */
1211
#define DMA1TSEL__TA0CCR0      (1*0x0100u)    /* DMA channel 1 transfer select 1:  Timer0_A (TA0CCR0.IFG) */
1212
#define DMA1TSEL__TA0CCR2      (2*0x0100u)    /* DMA channel 1 transfer select 2:  Timer0_A (TA0CCR2.IFG) */
1213
#define DMA1TSEL__TA1CCR0      (3*0x0100u)    /* DMA channel 1 transfer select 3:  Timer1_A (TA1CCR0.IFG) */
1214
#define DMA1TSEL__TA1CCR2      (4*0x0100u)    /* DMA channel 1 transfer select 4:  Timer1_A (TA1CCR2.IFG) */
1215
#define DMA1TSEL__TA2CCR0      (5*0x0100u)    /* DMA channel 1 transfer select 5:  Timer2_A (TA2CCR0.IFG) */
1216
#define DMA1TSEL__TA2CCR2      (6*0x0100u)    /* DMA channel 1 transfer select 6:  Timer2_A (TA2CCR2.IFG) */
1217
#define DMA1TSEL__TB0CCR0      (7*0x0100u)    /* DMA channel 1 transfer select 7:  TimerB (TB0CCR0.IFG) */
1218
#define DMA1TSEL__TB0CCR2      (8*0x0100u)    /* DMA channel 1 transfer select 8:  TimerB (TB0CCR2.IFG) */
1219
#define DMA1TSEL__RES9         (9*0x0100u)    /* DMA channel 1 transfer select 9:  Reserved */
1220
#define DMA1TSEL__RES10        (10*0x0100u)   /* DMA channel 1 transfer select 10: Reserved */
1221
#define DMA1TSEL__RES11        (11*0x0100u)   /* DMA channel 1 transfer select 11: Reserved */
1222
#define DMA1TSEL__RES12        (12*0x0100u)   /* DMA channel 1 transfer select 12: Reserved */
1223
#define DMA1TSEL__RES13        (13*0x0100u)   /* DMA channel 1 transfer select 13: Reserved */
1224
#define DMA1TSEL__RES14        (14*0x0100u)   /* DMA channel 1 transfer select 14: Reserved */
1225
#define DMA1TSEL__RES15        (15*0x0100u)   /* DMA channel 1 transfer select 15: Reserved */
1226
#define DMA1TSEL__USCIA0RX     (16*0x0100u)   /* DMA channel 1 transfer select 16: USCIA0 receive */
1227
#define DMA1TSEL__USCIA0TX     (17*0x0100u)   /* DMA channel 1 transfer select 17: USCIA0 transmit */
1228
#define DMA1TSEL__USCIB0RX     (18*0x0100u)   /* DMA channel 1 transfer select 18: USCIB0 receive */
1229
#define DMA1TSEL__USCIB0TX     (19*0x0100u)   /* DMA channel 1 transfer select 19: USCIB0 transmit */
1230
#define DMA1TSEL__USCIA1RX     (20*0x0100u)   /* DMA channel 1 transfer select 20: USCIA1 receive */
1231
#define DMA1TSEL__USCIA1TX     (21*0x0100u)   /* DMA channel 1 transfer select 21: USCIA1 transmit */
1232
#define DMA1TSEL__USCIB1RX     (22*0x0100u)   /* DMA channel 1 transfer select 22: USCIB1 receive */
1233
#define DMA1TSEL__USCIB1TX     (23*0x0100u)   /* DMA channel 1 transfer select 23: USCIB1 transmit */
1234
#define DMA1TSEL__ADC12IFG     (24*0x0100u)   /* DMA channel 1 transfer select 24: ADC12IFGx */
1235
#define DMA1TSEL__RES25        (25*0x0100u)   /* DMA channel 1 transfer select 25: Reserved */
1236
#define DMA1TSEL__RES26        (26*0x0100u)   /* DMA channel 1 transfer select 26: Reserved */
1237
#define DMA1TSEL__USB_FNRXD    (27*0x0100u)   /* DMA channel 1 transfer select 27: USB FNRXD */
1238
#define DMA1TSEL__USB_READY    (28*0x0100u)   /* DMA channel 1 transfer select 28: USB ready */
1239
#define DMA1TSEL__MPY          (29*0x0100u)   /* DMA channel 1 transfer select 29: Multiplier ready */
1240
#define DMA1TSEL__DMA0IFG      (30*0x0100u)   /* DMA channel 1 transfer select 30: previous DMA channel DMA0IFG */
1241
#define DMA1TSEL__DMAE0        (31*0x0100u)   /* DMA channel 1 transfer select 31: ext. Trigger (DMAE0) */
1242
 
1243
#define DMA2TSEL__DMA_REQ      (0*0x0001u)    /* DMA channel 2 transfer select 0:  DMA_REQ (sw) */
1244
#define DMA2TSEL__TA0CCR0      (1*0x0001u)    /* DMA channel 2 transfer select 1:  Timer0_A (TA0CCR0.IFG) */
1245
#define DMA2TSEL__TA0CCR2      (2*0x0001u)    /* DMA channel 2 transfer select 2:  Timer0_A (TA0CCR2.IFG) */
1246
#define DMA2TSEL__TA1CCR0      (3*0x0001u)    /* DMA channel 2 transfer select 3:  Timer1_A (TA1CCR0.IFG) */
1247
#define DMA2TSEL__TA1CCR2      (4*0x0001u)    /* DMA channel 2 transfer select 4:  Timer1_A (TA1CCR2.IFG) */
1248
#define DMA2TSEL__TA2CCR0      (5*0x0001u)    /* DMA channel 2 transfer select 5:  Timer2_A (TA2CCR0.IFG) */
1249
#define DMA2TSEL__TA2CCR2      (6*0x0001u)    /* DMA channel 2 transfer select 6:  Timer2_A (TA2CCR2.IFG) */
1250
#define DMA2TSEL__TB0CCR0      (7*0x0001u)    /* DMA channel 2 transfer select 7:  TimerB (TB0CCR0.IFG) */
1251
#define DMA2TSEL__TB0CCR2      (8*0x0001u)    /* DMA channel 2 transfer select 8:  TimerB (TB0CCR2.IFG) */
1252
#define DMA2TSEL__RES9         (9*0x0001u)    /* DMA channel 2 transfer select 9:  Reserved */
1253
#define DMA2TSEL__RES10        (10*0x0001u)   /* DMA channel 2 transfer select 10: Reserved */
1254
#define DMA2TSEL__RES11        (11*0x0001u)   /* DMA channel 2 transfer select 11: Reserved */
1255
#define DMA2TSEL__RES12        (12*0x0001u)   /* DMA channel 2 transfer select 12: Reserved */
1256
#define DMA2TSEL__RES13        (13*0x0001u)   /* DMA channel 2 transfer select 13: Reserved */
1257
#define DMA2TSEL__RES14        (14*0x0001u)   /* DMA channel 2 transfer select 14: Reserved */
1258
#define DMA2TSEL__RES15        (15*0x0001u)   /* DMA channel 2 transfer select 15: Reserved */
1259
#define DMA2TSEL__USCIA0RX     (16*0x0001u)   /* DMA channel 2 transfer select 16: USCIA0 receive */
1260
#define DMA2TSEL__USCIA0TX     (17*0x0001u)   /* DMA channel 2 transfer select 17: USCIA0 transmit */
1261
#define DMA2TSEL__USCIB0RX     (18*0x0001u)   /* DMA channel 2 transfer select 18: USCIB0 receive */
1262
#define DMA2TSEL__USCIB0TX     (19*0x0001u)   /* DMA channel 2 transfer select 19: USCIB0 transmit */
1263
#define DMA2TSEL__USCIA1RX     (20*0x0001u)   /* DMA channel 2 transfer select 20: USCIA1 receive */
1264
#define DMA2TSEL__USCIA1TX     (21*0x0001u)   /* DMA channel 2 transfer select 21: USCIA1 transmit */
1265
#define DMA2TSEL__USCIB1RX     (22*0x0001u)   /* DMA channel 2 transfer select 22: USCIB1 receive */
1266
#define DMA2TSEL__USCIB1TX     (23*0x0001u)   /* DMA channel 2 transfer select 23: USCIB1 transmit */
1267
#define DMA2TSEL__ADC12IFG     (24*0x0001u)   /* DMA channel 2 transfer select 24: ADC12IFGx */
1268
#define DMA2TSEL__RES25        (25*0x0001u)   /* DMA channel 2 transfer select 25: Reserved */
1269
#define DMA2TSEL__RES26        (26*0x0001u)   /* DMA channel 2 transfer select 26: Reserved */
1270
#define DMA2TSEL__USB_FNRXD    (27*0x0001u)   /* DMA channel 2 transfer select 27: USB FNRXD */
1271
#define DMA2TSEL__USB_READY    (28*0x0001u)   /* DMA channel 2 transfer select 28: USB ready */
1272
#define DMA2TSEL__MPY          (29*0x0001u)   /* DMA channel 2 transfer select 29: Multiplier ready */
1273
#define DMA2TSEL__DMA1IFG      (30*0x0001u)   /* DMA channel 2 transfer select 30: previous DMA channel DMA1IFG */
1274
#define DMA2TSEL__DMAE0        (31*0x0001u)   /* DMA channel 2 transfer select 31: ext. Trigger (DMAE0) */
1275
 
1276
/*************************************************************
1277
* Flash Memory
1278
*************************************************************/
1279
#define __MSP430_HAS_FLASH__                  /* Definition to show that Module is available */
1280
#define __MSP430_BASEADDRESS_FLASH__ 0x0140
1281
 
1282
SFR_16BIT(FCTL1);                             /* FLASH Control 1 */
1283
SFR_8BIT(FCTL1_L);                            /* FLASH Control 1 */
1284
SFR_8BIT(FCTL1_H);                            /* FLASH Control 1 */
1285
//sfrbw    FCTL2               (0x0142)  /* FLASH Control 2 */
1286
SFR_16BIT(FCTL3);                             /* FLASH Control 3 */
1287
SFR_8BIT(FCTL3_L);                            /* FLASH Control 3 */
1288
SFR_8BIT(FCTL3_H);                            /* FLASH Control 3 */
1289
SFR_16BIT(FCTL4);                             /* FLASH Control 4 */
1290
SFR_8BIT(FCTL4_L);                            /* FLASH Control 4 */
1291
SFR_8BIT(FCTL4_H);                            /* FLASH Control 4 */
1292
 
1293
#define FRPW                   (0x9600)       /* Flash password returned by read */
1294
#define FWPW                   (0xA500)       /* Flash password for write */
1295
#define FXPW                   (0x3300)       /* for use with XOR instruction */
1296
#define FRKEY                  (0x9600)       /* (legacy definition) Flash key returned by read */
1297
#define FWKEY                  (0xA500)       /* (legacy definition) Flash key for write */
1298
#define FXKEY                  (0x3300)       /* (legacy definition) for use with XOR instruction */
1299
 
1300
/* FCTL1 Control Bits */
1301
//#define RESERVED            (0x0001)  /* Reserved */
1302
#define ERASE                  (0x0002)       /* Enable bit for Flash segment erase */
1303
#define MERAS                  (0x0004)       /* Enable bit for Flash mass erase */
1304
//#define RESERVED            (0x0008)  /* Reserved */
1305
//#define RESERVED            (0x0010)  /* Reserved */
1306
#define SWRT                   (0x0020)       /* Smart Write enable */
1307
#define WRT                    (0x0040)       /* Enable bit for Flash write */
1308
#define BLKWRT                 (0x0080)       /* Enable bit for Flash segment write */
1309
 
1310
/* FCTL1 Control Bits */
1311
//#define RESERVED            (0x0001)  /* Reserved */
1312
#define ERASE_L                (0x0002)       /* Enable bit for Flash segment erase */
1313
#define MERAS_L                (0x0004)       /* Enable bit for Flash mass erase */
1314
//#define RESERVED            (0x0008)  /* Reserved */
1315
//#define RESERVED            (0x0010)  /* Reserved */
1316
#define SWRT_L                 (0x0020)       /* Smart Write enable */
1317
#define WRT_L                  (0x0040)       /* Enable bit for Flash write */
1318
#define BLKWRT_L               (0x0080)       /* Enable bit for Flash segment write */
1319
 
1320
/* FCTL1 Control Bits */
1321
//#define RESERVED            (0x0001)  /* Reserved */
1322
//#define RESERVED            (0x0008)  /* Reserved */
1323
//#define RESERVED            (0x0010)  /* Reserved */
1324
 
1325
/* FCTL3 Control Bits */
1326
#define BUSY                   (0x0001)       /* Flash busy: 1 */
1327
#define KEYV                   (0x0002)       /* Flash Key violation flag */
1328
#define ACCVIFG                (0x0004)       /* Flash Access violation flag */
1329
#define WAIT                   (0x0008)       /* Wait flag for segment write */
1330
#define LOCK                   (0x0010)       /* Lock bit: 1 - Flash is locked (read only) */
1331
#define EMEX                   (0x0020)       /* Flash Emergency Exit */
1332
#define LOCKA                  (0x0040)       /* Segment A Lock bit: read = 1 - Segment is locked (read only) */
1333
//#define RESERVED            (0x0080)  /* Reserved */
1334
 
1335
/* FCTL3 Control Bits */
1336
#define BUSY_L                 (0x0001)       /* Flash busy: 1 */
1337
#define KEYV_L                 (0x0002)       /* Flash Key violation flag */
1338
#define ACCVIFG_L              (0x0004)       /* Flash Access violation flag */
1339
#define WAIT_L                 (0x0008)       /* Wait flag for segment write */
1340
#define LOCK_L                 (0x0010)       /* Lock bit: 1 - Flash is locked (read only) */
1341
#define EMEX_L                 (0x0020)       /* Flash Emergency Exit */
1342
#define LOCKA_L                (0x0040)       /* Segment A Lock bit: read = 1 - Segment is locked (read only) */
1343
//#define RESERVED            (0x0080)  /* Reserved */
1344
 
1345
/* FCTL3 Control Bits */
1346
//#define RESERVED            (0x0080)  /* Reserved */
1347
 
1348
/* FCTL4 Control Bits */
1349
#define VPE                    (0x0001)       /* Voltage Changed during Program Error Flag */
1350
#define MGR0                   (0x0010)       /* Marginal read 0 mode. */
1351
#define MGR1                   (0x0020)       /* Marginal read 1 mode. */
1352
#define LOCKINFO               (0x0080)       /* Lock INFO Memory bit: read = 1 - Segment is locked (read only) */
1353
 
1354
/* FCTL4 Control Bits */
1355
#define VPE_L                  (0x0001)       /* Voltage Changed during Program Error Flag */
1356
#define MGR0_L                 (0x0010)       /* Marginal read 0 mode. */
1357
#define MGR1_L                 (0x0020)       /* Marginal read 1 mode. */
1358
#define LOCKINFO_L             (0x0080)       /* Lock INFO Memory bit: read = 1 - Segment is locked (read only) */
1359
 
1360
/* FCTL4 Control Bits */
1361
 
1362
/************************************************************
1363
* HARDWARE MULTIPLIER 32Bit
1364
************************************************************/
1365
#define __MSP430_HAS_MPY32__                  /* Definition to show that Module is available */
1366
#define __MSP430_BASEADDRESS_MPY32__ 0x04C0
1367
 
1368
SFR_16BIT(MPY);                               /* Multiply Unsigned/Operand 1 */
1369
SFR_8BIT(MPY_L);                              /* Multiply Unsigned/Operand 1 */
1370
SFR_8BIT(MPY_H);                              /* Multiply Unsigned/Operand 1 */
1371
SFR_16BIT(MPYS);                              /* Multiply Signed/Operand 1 */
1372
SFR_8BIT(MPYS_L);                             /* Multiply Signed/Operand 1 */
1373
SFR_8BIT(MPYS_H);                             /* Multiply Signed/Operand 1 */
1374
SFR_16BIT(MAC);                               /* Multiply Unsigned and Accumulate/Operand 1 */
1375
SFR_8BIT(MAC_L);                              /* Multiply Unsigned and Accumulate/Operand 1 */
1376
SFR_8BIT(MAC_H);                              /* Multiply Unsigned and Accumulate/Operand 1 */
1377
SFR_16BIT(MACS);                              /* Multiply Signed and Accumulate/Operand 1 */
1378
SFR_8BIT(MACS_L);                             /* Multiply Signed and Accumulate/Operand 1 */
1379
SFR_8BIT(MACS_H);                             /* Multiply Signed and Accumulate/Operand 1 */
1380
SFR_16BIT(OP2);                               /* Operand 2 */
1381
SFR_8BIT(OP2_L);                              /* Operand 2 */
1382
SFR_8BIT(OP2_H);                              /* Operand 2 */
1383
SFR_16BIT(RESLO);                             /* Result Low Word */
1384
SFR_8BIT(RESLO_L);                            /* Result Low Word */
1385
SFR_8BIT(RESLO_H);                            /* Result Low Word */
1386
SFR_16BIT(RESHI);                             /* Result High Word */
1387
SFR_8BIT(RESHI_L);                            /* Result High Word */
1388
SFR_8BIT(RESHI_H);                            /* Result High Word */
1389
SFR_16BIT(SUMEXT);                            /* Sum Extend */
1390
SFR_8BIT(SUMEXT_L);                           /* Sum Extend */
1391
SFR_8BIT(SUMEXT_H);                           /* Sum Extend */
1392
 
1393
SFR_16BIT(MPY32L);                            /* 32-bit operand 1 - multiply - low word */
1394
SFR_8BIT(MPY32L_L);                           /* 32-bit operand 1 - multiply - low word */
1395
SFR_8BIT(MPY32L_H);                           /* 32-bit operand 1 - multiply - low word */
1396
SFR_16BIT(MPY32H);                            /* 32-bit operand 1 - multiply - high word */
1397
SFR_8BIT(MPY32H_L);                           /* 32-bit operand 1 - multiply - high word */
1398
SFR_8BIT(MPY32H_H);                           /* 32-bit operand 1 - multiply - high word */
1399
SFR_16BIT(MPYS32L);                           /* 32-bit operand 1 - signed multiply - low word */
1400
SFR_8BIT(MPYS32L_L);                          /* 32-bit operand 1 - signed multiply - low word */
1401
SFR_8BIT(MPYS32L_H);                          /* 32-bit operand 1 - signed multiply - low word */
1402
SFR_16BIT(MPYS32H);                           /* 32-bit operand 1 - signed multiply - high word */
1403
SFR_8BIT(MPYS32H_L);                          /* 32-bit operand 1 - signed multiply - high word */
1404
SFR_8BIT(MPYS32H_H);                          /* 32-bit operand 1 - signed multiply - high word */
1405
SFR_16BIT(MAC32L);                            /* 32-bit operand 1 - multiply accumulate - low word */
1406
SFR_8BIT(MAC32L_L);                           /* 32-bit operand 1 - multiply accumulate - low word */
1407
SFR_8BIT(MAC32L_H);                           /* 32-bit operand 1 - multiply accumulate - low word */
1408
SFR_16BIT(MAC32H);                            /* 32-bit operand 1 - multiply accumulate - high word */
1409
SFR_8BIT(MAC32H_L);                           /* 32-bit operand 1 - multiply accumulate - high word */
1410
SFR_8BIT(MAC32H_H);                           /* 32-bit operand 1 - multiply accumulate - high word */
1411
SFR_16BIT(MACS32L);                           /* 32-bit operand 1 - signed multiply accumulate - low word */
1412
SFR_8BIT(MACS32L_L);                          /* 32-bit operand 1 - signed multiply accumulate - low word */
1413
SFR_8BIT(MACS32L_H);                          /* 32-bit operand 1 - signed multiply accumulate - low word */
1414
SFR_16BIT(MACS32H);                           /* 32-bit operand 1 - signed multiply accumulate - high word */
1415
SFR_8BIT(MACS32H_L);                          /* 32-bit operand 1 - signed multiply accumulate - high word */
1416
SFR_8BIT(MACS32H_H);                          /* 32-bit operand 1 - signed multiply accumulate - high word */
1417
SFR_16BIT(OP2L);                              /* 32-bit operand 2 - low word */
1418
SFR_8BIT(OP2L_L);                             /* 32-bit operand 2 - low word */
1419
SFR_8BIT(OP2L_H);                             /* 32-bit operand 2 - low word */
1420
SFR_16BIT(OP2H);                              /* 32-bit operand 2 - high word */
1421
SFR_8BIT(OP2H_L);                             /* 32-bit operand 2 - high word */
1422
SFR_8BIT(OP2H_H);                             /* 32-bit operand 2 - high word */
1423
SFR_16BIT(RES0);                              /* 32x32-bit result 0 - least significant word */
1424
SFR_8BIT(RES0_L);                             /* 32x32-bit result 0 - least significant word */
1425
SFR_8BIT(RES0_H);                             /* 32x32-bit result 0 - least significant word */
1426
SFR_16BIT(RES1);                              /* 32x32-bit result 1 */
1427
SFR_8BIT(RES1_L);                             /* 32x32-bit result 1 */
1428
SFR_8BIT(RES1_H);                             /* 32x32-bit result 1 */
1429
SFR_16BIT(RES2);                              /* 32x32-bit result 2 */
1430
SFR_8BIT(RES2_L);                             /* 32x32-bit result 2 */
1431
SFR_8BIT(RES2_H);                             /* 32x32-bit result 2 */
1432
SFR_16BIT(RES3);                              /* 32x32-bit result 3 - most significant word */
1433
SFR_8BIT(RES3_L);                             /* 32x32-bit result 3 - most significant word */
1434
SFR_8BIT(RES3_H);                             /* 32x32-bit result 3 - most significant word */
1435
SFR_16BIT(MPY32CTL0);                         /* MPY32 Control Register 0 */
1436
SFR_8BIT(MPY32CTL0_L);                        /* MPY32 Control Register 0 */
1437
SFR_8BIT(MPY32CTL0_H);                        /* MPY32 Control Register 0 */
1438
 
1439
#define MPY_B                  MPY_L          /* Multiply Unsigned/Operand 1 (Byte Access) */
1440
#define MPYS_B                 MPYS_L         /* Multiply Signed/Operand 1 (Byte Access) */
1441
#define MAC_B                  MAC_L          /* Multiply Unsigned and Accumulate/Operand 1 (Byte Access) */
1442
#define MACS_B                 MACS_L         /* Multiply Signed and Accumulate/Operand 1 (Byte Access) */
1443
#define OP2_B                  OP2_L          /* Operand 2 (Byte Access) */
1444
#define MPY32L_B               MPY32L_L       /* 32-bit operand 1 - multiply - low word (Byte Access) */
1445
#define MPY32H_B               MPY32H_L       /* 32-bit operand 1 - multiply - high word (Byte Access) */
1446
#define MPYS32L_B              MPYS32L_L      /* 32-bit operand 1 - signed multiply - low word (Byte Access) */
1447
#define MPYS32H_B              MPYS32H_L      /* 32-bit operand 1 - signed multiply - high word (Byte Access) */
1448
#define MAC32L_B               MAC32L_L       /* 32-bit operand 1 - multiply accumulate - low word (Byte Access) */
1449
#define MAC32H_B               MAC32H_L       /* 32-bit operand 1 - multiply accumulate - high word (Byte Access) */
1450
#define MACS32L_B              MACS32L_L      /* 32-bit operand 1 - signed multiply accumulate - low word (Byte Access) */
1451
#define MACS32H_B              MACS32H_L      /* 32-bit operand 1 - signed multiply accumulate - high word (Byte Access) */
1452
#define OP2L_B                 OP2L_L         /* 32-bit operand 2 - low word (Byte Access) */
1453
#define OP2H_B                 OP2H_L         /* 32-bit operand 2 - high word (Byte Access) */
1454
 
1455
/* MPY32CTL0 Control Bits */
1456
#define MPYC                   (0x0001)       /* Carry of the multiplier */
1457
//#define RESERVED            (0x0002)  /* Reserved */
1458
#define MPYFRAC                (0x0004)       /* Fractional mode */
1459
#define MPYSAT                 (0x0008)       /* Saturation mode */
1460
#define MPYM0                  (0x0010)       /* Multiplier mode Bit:0 */
1461
#define MPYM1                  (0x0020)       /* Multiplier mode Bit:1 */
1462
#define OP1_32                 (0x0040)       /* Bit-width of operand 1 0:16Bit / 1:32Bit */
1463
#define OP2_32                 (0x0080)       /* Bit-width of operand 2 0:16Bit / 1:32Bit */
1464
#define MPYDLYWRTEN            (0x0100)       /* Delayed write enable */
1465
#define MPYDLY32               (0x0200)       /* Delayed write mode */
1466
 
1467
/* MPY32CTL0 Control Bits */
1468
#define MPYC_L                 (0x0001)       /* Carry of the multiplier */
1469
//#define RESERVED            (0x0002)  /* Reserved */
1470
#define MPYFRAC_L              (0x0004)       /* Fractional mode */
1471
#define MPYSAT_L               (0x0008)       /* Saturation mode */
1472
#define MPYM0_L                (0x0010)       /* Multiplier mode Bit:0 */
1473
#define MPYM1_L                (0x0020)       /* Multiplier mode Bit:1 */
1474
#define OP1_32_L               (0x0040)       /* Bit-width of operand 1 0:16Bit / 1:32Bit */
1475
#define OP2_32_L               (0x0080)       /* Bit-width of operand 2 0:16Bit / 1:32Bit */
1476
 
1477
/* MPY32CTL0 Control Bits */
1478
//#define RESERVED            (0x0002)  /* Reserved */
1479
#define MPYDLYWRTEN_H          (0x0001)       /* Delayed write enable */
1480
#define MPYDLY32_H             (0x0002)       /* Delayed write mode */
1481
 
1482
#define MPYM_0                 (0x0000)       /* Multiplier mode: MPY */
1483
#define MPYM_1                 (0x0010)       /* Multiplier mode: MPYS */
1484
#define MPYM_2                 (0x0020)       /* Multiplier mode: MAC */
1485
#define MPYM_3                 (0x0030)       /* Multiplier mode: MACS */
1486
#define MPYM__MPY              (0x0000)       /* Multiplier mode: MPY */
1487
#define MPYM__MPYS             (0x0010)       /* Multiplier mode: MPYS */
1488
#define MPYM__MAC              (0x0020)       /* Multiplier mode: MAC */
1489
#define MPYM__MACS             (0x0030)       /* Multiplier mode: MACS */
1490
 
1491
/************************************************************
1492
* DIGITAL I/O Port1/2 Pull up / Pull down Resistors
1493
************************************************************/
1494
#define __MSP430_HAS_PORT1_R__                /* Definition to show that Module is available */
1495
#define __MSP430_BASEADDRESS_PORT1_R__ 0x0200
1496
#define __MSP430_HAS_PORT2_R__                /* Definition to show that Module is available */
1497
#define __MSP430_BASEADDRESS_PORT2_R__ 0x0200
1498
#define __MSP430_HAS_PORTA_R__                /* Definition to show that Module is available */
1499
#define __MSP430_BASEADDRESS_PORTA_R__ 0x0200
1500
 
1501
SFR_16BIT(PAIN);                              /* Port A Input */
1502
SFR_8BIT(PAIN_L);                             /* Port A Input */
1503
SFR_8BIT(PAIN_H);                             /* Port A Input */
1504
SFR_16BIT(PAOUT);                             /* Port A Output */
1505
SFR_8BIT(PAOUT_L);                            /* Port A Output */
1506
SFR_8BIT(PAOUT_H);                            /* Port A Output */
1507
SFR_16BIT(PADIR);                             /* Port A Direction */
1508
SFR_8BIT(PADIR_L);                            /* Port A Direction */
1509
SFR_8BIT(PADIR_H);                            /* Port A Direction */
1510
SFR_16BIT(PAREN);                             /* Port A Resistor Enable */
1511
SFR_8BIT(PAREN_L);                            /* Port A Resistor Enable */
1512
SFR_8BIT(PAREN_H);                            /* Port A Resistor Enable */
1513
SFR_16BIT(PADS);                              /* Port A Resistor Drive Strenght */
1514
SFR_8BIT(PADS_L);                             /* Port A Resistor Drive Strenght */
1515
SFR_8BIT(PADS_H);                             /* Port A Resistor Drive Strenght */
1516
SFR_16BIT(PASEL);                             /* Port A Selection */
1517
SFR_8BIT(PASEL_L);                            /* Port A Selection */
1518
SFR_8BIT(PASEL_H);                            /* Port A Selection */
1519
SFR_16BIT(PAIES);                             /* Port A Interrupt Edge Select */
1520
SFR_8BIT(PAIES_L);                            /* Port A Interrupt Edge Select */
1521
SFR_8BIT(PAIES_H);                            /* Port A Interrupt Edge Select */
1522
SFR_16BIT(PAIE);                              /* Port A Interrupt Enable */
1523
SFR_8BIT(PAIE_L);                             /* Port A Interrupt Enable */
1524
SFR_8BIT(PAIE_H);                             /* Port A Interrupt Enable */
1525
SFR_16BIT(PAIFG);                             /* Port A Interrupt Flag */
1526
SFR_8BIT(PAIFG_L);                            /* Port A Interrupt Flag */
1527
SFR_8BIT(PAIFG_H);                            /* Port A Interrupt Flag */
1528
 
1529
 
1530
SFR_16BIT(P1IV);                              /* Port 1 Interrupt Vector Word */
1531
SFR_16BIT(P2IV);                              /* Port 2 Interrupt Vector Word */
1532
#define P1IN                   (PAIN_L)       /* Port 1 Input */
1533
#define P1OUT                  (PAOUT_L)      /* Port 1 Output */
1534
#define P1DIR                  (PADIR_L)      /* Port 1 Direction */
1535
#define P1REN                  (PAREN_L)      /* Port 1 Resistor Enable */
1536
#define P1DS                   (PADS_L)       /* Port 1 Resistor Drive Strenght */
1537
#define P1SEL                  (PASEL_L)      /* Port 1 Selection */
1538
#define P1IES                  (PAIES_L)      /* Port 1 Interrupt Edge Select */
1539
#define P1IE                   (PAIE_L)       /* Port 1 Interrupt Enable */
1540
#define P1IFG                  (PAIFG_L)      /* Port 1 Interrupt Flag */
1541
 
1542
//Definitions for P1IV
1543
#define P1IV_NONE              (0x0000)       /* No Interrupt pending */
1544
#define P1IV_P1IFG0            (0x0002)       /* P1IV P1IFG.0 */
1545
#define P1IV_P1IFG1            (0x0004)       /* P1IV P1IFG.1 */
1546
#define P1IV_P1IFG2            (0x0006)       /* P1IV P1IFG.2 */
1547
#define P1IV_P1IFG3            (0x0008)       /* P1IV P1IFG.3 */
1548
#define P1IV_P1IFG4            (0x000A)       /* P1IV P1IFG.4 */
1549
#define P1IV_P1IFG5            (0x000C)       /* P1IV P1IFG.5 */
1550
#define P1IV_P1IFG6            (0x000E)       /* P1IV P1IFG.6 */
1551
#define P1IV_P1IFG7            (0x0010)       /* P1IV P1IFG.7 */
1552
 
1553
#define P2IN                   (PAIN_H)       /* Port 2 Input */
1554
#define P2OUT                  (PAOUT_H)      /* Port 2 Output */
1555
#define P2DIR                  (PADIR_H)      /* Port 2 Direction */
1556
#define P2REN                  (PAREN_H)      /* Port 2 Resistor Enable */
1557
#define P2DS                   (PADS_H)       /* Port 2 Resistor Drive Strenght */
1558
#define P2SEL                  (PASEL_H)      /* Port 2 Selection */
1559
#define P2IES                  (PAIES_H)      /* Port 2 Interrupt Edge Select */
1560
#define P2IE                   (PAIE_H)       /* Port 2 Interrupt Enable */
1561
#define P2IFG                  (PAIFG_H)      /* Port 2 Interrupt Flag */
1562
 
1563
//Definitions for P2IV
1564
#define P2IV_NONE              (0x0000)       /* No Interrupt pending */
1565
#define P2IV_P2IFG0            (0x0002)       /* P2IV P2IFG.0 */
1566
#define P2IV_P2IFG1            (0x0004)       /* P2IV P2IFG.1 */
1567
#define P2IV_P2IFG2            (0x0006)       /* P2IV P2IFG.2 */
1568
#define P2IV_P2IFG3            (0x0008)       /* P2IV P2IFG.3 */
1569
#define P2IV_P2IFG4            (0x000A)       /* P2IV P2IFG.4 */
1570
#define P2IV_P2IFG5            (0x000C)       /* P2IV P2IFG.5 */
1571
#define P2IV_P2IFG6            (0x000E)       /* P2IV P2IFG.6 */
1572
#define P2IV_P2IFG7            (0x0010)       /* P2IV P2IFG.7 */
1573
 
1574
 
1575
/************************************************************
1576
* DIGITAL I/O Port3/4 Pull up / Pull down Resistors
1577
************************************************************/
1578
#define __MSP430_HAS_PORT3_R__                /* Definition to show that Module is available */
1579
#define __MSP430_BASEADDRESS_PORT3_R__ 0x0220
1580
#define __MSP430_HAS_PORT4_R__                /* Definition to show that Module is available */
1581
#define __MSP430_BASEADDRESS_PORT4_R__ 0x0220
1582
#define __MSP430_HAS_PORTB_R__                /* Definition to show that Module is available */
1583
#define __MSP430_BASEADDRESS_PORTB_R__ 0x0220
1584
 
1585
SFR_16BIT(PBIN);                              /* Port B Input */
1586
SFR_8BIT(PBIN_L);                             /* Port B Input */
1587
SFR_8BIT(PBIN_H);                             /* Port B Input */
1588
SFR_16BIT(PBOUT);                             /* Port B Output */
1589
SFR_8BIT(PBOUT_L);                            /* Port B Output */
1590
SFR_8BIT(PBOUT_H);                            /* Port B Output */
1591
SFR_16BIT(PBDIR);                             /* Port B Direction */
1592
SFR_8BIT(PBDIR_L);                            /* Port B Direction */
1593
SFR_8BIT(PBDIR_H);                            /* Port B Direction */
1594
SFR_16BIT(PBREN);                             /* Port B Resistor Enable */
1595
SFR_8BIT(PBREN_L);                            /* Port B Resistor Enable */
1596
SFR_8BIT(PBREN_H);                            /* Port B Resistor Enable */
1597
SFR_16BIT(PBDS);                              /* Port B Resistor Drive Strenght */
1598
SFR_8BIT(PBDS_L);                             /* Port B Resistor Drive Strenght */
1599
SFR_8BIT(PBDS_H);                             /* Port B Resistor Drive Strenght */
1600
SFR_16BIT(PBSEL);                             /* Port B Selection */
1601
SFR_8BIT(PBSEL_L);                            /* Port B Selection */
1602
SFR_8BIT(PBSEL_H);                            /* Port B Selection */
1603
 
1604
 
1605
#define P3IN                   (PBIN_L)       /* Port 3 Input */
1606
#define P3OUT                  (PBOUT_L)      /* Port 3 Output */
1607
#define P3DIR                  (PBDIR_L)      /* Port 3 Direction */
1608
#define P3REN                  (PBREN_L)      /* Port 3 Resistor Enable */
1609
#define P3DS                   (PBDS_L)       /* Port 3 Resistor Drive Strenght */
1610
#define P3SEL                  (PBSEL_L)      /* Port 3 Selection */
1611
 
1612
#define P4IN                   (PBIN_H)       /* Port 4 Input */
1613
#define P4OUT                  (PBOUT_H)      /* Port 4 Output */
1614
#define P4DIR                  (PBDIR_H)      /* Port 4 Direction */
1615
#define P4REN                  (PBREN_H)      /* Port 4 Resistor Enable */
1616
#define P4DS                   (PBDS_H)       /* Port 4 Resistor Drive Strenght */
1617
#define P4SEL                  (PBSEL_H)      /* Port 4 Selection */
1618
 
1619
 
1620
/************************************************************
1621
* DIGITAL I/O Port5/6 Pull up / Pull down Resistors
1622
************************************************************/
1623
#define __MSP430_HAS_PORT5_R__                /* Definition to show that Module is available */
1624
#define __MSP430_BASEADDRESS_PORT5_R__ 0x0240
1625
#define __MSP430_HAS_PORT6_R__                /* Definition to show that Module is available */
1626
#define __MSP430_BASEADDRESS_PORT6_R__ 0x0240
1627
#define __MSP430_HAS_PORTC_R__                /* Definition to show that Module is available */
1628
#define __MSP430_BASEADDRESS_PORTC_R__ 0x0240
1629
 
1630
SFR_16BIT(PCIN);                              /* Port C Input */
1631
SFR_8BIT(PCIN_L);                             /* Port C Input */
1632
SFR_8BIT(PCIN_H);                             /* Port C Input */
1633
SFR_16BIT(PCOUT);                             /* Port C Output */
1634
SFR_8BIT(PCOUT_L);                            /* Port C Output */
1635
SFR_8BIT(PCOUT_H);                            /* Port C Output */
1636
SFR_16BIT(PCDIR);                             /* Port C Direction */
1637
SFR_8BIT(PCDIR_L);                            /* Port C Direction */
1638
SFR_8BIT(PCDIR_H);                            /* Port C Direction */
1639
SFR_16BIT(PCREN);                             /* Port C Resistor Enable */
1640
SFR_8BIT(PCREN_L);                            /* Port C Resistor Enable */
1641
SFR_8BIT(PCREN_H);                            /* Port C Resistor Enable */
1642
SFR_16BIT(PCDS);                              /* Port C Resistor Drive Strenght */
1643
SFR_8BIT(PCDS_L);                             /* Port C Resistor Drive Strenght */
1644
SFR_8BIT(PCDS_H);                             /* Port C Resistor Drive Strenght */
1645
SFR_16BIT(PCSEL);                             /* Port C Selection */
1646
SFR_8BIT(PCSEL_L);                            /* Port C Selection */
1647
SFR_8BIT(PCSEL_H);                            /* Port C Selection */
1648
 
1649
 
1650
#define P5IN                   (PCIN_L)       /* Port 5 Input */
1651
#define P5OUT                  (PCOUT_L)      /* Port 5 Output */
1652
#define P5DIR                  (PCDIR_L)      /* Port 5 Direction */
1653
#define P5REN                  (PCREN_L)      /* Port 5 Resistor Enable */
1654
#define P5DS                   (PCDS_L)       /* Port 5 Resistor Drive Strenght */
1655
#define P5SEL                  (PCSEL_L)      /* Port 5 Selection */
1656
 
1657
#define P6IN                   (PCIN_H)       /* Port 6 Input */
1658
#define P6OUT                  (PCOUT_H)      /* Port 6 Output */
1659
#define P6DIR                  (PCDIR_H)      /* Port 6 Direction */
1660
#define P6REN                  (PCREN_H)      /* Port 6 Resistor Enable */
1661
#define P6DS                   (PCDS_H)       /* Port 6 Resistor Drive Strenght */
1662
#define P6SEL                  (PCSEL_H)      /* Port 6 Selection */
1663
 
1664
 
1665
/************************************************************
1666
* DIGITAL I/O Port7/8 Pull up / Pull down Resistors
1667
************************************************************/
1668
#define __MSP430_HAS_PORT7_R__                /* Definition to show that Module is available */
1669
#define __MSP430_BASEADDRESS_PORT7_R__ 0x0260
1670
#define __MSP430_HAS_PORT8_R__                /* Definition to show that Module is available */
1671
#define __MSP430_BASEADDRESS_PORT8_R__ 0x0260
1672
#define __MSP430_HAS_PORTD_R__                /* Definition to show that Module is available */
1673
#define __MSP430_BASEADDRESS_PORTD_R__ 0x0260
1674
 
1675
SFR_16BIT(PDIN);                              /* Port D Input */
1676
SFR_8BIT(PDIN_L);                             /* Port D Input */
1677
SFR_8BIT(PDIN_H);                             /* Port D Input */
1678
SFR_16BIT(PDOUT);                             /* Port D Output */
1679
SFR_8BIT(PDOUT_L);                            /* Port D Output */
1680
SFR_8BIT(PDOUT_H);                            /* Port D Output */
1681
SFR_16BIT(PDDIR);                             /* Port D Direction */
1682
SFR_8BIT(PDDIR_L);                            /* Port D Direction */
1683
SFR_8BIT(PDDIR_H);                            /* Port D Direction */
1684
SFR_16BIT(PDREN);                             /* Port D Resistor Enable */
1685
SFR_8BIT(PDREN_L);                            /* Port D Resistor Enable */
1686
SFR_8BIT(PDREN_H);                            /* Port D Resistor Enable */
1687
SFR_16BIT(PDDS);                              /* Port D Resistor Drive Strenght */
1688
SFR_8BIT(PDDS_L);                             /* Port D Resistor Drive Strenght */
1689
SFR_8BIT(PDDS_H);                             /* Port D Resistor Drive Strenght */
1690
SFR_16BIT(PDSEL);                             /* Port D Selection */
1691
SFR_8BIT(PDSEL_L);                            /* Port D Selection */
1692
SFR_8BIT(PDSEL_H);                            /* Port D Selection */
1693
 
1694
 
1695
#define P7IN                   (PDIN_L)       /* Port 7 Input */
1696
#define P7OUT                  (PDOUT_L)      /* Port 7 Output */
1697
#define P7DIR                  (PDDIR_L)      /* Port 7 Direction */
1698
#define P7REN                  (PDREN_L)      /* Port 7 Resistor Enable */
1699
#define P7DS                   (PDDS_L)       /* Port 7 Resistor Drive Strenght */
1700
#define P7SEL                  (PDSEL_L)      /* Port 7 Selection */
1701
 
1702
#define P8IN                   (PDIN_H)       /* Port 8 Input */
1703
#define P8OUT                  (PDOUT_H)      /* Port 8 Output */
1704
#define P8DIR                  (PDDIR_H)      /* Port 8 Direction */
1705
#define P8REN                  (PDREN_H)      /* Port 8 Resistor Enable */
1706
#define P8DS                   (PDDS_H)       /* Port 8 Resistor Drive Strenght */
1707
#define P8SEL                  (PDSEL_H)      /* Port 8 Selection */
1708
 
1709
 
1710
/************************************************************
1711
* DIGITAL I/O PortJ Pull up / Pull down Resistors
1712
************************************************************/
1713
#define __MSP430_HAS_PORTJ_R__                /* Definition to show that Module is available */
1714
#define __MSP430_BASEADDRESS_PORTJ_R__ 0x0320
1715
 
1716
SFR_16BIT(PJIN);                              /* Port J Input */
1717
SFR_8BIT(PJIN_L);                             /* Port J Input */
1718
SFR_8BIT(PJIN_H);                             /* Port J Input */
1719
SFR_16BIT(PJOUT);                             /* Port J Output */
1720
SFR_8BIT(PJOUT_L);                            /* Port J Output */
1721
SFR_8BIT(PJOUT_H);                            /* Port J Output */
1722
SFR_16BIT(PJDIR);                             /* Port J Direction */
1723
SFR_8BIT(PJDIR_L);                            /* Port J Direction */
1724
SFR_8BIT(PJDIR_H);                            /* Port J Direction */
1725
SFR_16BIT(PJREN);                             /* Port J Resistor Enable */
1726
SFR_8BIT(PJREN_L);                            /* Port J Resistor Enable */
1727
SFR_8BIT(PJREN_H);                            /* Port J Resistor Enable */
1728
SFR_16BIT(PJDS);                              /* Port J Resistor Drive Strenght */
1729
SFR_8BIT(PJDS_L);                             /* Port J Resistor Drive Strenght */
1730
SFR_8BIT(PJDS_H);                             /* Port J Resistor Drive Strenght */
1731
 
1732
/************************************************************
1733
* PORT MAPPING CONTROLLER
1734
************************************************************/
1735
#define __MSP430_HAS_PORT_MAPPING__                /* Definition to show that Module is available */
1736
#define __MSP430_BASEADDRESS_PORT_MAPPING__ 0x01C0
1737
 
1738
SFR_16BIT(PMAPKEYID);                         /* Port Mapping Key register */
1739
SFR_8BIT(PMAPKEYID_L);                        /* Port Mapping Key register */
1740
SFR_8BIT(PMAPKEYID_H);                        /* Port Mapping Key register */
1741
SFR_16BIT(PMAPCTL);                           /* Port Mapping control register */
1742
SFR_8BIT(PMAPCTL_L);                          /* Port Mapping control register */
1743
SFR_8BIT(PMAPCTL_H);                          /* Port Mapping control register */
1744
 
1745
#define  PMAPKEY               (0x2D52)       /* Port Mapping Key */
1746
#define  PMAPPWD               PMAPKEYID      /* Legacy Definition: Mapping Key register */
1747
#define  PMAPPW                (0x2D52)       /* Legacy Definition: Port Mapping Password */
1748
 
1749
/* PMAPCTL Control Bits */
1750
#define PMAPLOCKED             (0x0001)       /* Port Mapping Lock bit. Read only */
1751
#define PMAPRECFG              (0x0002)       /* Port Mapping re-configuration control bit */
1752
 
1753
/* PMAPCTL Control Bits */
1754
#define PMAPLOCKED_L           (0x0001)       /* Port Mapping Lock bit. Read only */
1755
#define PMAPRECFG_L            (0x0002)       /* Port Mapping re-configuration control bit */
1756
 
1757
/* PMAPCTL Control Bits */
1758
 
1759
/************************************************************
1760
* PORT 4 MAPPING CONTROLLER
1761
************************************************************/
1762
#define __MSP430_HAS_PORT4_MAPPING__                /* Definition to show that Module is available */
1763
#define __MSP430_BASEADDRESS_PORT4_MAPPING__ 0x01E0
1764
 
1765
SFR_16BIT(P4MAP01);                           /* Port P4.0/1 mapping register */
1766
SFR_8BIT(P4MAP01_L);                          /* Port P4.0/1 mapping register */
1767
SFR_8BIT(P4MAP01_H);                          /* Port P4.0/1 mapping register */
1768
SFR_16BIT(P4MAP23);                           /* Port P4.2/3 mapping register */
1769
SFR_8BIT(P4MAP23_L);                          /* Port P4.2/3 mapping register */
1770
SFR_8BIT(P4MAP23_H);                          /* Port P4.2/3 mapping register */
1771
SFR_16BIT(P4MAP45);                           /* Port P4.4/5 mapping register */
1772
SFR_8BIT(P4MAP45_L);                          /* Port P4.4/5 mapping register */
1773
SFR_8BIT(P4MAP45_H);                          /* Port P4.4/5 mapping register */
1774
SFR_16BIT(P4MAP67);                           /* Port P4.6/7 mapping register */
1775
SFR_8BIT(P4MAP67_L);                          /* Port P4.6/7 mapping register */
1776
SFR_8BIT(P4MAP67_H);                          /* Port P4.6/7 mapping register */
1777
 
1778
#define  P4MAP0                P4MAP01_L      /* Port P4.0 mapping register */
1779
#define  P4MAP1                P4MAP01_H      /* Port P4.1 mapping register */
1780
#define  P4MAP2                P4MAP23_L      /* Port P4.2 mapping register */
1781
#define  P4MAP3                P4MAP23_H      /* Port P4.3 mapping register */
1782
#define  P4MAP4                P4MAP45_L      /* Port P4.4 mapping register */
1783
#define  P4MAP5                P4MAP45_H      /* Port P4.5 mapping register */
1784
#define  P4MAP6                P4MAP67_L      /* Port P4.6 mapping register */
1785
#define  P4MAP7                P4MAP67_H      /* Port P4.7 mapping register */
1786
 
1787
#define PM_NONE                0
1788
#define PM_CBOUT0              1
1789
#define PM_TB0CLK              1
1790
#define PM_ADC12CLK            2
1791
#define PM_DMAE0               2
1792
#define PM_SVMOUT              3
1793
#define PM_TB0OUTH             3
1794
#define PM_TB0CCR0A            4
1795
#define PM_TB0CCR1A            5
1796
#define PM_TB0CCR2A            6
1797
#define PM_TB0CCR3A            7
1798
#define PM_TB0CCR4A            8
1799
#define PM_TB0CCR5A            9
1800
#define PM_TB0CCR6A            10
1801
#define PM_UCA1RXD             11
1802
#define PM_UCA1SOMI            11
1803
#define PM_UCA1TXD             12
1804
#define PM_UCA1SIMO            12
1805
#define PM_UCA1CLK             13
1806
#define PM_UCB1STE             13
1807
#define PM_UCB1SOMI            14
1808
#define PM_UCB1SCL             14
1809
#define PM_UCB1SIMO            15
1810
#define PM_UCB1SDA             15
1811
#define PM_UCB1CLK             16
1812
#define PM_UCA1STE             16
1813
#define PM_CBOUT1              17
1814
#define PM_MCLK                18
1815
#define PM_ANALOG              31
1816
 
1817
/************************************************************
1818
* PMM - Power Management System
1819
************************************************************/
1820
#define __MSP430_HAS_PMM__                    /* Definition to show that Module is available */
1821
#define __MSP430_BASEADDRESS_PMM__ 0x0120
1822
 
1823
SFR_16BIT(PMMCTL0);                           /* PMM Control 0 */
1824
SFR_8BIT(PMMCTL0_L);                          /* PMM Control 0 */
1825
SFR_8BIT(PMMCTL0_H);                          /* PMM Control 0 */
1826
SFR_16BIT(PMMCTL1);                           /* PMM Control 1 */
1827
SFR_8BIT(PMMCTL1_L);                          /* PMM Control 1 */
1828
SFR_8BIT(PMMCTL1_H);                          /* PMM Control 1 */
1829
SFR_16BIT(SVSMHCTL);                          /* SVS and SVM high side control register */
1830
SFR_8BIT(SVSMHCTL_L);                         /* SVS and SVM high side control register */
1831
SFR_8BIT(SVSMHCTL_H);                         /* SVS and SVM high side control register */
1832
SFR_16BIT(SVSMLCTL);                          /* SVS and SVM low side control register */
1833
SFR_8BIT(SVSMLCTL_L);                         /* SVS and SVM low side control register */
1834
SFR_8BIT(SVSMLCTL_H);                         /* SVS and SVM low side control register */
1835
SFR_16BIT(SVSMIO);                            /* SVSIN and SVSOUT control register */
1836
SFR_8BIT(SVSMIO_L);                           /* SVSIN and SVSOUT control register */
1837
SFR_8BIT(SVSMIO_H);                           /* SVSIN and SVSOUT control register */
1838
SFR_16BIT(PMMIFG);                            /* PMM Interrupt Flag */
1839
SFR_8BIT(PMMIFG_L);                           /* PMM Interrupt Flag */
1840
SFR_8BIT(PMMIFG_H);                           /* PMM Interrupt Flag */
1841
SFR_16BIT(PMMRIE);                            /* PMM and RESET Interrupt Enable */
1842
SFR_8BIT(PMMRIE_L);                           /* PMM and RESET Interrupt Enable */
1843
SFR_8BIT(PMMRIE_H);                           /* PMM and RESET Interrupt Enable */
1844
SFR_16BIT(PM5CTL0);                           /* PMM Power Mode 5 Control Register 0 */
1845
SFR_8BIT(PM5CTL0_L);                          /* PMM Power Mode 5 Control Register 0 */
1846
SFR_8BIT(PM5CTL0_H);                          /* PMM Power Mode 5 Control Register 0 */
1847
 
1848
#define PMMPW                  (0xA500)       /* PMM Register Write Password */
1849
#define PMMPW_H                (0xA5)         /* PMM Register Write Password for high word access */
1850
 
1851
/* PMMCTL0 Control Bits */
1852
#define PMMCOREV0              (0x0001)       /* PMM Core Voltage Bit: 0 */
1853
#define PMMCOREV1              (0x0002)       /* PMM Core Voltage Bit: 1 */
1854
#define PMMSWBOR               (0x0004)       /* PMM Software BOR */
1855
#define PMMSWPOR               (0x0008)       /* PMM Software POR */
1856
#define PMMREGOFF              (0x0010)       /* PMM Turn Regulator off */
1857
#define PMMHPMRE               (0x0080)       /* PMM Global High Power Module Request Enable */
1858
 
1859
/* PMMCTL0 Control Bits */
1860
#define PMMCOREV0_L            (0x0001)       /* PMM Core Voltage Bit: 0 */
1861
#define PMMCOREV1_L            (0x0002)       /* PMM Core Voltage Bit: 1 */
1862
#define PMMSWBOR_L             (0x0004)       /* PMM Software BOR */
1863
#define PMMSWPOR_L             (0x0008)       /* PMM Software POR */
1864
#define PMMREGOFF_L            (0x0010)       /* PMM Turn Regulator off */
1865
#define PMMHPMRE_L             (0x0080)       /* PMM Global High Power Module Request Enable */
1866
 
1867
/* PMMCTL0 Control Bits */
1868
 
1869
#define PMMCOREV_0             (0x0000)       /* PMM Core Voltage 0 (1.35V) */
1870
#define PMMCOREV_1             (0x0001)       /* PMM Core Voltage 1 (1.55V) */
1871
#define PMMCOREV_2             (0x0002)       /* PMM Core Voltage 2 (1.75V) */
1872
#define PMMCOREV_3             (0x0003)       /* PMM Core Voltage 3 (1.85V) */
1873
 
1874
/* PMMCTL1 Control Bits */
1875
#define PMMREFMD               (0x0001)       /* PMM Reference Mode */
1876
#define PMMCMD0                (0x0010)       /* PMM Voltage Regulator Current Mode Bit: 0 */
1877
#define PMMCMD1                (0x0020)       /* PMM Voltage Regulator Current Mode Bit: 1 */
1878
 
1879
/* PMMCTL1 Control Bits */
1880
#define PMMREFMD_L             (0x0001)       /* PMM Reference Mode */
1881
#define PMMCMD0_L              (0x0010)       /* PMM Voltage Regulator Current Mode Bit: 0 */
1882
#define PMMCMD1_L              (0x0020)       /* PMM Voltage Regulator Current Mode Bit: 1 */
1883
 
1884
/* PMMCTL1 Control Bits */
1885
 
1886
/* SVSMHCTL Control Bits */
1887
#define SVSMHRRL0              (0x0001)       /* SVS and SVM high side Reset Release Voltage Level Bit: 0 */
1888
#define SVSMHRRL1              (0x0002)       /* SVS and SVM high side Reset Release Voltage Level Bit: 1 */
1889
#define SVSMHRRL2              (0x0004)       /* SVS and SVM high side Reset Release Voltage Level Bit: 2 */
1890
#define SVSMHDLYST             (0x0008)       /* SVS and SVM high side delay status */
1891
#define SVSHMD                 (0x0010)       /* SVS high side mode */
1892
#define SVSMHEVM               (0x0040)       /* SVS and SVM high side event mask */
1893
#define SVSMHACE               (0x0080)       /* SVS and SVM high side auto control enable */
1894
#define SVSHRVL0               (0x0100)       /* SVS high side reset voltage level Bit: 0 */
1895
#define SVSHRVL1               (0x0200)       /* SVS high side reset voltage level Bit: 1 */
1896
#define SVSHE                  (0x0400)       /* SVS high side enable */
1897
#define SVSHFP                 (0x0800)       /* SVS high side full performace mode */
1898
#define SVMHOVPE               (0x1000)       /* SVM high side over-voltage enable */
1899
#define SVMHE                  (0x4000)       /* SVM high side enable */
1900
#define SVMHFP                 (0x8000)       /* SVM high side full performace mode */
1901
 
1902
/* SVSMHCTL Control Bits */
1903
#define SVSMHRRL0_L            (0x0001)       /* SVS and SVM high side Reset Release Voltage Level Bit: 0 */
1904
#define SVSMHRRL1_L            (0x0002)       /* SVS and SVM high side Reset Release Voltage Level Bit: 1 */
1905
#define SVSMHRRL2_L            (0x0004)       /* SVS and SVM high side Reset Release Voltage Level Bit: 2 */
1906
#define SVSMHDLYST_L           (0x0008)       /* SVS and SVM high side delay status */
1907
#define SVSHMD_L               (0x0010)       /* SVS high side mode */
1908
#define SVSMHEVM_L             (0x0040)       /* SVS and SVM high side event mask */
1909
#define SVSMHACE_L             (0x0080)       /* SVS and SVM high side auto control enable */
1910
 
1911
/* SVSMHCTL Control Bits */
1912
#define SVSHRVL0_H             (0x0001)       /* SVS high side reset voltage level Bit: 0 */
1913
#define SVSHRVL1_H             (0x0002)       /* SVS high side reset voltage level Bit: 1 */
1914
#define SVSHE_H                (0x0004)       /* SVS high side enable */
1915
#define SVSHFP_H               (0x0008)       /* SVS high side full performace mode */
1916
#define SVMHOVPE_H             (0x0010)       /* SVM high side over-voltage enable */
1917
#define SVMHE_H                (0x0040)       /* SVM high side enable */
1918
#define SVMHFP_H               (0x0080)       /* SVM high side full performace mode */
1919
 
1920
#define SVSMHRRL_0             (0x0000)       /* SVS and SVM high side Reset Release Voltage Level 0 */
1921
#define SVSMHRRL_1             (0x0001)       /* SVS and SVM high side Reset Release Voltage Level 1 */
1922
#define SVSMHRRL_2             (0x0002)       /* SVS and SVM high side Reset Release Voltage Level 2 */
1923
#define SVSMHRRL_3             (0x0003)       /* SVS and SVM high side Reset Release Voltage Level 3 */
1924
#define SVSMHRRL_4             (0x0004)       /* SVS and SVM high side Reset Release Voltage Level 4 */
1925
#define SVSMHRRL_5             (0x0005)       /* SVS and SVM high side Reset Release Voltage Level 5 */
1926
#define SVSMHRRL_6             (0x0006)       /* SVS and SVM high side Reset Release Voltage Level 6 */
1927
#define SVSMHRRL_7             (0x0007)       /* SVS and SVM high side Reset Release Voltage Level 7 */
1928
 
1929
#define SVSHRVL_0              (0x0000)       /* SVS high side Reset Release Voltage Level 0 */
1930
#define SVSHRVL_1              (0x0100)       /* SVS high side Reset Release Voltage Level 1 */
1931
#define SVSHRVL_2              (0x0200)       /* SVS high side Reset Release Voltage Level 2 */
1932
#define SVSHRVL_3              (0x0300)       /* SVS high side Reset Release Voltage Level 3 */
1933
 
1934
/* SVSMLCTL Control Bits */
1935
#define SVSMLRRL0              (0x0001)       /* SVS and SVM low side Reset Release Voltage Level Bit: 0 */
1936
#define SVSMLRRL1              (0x0002)       /* SVS and SVM low side Reset Release Voltage Level Bit: 1 */
1937
#define SVSMLRRL2              (0x0004)       /* SVS and SVM low side Reset Release Voltage Level Bit: 2 */
1938
#define SVSMLDLYST             (0x0008)       /* SVS and SVM low side delay status */
1939
#define SVSLMD                 (0x0010)       /* SVS low side mode */
1940
#define SVSMLEVM               (0x0040)       /* SVS and SVM low side event mask */
1941
#define SVSMLACE               (0x0080)       /* SVS and SVM low side auto control enable */
1942
#define SVSLRVL0               (0x0100)       /* SVS low side reset voltage level Bit: 0 */
1943
#define SVSLRVL1               (0x0200)       /* SVS low side reset voltage level Bit: 1 */
1944
#define SVSLE                  (0x0400)       /* SVS low side enable */
1945
#define SVSLFP                 (0x0800)       /* SVS low side full performace mode */
1946
#define SVMLOVPE               (0x1000)       /* SVM low side over-voltage enable */
1947
#define SVMLE                  (0x4000)       /* SVM low side enable */
1948
#define SVMLFP                 (0x8000)       /* SVM low side full performace mode */
1949
 
1950
/* SVSMLCTL Control Bits */
1951
#define SVSMLRRL0_L            (0x0001)       /* SVS and SVM low side Reset Release Voltage Level Bit: 0 */
1952
#define SVSMLRRL1_L            (0x0002)       /* SVS and SVM low side Reset Release Voltage Level Bit: 1 */
1953
#define SVSMLRRL2_L            (0x0004)       /* SVS and SVM low side Reset Release Voltage Level Bit: 2 */
1954
#define SVSMLDLYST_L           (0x0008)       /* SVS and SVM low side delay status */
1955
#define SVSLMD_L               (0x0010)       /* SVS low side mode */
1956
#define SVSMLEVM_L             (0x0040)       /* SVS and SVM low side event mask */
1957
#define SVSMLACE_L             (0x0080)       /* SVS and SVM low side auto control enable */
1958
 
1959
/* SVSMLCTL Control Bits */
1960
#define SVSLRVL0_H             (0x0001)       /* SVS low side reset voltage level Bit: 0 */
1961
#define SVSLRVL1_H             (0x0002)       /* SVS low side reset voltage level Bit: 1 */
1962
#define SVSLE_H                (0x0004)       /* SVS low side enable */
1963
#define SVSLFP_H               (0x0008)       /* SVS low side full performace mode */
1964
#define SVMLOVPE_H             (0x0010)       /* SVM low side over-voltage enable */
1965
#define SVMLE_H                (0x0040)       /* SVM low side enable */
1966
#define SVMLFP_H               (0x0080)       /* SVM low side full performace mode */
1967
 
1968
#define SVSMLRRL_0             (0x0000)       /* SVS and SVM low side Reset Release Voltage Level 0 */
1969
#define SVSMLRRL_1             (0x0001)       /* SVS and SVM low side Reset Release Voltage Level 1 */
1970
#define SVSMLRRL_2             (0x0002)       /* SVS and SVM low side Reset Release Voltage Level 2 */
1971
#define SVSMLRRL_3             (0x0003)       /* SVS and SVM low side Reset Release Voltage Level 3 */
1972
#define SVSMLRRL_4             (0x0004)       /* SVS and SVM low side Reset Release Voltage Level 4 */
1973
#define SVSMLRRL_5             (0x0005)       /* SVS and SVM low side Reset Release Voltage Level 5 */
1974
#define SVSMLRRL_6             (0x0006)       /* SVS and SVM low side Reset Release Voltage Level 6 */
1975
#define SVSMLRRL_7             (0x0007)       /* SVS and SVM low side Reset Release Voltage Level 7 */
1976
 
1977
#define SVSLRVL_0              (0x0000)       /* SVS low side Reset Release Voltage Level 0 */
1978
#define SVSLRVL_1              (0x0100)       /* SVS low side Reset Release Voltage Level 1 */
1979
#define SVSLRVL_2              (0x0200)       /* SVS low side Reset Release Voltage Level 2 */
1980
#define SVSLRVL_3              (0x0300)       /* SVS low side Reset Release Voltage Level 3 */
1981
 
1982
/* SVSMIO Control Bits */
1983
#define SVMLOE                 (0x0008)       /* SVM low side output enable */
1984
#define SVMLVLROE              (0x0010)       /* SVM low side voltage level reached output enable */
1985
#define SVMOUTPOL              (0x0020)       /* SVMOUT pin polarity */
1986
#define SVMHOE                 (0x0800)       /* SVM high side output enable */
1987
#define SVMHVLROE              (0x1000)       /* SVM high side voltage level reached output enable */
1988
 
1989
/* SVSMIO Control Bits */
1990
#define SVMLOE_L               (0x0008)       /* SVM low side output enable */
1991
#define SVMLVLROE_L            (0x0010)       /* SVM low side voltage level reached output enable */
1992
#define SVMOUTPOL_L            (0x0020)       /* SVMOUT pin polarity */
1993
 
1994
/* SVSMIO Control Bits */
1995
#define SVMHOE_H               (0x0008)       /* SVM high side output enable */
1996
#define SVMHVLROE_H            (0x0010)       /* SVM high side voltage level reached output enable */
1997
 
1998
/* PMMIFG Control Bits */
1999
#define SVSMLDLYIFG            (0x0001)       /* SVS and SVM low side Delay expired interrupt flag */
2000
#define SVMLIFG                (0x0002)       /* SVM low side interrupt flag */
2001
#define SVMLVLRIFG             (0x0004)       /* SVM low side Voltage Level Reached interrupt flag */
2002
#define SVSMHDLYIFG            (0x0010)       /* SVS and SVM high side Delay expired interrupt flag */
2003
#define SVMHIFG                (0x0020)       /* SVM high side interrupt flag */
2004
#define SVMHVLRIFG             (0x0040)       /* SVM high side Voltage Level Reached interrupt flag */
2005
#define PMMBORIFG              (0x0100)       /* PMM Software BOR interrupt flag */
2006
#define PMMRSTIFG              (0x0200)       /* PMM RESET pin interrupt flag */
2007
#define PMMPORIFG              (0x0400)       /* PMM Software POR interrupt flag */
2008
#define SVSHIFG                (0x1000)       /* SVS low side interrupt flag */
2009
#define SVSLIFG                (0x2000)       /* SVS high side interrupt flag */
2010
#define PMMLPM5IFG             (0x8000)       /* LPM5 indication Flag */
2011
 
2012
/* PMMIFG Control Bits */
2013
#define SVSMLDLYIFG_L          (0x0001)       /* SVS and SVM low side Delay expired interrupt flag */
2014
#define SVMLIFG_L              (0x0002)       /* SVM low side interrupt flag */
2015
#define SVMLVLRIFG_L           (0x0004)       /* SVM low side Voltage Level Reached interrupt flag */
2016
#define SVSMHDLYIFG_L          (0x0010)       /* SVS and SVM high side Delay expired interrupt flag */
2017
#define SVMHIFG_L              (0x0020)       /* SVM high side interrupt flag */
2018
#define SVMHVLRIFG_L           (0x0040)       /* SVM high side Voltage Level Reached interrupt flag */
2019
 
2020
/* PMMIFG Control Bits */
2021
#define PMMBORIFG_H            (0x0001)       /* PMM Software BOR interrupt flag */
2022
#define PMMRSTIFG_H            (0x0002)       /* PMM RESET pin interrupt flag */
2023
#define PMMPORIFG_H            (0x0004)       /* PMM Software POR interrupt flag */
2024
#define SVSHIFG_H              (0x0010)       /* SVS low side interrupt flag */
2025
#define SVSLIFG_H              (0x0020)       /* SVS high side interrupt flag */
2026
#define PMMLPM5IFG_H           (0x0080)       /* LPM5 indication Flag */
2027
 
2028
#define PMMRSTLPM5IFG          PMMLPM5IFG     /* LPM5 indication Flag */
2029
 
2030
/* PMMIE and RESET Control Bits */
2031
#define SVSMLDLYIE             (0x0001)       /* SVS and SVM low side Delay expired interrupt enable */
2032
#define SVMLIE                 (0x0002)       /* SVM low side interrupt enable */
2033
#define SVMLVLRIE              (0x0004)       /* SVM low side Voltage Level Reached interrupt enable */
2034
#define SVSMHDLYIE             (0x0010)       /* SVS and SVM high side Delay expired interrupt enable */
2035
#define SVMHIE                 (0x0020)       /* SVM high side interrupt enable */
2036
#define SVMHVLRIE              (0x0040)       /* SVM high side Voltage Level Reached interrupt enable */
2037
#define SVSLPE                 (0x0100)       /* SVS low side POR enable */
2038
#define SVMLVLRPE              (0x0200)       /* SVM low side Voltage Level reached POR enable */
2039
#define SVSHPE                 (0x1000)       /* SVS high side POR enable */
2040
#define SVMHVLRPE              (0x2000)       /* SVM high side Voltage Level reached POR enable */
2041
 
2042
/* PMMIE and RESET Control Bits */
2043
#define SVSMLDLYIE_L           (0x0001)       /* SVS and SVM low side Delay expired interrupt enable */
2044
#define SVMLIE_L               (0x0002)       /* SVM low side interrupt enable */
2045
#define SVMLVLRIE_L            (0x0004)       /* SVM low side Voltage Level Reached interrupt enable */
2046
#define SVSMHDLYIE_L           (0x0010)       /* SVS and SVM high side Delay expired interrupt enable */
2047
#define SVMHIE_L               (0x0020)       /* SVM high side interrupt enable */
2048
#define SVMHVLRIE_L            (0x0040)       /* SVM high side Voltage Level Reached interrupt enable */
2049
 
2050
/* PMMIE and RESET Control Bits */
2051
#define SVSLPE_H               (0x0001)       /* SVS low side POR enable */
2052
#define SVMLVLRPE_H            (0x0002)       /* SVM low side Voltage Level reached POR enable */
2053
#define SVSHPE_H               (0x0010)       /* SVS high side POR enable */
2054
#define SVMHVLRPE_H            (0x0020)       /* SVM high side Voltage Level reached POR enable */
2055
 
2056
/* PM5CTL0 Power Mode 5 Control Bits */
2057
#define LOCKLPM5               (0x0001)       /* Lock I/O pin configuration upon entry/exit to/from LPM5 */
2058
 
2059
/* PM5CTL0 Power Mode 5 Control Bits */
2060
#define LOCKLPM5_L             (0x0001)       /* Lock I/O pin configuration upon entry/exit to/from LPM5 */
2061
 
2062
/* PM5CTL0 Power Mode 5 Control Bits */
2063
#define LOCKIO                 LOCKLPM5       /* Lock I/O pin configuration upon entry/exit to/from LPM5 */
2064
 
2065
/*************************************************************
2066
* RAM Control Module
2067
*************************************************************/
2068
#define __MSP430_HAS_RC__                     /* Definition to show that Module is available */
2069
#define __MSP430_BASEADDRESS_RC__ 0x0158
2070
 
2071
SFR_16BIT(RCCTL0);                            /* Ram Controller Control Register */
2072
SFR_8BIT(RCCTL0_L);                           /* Ram Controller Control Register */
2073
SFR_8BIT(RCCTL0_H);                           /* Ram Controller Control Register */
2074
 
2075
/* RCCTL0 Control Bits */
2076
#define RCRS0OFF               (0x0001)       /* RAM Controller RAM Sector 0 Off */
2077
#define RCRS1OFF               (0x0002)       /* RAM Controller RAM Sector 1 Off */
2078
#define RCRS2OFF               (0x0004)       /* RAM Controller RAM Sector 2 Off */
2079
#define RCRS3OFF               (0x0008)       /* RAM Controller RAM Sector 3 Off */
2080
#define RCRS7OFF               (0x0080)       /* RAM Controller RAM Sector 7 (USB) Off */
2081
 
2082
/* RCCTL0 Control Bits */
2083
#define RCRS0OFF_L             (0x0001)       /* RAM Controller RAM Sector 0 Off */
2084
#define RCRS1OFF_L             (0x0002)       /* RAM Controller RAM Sector 1 Off */
2085
#define RCRS2OFF_L             (0x0004)       /* RAM Controller RAM Sector 2 Off */
2086
#define RCRS3OFF_L             (0x0008)       /* RAM Controller RAM Sector 3 Off */
2087
#define RCRS7OFF_L             (0x0080)       /* RAM Controller RAM Sector 7 (USB) Off */
2088
 
2089
/* RCCTL0 Control Bits */
2090
 
2091
#define RCKEY                  (0x5A00)
2092
 
2093
/************************************************************
2094
* Shared Reference
2095
************************************************************/
2096
#define __MSP430_HAS_REF__                    /* Definition to show that Module is available */
2097
#define __MSP430_BASEADDRESS_REF__ 0x01B0
2098
 
2099
SFR_16BIT(REFCTL0);                           /* REF Shared Reference control register 0 */
2100
SFR_8BIT(REFCTL0_L);                          /* REF Shared Reference control register 0 */
2101
SFR_8BIT(REFCTL0_H);                          /* REF Shared Reference control register 0 */
2102
 
2103
/* REFCTL0 Control Bits */
2104
#define REFON                  (0x0001)       /* REF Reference On */
2105
#define REFOUT                 (0x0002)       /* REF Reference output Buffer On */
2106
//#define RESERVED            (0x0004)  /* Reserved */
2107
#define REFTCOFF               (0x0008)       /* REF Temp.Sensor off */
2108
#define REFVSEL0               (0x0010)       /* REF Reference Voltage Level Select Bit:0 */
2109
#define REFVSEL1               (0x0020)       /* REF Reference Voltage Level Select Bit:1 */
2110
//#define RESERVED            (0x0040)  /* Reserved */
2111
#define REFMSTR                (0x0080)       /* REF Master Control */
2112
#define REFGENACT              (0x0100)       /* REF Reference generator active */
2113
#define REFBGACT               (0x0200)       /* REF Reference bandgap active */
2114
#define REFGENBUSY             (0x0400)       /* REF Reference generator busy */
2115
#define BGMODE                 (0x0800)       /* REF Bandgap mode */
2116
//#define RESERVED            (0x1000)  /* Reserved */
2117
//#define RESERVED            (0x2000)  /* Reserved */
2118
//#define RESERVED            (0x4000)  /* Reserved */
2119
//#define RESERVED            (0x8000)  /* Reserved */
2120
 
2121
/* REFCTL0 Control Bits */
2122
#define REFON_L                (0x0001)       /* REF Reference On */
2123
#define REFOUT_L               (0x0002)       /* REF Reference output Buffer On */
2124
//#define RESERVED            (0x0004)  /* Reserved */
2125
#define REFTCOFF_L             (0x0008)       /* REF Temp.Sensor off */
2126
#define REFVSEL0_L             (0x0010)       /* REF Reference Voltage Level Select Bit:0 */
2127
#define REFVSEL1_L             (0x0020)       /* REF Reference Voltage Level Select Bit:1 */
2128
//#define RESERVED            (0x0040)  /* Reserved */
2129
#define REFMSTR_L              (0x0080)       /* REF Master Control */
2130
//#define RESERVED            (0x1000)  /* Reserved */
2131
//#define RESERVED            (0x2000)  /* Reserved */
2132
//#define RESERVED            (0x4000)  /* Reserved */
2133
//#define RESERVED            (0x8000)  /* Reserved */
2134
 
2135
/* REFCTL0 Control Bits */
2136
//#define RESERVED            (0x0004)  /* Reserved */
2137
//#define RESERVED            (0x0040)  /* Reserved */
2138
#define REFGENACT_H            (0x0001)       /* REF Reference generator active */
2139
#define REFBGACT_H             (0x0002)       /* REF Reference bandgap active */
2140
#define REFGENBUSY_H           (0x0004)       /* REF Reference generator busy */
2141
#define BGMODE_H               (0x0008)       /* REF Bandgap mode */
2142
//#define RESERVED            (0x1000)  /* Reserved */
2143
//#define RESERVED            (0x2000)  /* Reserved */
2144
//#define RESERVED            (0x4000)  /* Reserved */
2145
//#define RESERVED            (0x8000)  /* Reserved */
2146
 
2147
#define REFVSEL_0              (0x0000)       /* REF Reference Voltage Level Select 1.5V */
2148
#define REFVSEL_1              (0x0010)       /* REF Reference Voltage Level Select 2.0V */
2149
#define REFVSEL_2              (0x0020)       /* REF Reference Voltage Level Select 2.5V */
2150
#define REFVSEL_3              (0x0030)       /* REF Reference Voltage Level Select 2.5V */
2151
 
2152
/************************************************************
2153
* Real Time Clock
2154
************************************************************/
2155
#define __MSP430_HAS_RTC__                    /* Definition to show that Module is available */
2156
#define __MSP430_BASEADDRESS_RTC__ 0x04A0
2157
 
2158
SFR_16BIT(RTCCTL01);                          /* Real Timer Control 0/1 */
2159
SFR_8BIT(RTCCTL01_L);                         /* Real Timer Control 0/1 */
2160
SFR_8BIT(RTCCTL01_H);                         /* Real Timer Control 0/1 */
2161
SFR_16BIT(RTCCTL23);                          /* Real Timer Control 2/3 */
2162
SFR_8BIT(RTCCTL23_L);                         /* Real Timer Control 2/3 */
2163
SFR_8BIT(RTCCTL23_H);                         /* Real Timer Control 2/3 */
2164
SFR_16BIT(RTCPS0CTL);                         /* Real Timer Prescale Timer 0 Control */
2165
SFR_8BIT(RTCPS0CTL_L);                        /* Real Timer Prescale Timer 0 Control */
2166
SFR_8BIT(RTCPS0CTL_H);                        /* Real Timer Prescale Timer 0 Control */
2167
SFR_16BIT(RTCPS1CTL);                         /* Real Timer Prescale Timer 1 Control */
2168
SFR_8BIT(RTCPS1CTL_L);                        /* Real Timer Prescale Timer 1 Control */
2169
SFR_8BIT(RTCPS1CTL_H);                        /* Real Timer Prescale Timer 1 Control */
2170
SFR_16BIT(RTCPS);                             /* Real Timer Prescale Timer Control */
2171
SFR_8BIT(RTCPS_L);                            /* Real Timer Prescale Timer Control */
2172
SFR_8BIT(RTCPS_H);                            /* Real Timer Prescale Timer Control */
2173
SFR_16BIT(RTCIV);                             /* Real Time Clock Interrupt Vector */
2174
SFR_16BIT(RTCTIM0);                           /* Real Time Clock Time 0 */
2175
SFR_8BIT(RTCTIM0_L);                          /* Real Time Clock Time 0 */
2176
SFR_8BIT(RTCTIM0_H);                          /* Real Time Clock Time 0 */
2177
SFR_16BIT(RTCTIM1);                           /* Real Time Clock Time 1 */
2178
SFR_8BIT(RTCTIM1_L);                          /* Real Time Clock Time 1 */
2179
SFR_8BIT(RTCTIM1_H);                          /* Real Time Clock Time 1 */
2180
SFR_16BIT(RTCDATE);                           /* Real Time Clock Date */
2181
SFR_8BIT(RTCDATE_L);                          /* Real Time Clock Date */
2182
SFR_8BIT(RTCDATE_H);                          /* Real Time Clock Date */
2183
SFR_16BIT(RTCYEAR);                           /* Real Time Clock Year */
2184
SFR_8BIT(RTCYEAR_L);                          /* Real Time Clock Year */
2185
SFR_8BIT(RTCYEAR_H);                          /* Real Time Clock Year */
2186
SFR_16BIT(RTCAMINHR);                         /* Real Time Clock Alarm Min/Hour */
2187
SFR_8BIT(RTCAMINHR_L);                        /* Real Time Clock Alarm Min/Hour */
2188
SFR_8BIT(RTCAMINHR_H);                        /* Real Time Clock Alarm Min/Hour */
2189
SFR_16BIT(RTCADOWDAY);                        /* Real Time Clock Alarm day of week/day */
2190
SFR_8BIT(RTCADOWDAY_L);                       /* Real Time Clock Alarm day of week/day */
2191
SFR_8BIT(RTCADOWDAY_H);                       /* Real Time Clock Alarm day of week/day */
2192
 
2193
#define RTCCTL0                RTCCTL01_L     /* Real Time Clock Control 0 */
2194
#define RTCCTL1                RTCCTL01_H     /* Real Time Clock Control 1 */
2195
#define RTCCTL2                RTCCTL23_L     /* Real Time Clock Control 2 */
2196
#define RTCCTL3                RTCCTL23_H     /* Real Time Clock Control 3 */
2197
#define RTCNT12                RTCTIM0
2198
#define RTCNT34                RTCTIM1
2199
#define RTCNT1                 RTCTIM0_L
2200
#define RTCNT2                 RTCTIM0_H
2201
#define RTCNT3                 RTCTIM1_L
2202
#define RTCNT4                 RTCTIM1_H
2203
#define RTCSEC                 RTCTIM0_L
2204
#define RTCMIN                 RTCTIM0_H
2205
#define RTCHOUR                RTCTIM1_L
2206
#define RTCDOW                 RTCTIM1_H
2207
#define RTCDAY                 RTCDATE_L
2208
#define RTCMON                 RTCDATE_H
2209
#define RTCYEARL               RTCYEAR_L
2210
#define RTCYEARH               RTCYEAR_H
2211
#define RT0PS                  RTCPS_L
2212
#define RT1PS                  RTCPS_H
2213
#define RTCAMIN                RTCAMINHR_L    /* Real Time Clock Alarm Min */
2214
#define RTCAHOUR               RTCAMINHR_H    /* Real Time Clock Alarm Hour */
2215
#define RTCADOW                RTCADOWDAY_L   /* Real Time Clock Alarm day of week */
2216
#define RTCADAY                RTCADOWDAY_H   /* Real Time Clock Alarm day */
2217
 
2218
/* RTCCTL01 Control Bits */
2219
#define RTCBCD                 (0x8000)       /* RTC BCD  0:Binary / 1:BCD */
2220
#define RTCHOLD                (0x4000)       /* RTC Hold */
2221
#define RTCMODE                (0x2000)       /* RTC Mode 0:Counter / 1: Calendar */
2222
#define RTCRDY                 (0x1000)       /* RTC Ready */
2223
#define RTCSSEL1               (0x0800)       /* RTC Source Select 1 */
2224
#define RTCSSEL0               (0x0400)       /* RTC Source Select 0 */
2225
#define RTCTEV1                (0x0200)       /* RTC Time Event 1 */
2226
#define RTCTEV0                (0x0100)       /* RTC Time Event 0 */
2227
//#define Reserved          (0x0080)
2228
#define RTCTEVIE               (0x0040)       /* RTC Time Event Interrupt Enable Flag */
2229
#define RTCAIE                 (0x0020)       /* RTC Alarm Interrupt Enable Flag */
2230
#define RTCRDYIE               (0x0010)       /* RTC Ready Interrupt Enable Flag */
2231
//#define Reserved          (0x0008)
2232
#define RTCTEVIFG              (0x0004)       /* RTC Time Event Interrupt Flag */
2233
#define RTCAIFG                (0x0002)       /* RTC Alarm Interrupt Flag */
2234
#define RTCRDYIFG              (0x0001)       /* RTC Ready Interrupt Flag */
2235
 
2236
/* RTCCTL01 Control Bits */
2237
//#define Reserved          (0x0080)
2238
#define RTCTEVIE_L             (0x0040)       /* RTC Time Event Interrupt Enable Flag */
2239
#define RTCAIE_L               (0x0020)       /* RTC Alarm Interrupt Enable Flag */
2240
#define RTCRDYIE_L             (0x0010)       /* RTC Ready Interrupt Enable Flag */
2241
//#define Reserved          (0x0008)
2242
#define RTCTEVIFG_L            (0x0004)       /* RTC Time Event Interrupt Flag */
2243
#define RTCAIFG_L              (0x0002)       /* RTC Alarm Interrupt Flag */
2244
#define RTCRDYIFG_L            (0x0001)       /* RTC Ready Interrupt Flag */
2245
 
2246
/* RTCCTL01 Control Bits */
2247
#define RTCBCD_H               (0x0080)       /* RTC BCD  0:Binary / 1:BCD */
2248
#define RTCHOLD_H              (0x0040)       /* RTC Hold */
2249
#define RTCMODE_H              (0x0020)       /* RTC Mode 0:Counter / 1: Calendar */
2250
#define RTCRDY_H               (0x0010)       /* RTC Ready */
2251
#define RTCSSEL1_H             (0x0008)       /* RTC Source Select 1 */
2252
#define RTCSSEL0_H             (0x0004)       /* RTC Source Select 0 */
2253
#define RTCTEV1_H              (0x0002)       /* RTC Time Event 1 */
2254
#define RTCTEV0_H              (0x0001)       /* RTC Time Event 0 */
2255
//#define Reserved          (0x0080)
2256
//#define Reserved          (0x0008)
2257
 
2258
#define RTCSSEL_0              (0x0000)       /* RTC Source Select ACLK */
2259
#define RTCSSEL_1              (0x0400)       /* RTC Source Select SMCLK */
2260
#define RTCSSEL_2              (0x0800)       /* RTC Source Select RT1PS */
2261
#define RTCSSEL_3              (0x0C00)       /* RTC Source Select RT1PS */
2262
#define RTCSSEL__ACLK          (0x0000)       /* RTC Source Select ACLK */
2263
#define RTCSSEL__SMCLK         (0x0400)       /* RTC Source Select SMCLK */
2264
#define RTCSSEL__RT1PS         (0x0800)       /* RTC Source Select RT1PS */
2265
#define RTCTEV_0               (0x0000)       /* RTC Time Event: 0 (Min. changed) */
2266
#define RTCTEV_1               (0x0100)       /* RTC Time Event: 1 (Hour changed) */
2267
#define RTCTEV_2               (0x0200)       /* RTC Time Event: 2 (12:00 changed) */
2268
#define RTCTEV_3               (0x0300)       /* RTC Time Event: 3 (00:00 changed) */
2269
#define RTCTEV__MIN            (0x0000)       /* RTC Time Event: 0 (Min. changed) */
2270
#define RTCTEV__HOUR           (0x0100)       /* RTC Time Event: 1 (Hour changed) */
2271
#define RTCTEV__1200           (0x0200)       /* RTC Time Event: 2 (12:00 changed) */
2272
#define RTCTEV__0000           (0x0300)       /* RTC Time Event: 3 (00:00 changed) */
2273
 
2274
/* RTCCTL23 Control Bits */
2275
#define RTCCALF1               (0x0200)       /* RTC Calibration Frequency Bit 1 */
2276
#define RTCCALF0               (0x0100)       /* RTC Calibration Frequency Bit 0 */
2277
#define RTCCALS                (0x0080)       /* RTC Calibration Sign */
2278
//#define Reserved          (0x0040)
2279
#define RTCCAL5                (0x0020)       /* RTC Calibration Bit 5 */
2280
#define RTCCAL4                (0x0010)       /* RTC Calibration Bit 4 */
2281
#define RTCCAL3                (0x0008)       /* RTC Calibration Bit 3 */
2282
#define RTCCAL2                (0x0004)       /* RTC Calibration Bit 2 */
2283
#define RTCCAL1                (0x0002)       /* RTC Calibration Bit 1 */
2284
#define RTCCAL0                (0x0001)       /* RTC Calibration Bit 0 */
2285
 
2286
/* RTCCTL23 Control Bits */
2287
#define RTCCALS_L              (0x0080)       /* RTC Calibration Sign */
2288
//#define Reserved          (0x0040)
2289
#define RTCCAL5_L              (0x0020)       /* RTC Calibration Bit 5 */
2290
#define RTCCAL4_L              (0x0010)       /* RTC Calibration Bit 4 */
2291
#define RTCCAL3_L              (0x0008)       /* RTC Calibration Bit 3 */
2292
#define RTCCAL2_L              (0x0004)       /* RTC Calibration Bit 2 */
2293
#define RTCCAL1_L              (0x0002)       /* RTC Calibration Bit 1 */
2294
#define RTCCAL0_L              (0x0001)       /* RTC Calibration Bit 0 */
2295
 
2296
/* RTCCTL23 Control Bits */
2297
#define RTCCALF1_H             (0x0002)       /* RTC Calibration Frequency Bit 1 */
2298
#define RTCCALF0_H             (0x0001)       /* RTC Calibration Frequency Bit 0 */
2299
//#define Reserved          (0x0040)
2300
 
2301
#define RTCCALF_0              (0x0000)       /* RTC Calibration Frequency: No Output */
2302
#define RTCCALF_1              (0x0100)       /* RTC Calibration Frequency: 512 Hz */
2303
#define RTCCALF_2              (0x0200)       /* RTC Calibration Frequency: 256 Hz */
2304
#define RTCCALF_3              (0x0300)       /* RTC Calibration Frequency: 1 Hz */
2305
 
2306
/* RTCPS0CTL Control Bits */
2307
//#define Reserved          (0x8000)
2308
#define RT0SSEL                (0x4000)       /* RTC Prescale Timer 0 Source Select 0:ACLK / 1:SMCLK */
2309
#define RT0PSDIV2              (0x2000)       /* RTC Prescale Timer 0 Clock Divide Bit: 2 */
2310
#define RT0PSDIV1              (0x1000)       /* RTC Prescale Timer 0 Clock Divide Bit: 1 */
2311
#define RT0PSDIV0              (0x0800)       /* RTC Prescale Timer 0 Clock Divide Bit: 0 */
2312
//#define Reserved          (0x0400)
2313
//#define Reserved          (0x0200)
2314
#define RT0PSHOLD              (0x0100)       /* RTC Prescale Timer 0 Hold */
2315
//#define Reserved          (0x0080)
2316
//#define Reserved          (0x0040)
2317
//#define Reserved          (0x0020)
2318
#define RT0IP2                 (0x0010)       /* RTC Prescale Timer 0 Interrupt Interval Bit: 2 */
2319
#define RT0IP1                 (0x0008)       /* RTC Prescale Timer 0 Interrupt Interval Bit: 1 */
2320
#define RT0IP0                 (0x0004)       /* RTC Prescale Timer 0 Interrupt Interval Bit: 0 */
2321
#define RT0PSIE                (0x0002)       /* RTC Prescale Timer 0 Interrupt Enable Flag */
2322
#define RT0PSIFG               (0x0001)       /* RTC Prescale Timer 0 Interrupt Flag */
2323
 
2324
/* RTCPS0CTL Control Bits */
2325
//#define Reserved          (0x8000)
2326
//#define Reserved          (0x0400)
2327
//#define Reserved          (0x0200)
2328
//#define Reserved          (0x0080)
2329
//#define Reserved          (0x0040)
2330
//#define Reserved          (0x0020)
2331
#define RT0IP2_L               (0x0010)       /* RTC Prescale Timer 0 Interrupt Interval Bit: 2 */
2332
#define RT0IP1_L               (0x0008)       /* RTC Prescale Timer 0 Interrupt Interval Bit: 1 */
2333
#define RT0IP0_L               (0x0004)       /* RTC Prescale Timer 0 Interrupt Interval Bit: 0 */
2334
#define RT0PSIE_L              (0x0002)       /* RTC Prescale Timer 0 Interrupt Enable Flag */
2335
#define RT0PSIFG_L             (0x0001)       /* RTC Prescale Timer 0 Interrupt Flag */
2336
 
2337
/* RTCPS0CTL Control Bits */
2338
//#define Reserved          (0x8000)
2339
#define RT0SSEL_H              (0x0040)       /* RTC Prescale Timer 0 Source Select 0:ACLK / 1:SMCLK */
2340
#define RT0PSDIV2_H            (0x0020)       /* RTC Prescale Timer 0 Clock Divide Bit: 2 */
2341
#define RT0PSDIV1_H            (0x0010)       /* RTC Prescale Timer 0 Clock Divide Bit: 1 */
2342
#define RT0PSDIV0_H            (0x0008)       /* RTC Prescale Timer 0 Clock Divide Bit: 0 */
2343
//#define Reserved          (0x0400)
2344
//#define Reserved          (0x0200)
2345
#define RT0PSHOLD_H            (0x0001)       /* RTC Prescale Timer 0 Hold */
2346
//#define Reserved          (0x0080)
2347
//#define Reserved          (0x0040)
2348
//#define Reserved          (0x0020)
2349
 
2350
#define RT0IP_0                (0x0000)       /* RTC Prescale Timer 0 Interrupt Interval /2 */
2351
#define RT0IP_1                (0x0004)       /* RTC Prescale Timer 0 Interrupt Interval /4 */
2352
#define RT0IP_2                (0x0008)       /* RTC Prescale Timer 0 Interrupt Interval /8 */
2353
#define RT0IP_3                (0x000C)       /* RTC Prescale Timer 0 Interrupt Interval /16 */
2354
#define RT0IP_4                (0x0010)       /* RTC Prescale Timer 0 Interrupt Interval /32 */
2355
#define RT0IP_5                (0x0014)       /* RTC Prescale Timer 0 Interrupt Interval /64 */
2356
#define RT0IP_6                (0x0018)       /* RTC Prescale Timer 0 Interrupt Interval /128 */
2357
#define RT0IP_7                (0x001C)       /* RTC Prescale Timer 0 Interrupt Interval /256 */
2358
 
2359
#define RT0PSDIV_0             (0x0000)       /* RTC Prescale Timer 0 Clock Divide /2 */
2360
#define RT0PSDIV_1             (0x0800)       /* RTC Prescale Timer 0 Clock Divide /4 */
2361
#define RT0PSDIV_2             (0x1000)       /* RTC Prescale Timer 0 Clock Divide /8 */
2362
#define RT0PSDIV_3             (0x1800)       /* RTC Prescale Timer 0 Clock Divide /16 */
2363
#define RT0PSDIV_4             (0x2000)       /* RTC Prescale Timer 0 Clock Divide /32 */
2364
#define RT0PSDIV_5             (0x2800)       /* RTC Prescale Timer 0 Clock Divide /64 */
2365
#define RT0PSDIV_6             (0x3000)       /* RTC Prescale Timer 0 Clock Divide /128 */
2366
#define RT0PSDIV_7             (0x3800)       /* RTC Prescale Timer 0 Clock Divide /256 */
2367
 
2368
/* RTCPS1CTL Control Bits */
2369
#define RT1SSEL1               (0x8000)       /* RTC Prescale Timer 1 Source Select Bit 1 */
2370
#define RT1SSEL0               (0x4000)       /* RTC Prescale Timer 1 Source Select Bit 0 */
2371
#define RT1PSDIV2              (0x2000)       /* RTC Prescale Timer 1 Clock Divide Bit: 2 */
2372
#define RT1PSDIV1              (0x1000)       /* RTC Prescale Timer 1 Clock Divide Bit: 1 */
2373
#define RT1PSDIV0              (0x0800)       /* RTC Prescale Timer 1 Clock Divide Bit: 0 */
2374
//#define Reserved          (0x0400)
2375
//#define Reserved          (0x0200)
2376
#define RT1PSHOLD              (0x0100)       /* RTC Prescale Timer 1 Hold */
2377
//#define Reserved          (0x0080)
2378
//#define Reserved          (0x0040)
2379
//#define Reserved          (0x0020)
2380
#define RT1IP2                 (0x0010)       /* RTC Prescale Timer 1 Interrupt Interval Bit: 2 */
2381
#define RT1IP1                 (0x0008)       /* RTC Prescale Timer 1 Interrupt Interval Bit: 1 */
2382
#define RT1IP0                 (0x0004)       /* RTC Prescale Timer 1 Interrupt Interval Bit: 0 */
2383
#define RT1PSIE                (0x0002)       /* RTC Prescale Timer 1 Interrupt Enable Flag */
2384
#define RT1PSIFG               (0x0001)       /* RTC Prescale Timer 1 Interrupt Flag */
2385
 
2386
/* RTCPS1CTL Control Bits */
2387
//#define Reserved          (0x0400)
2388
//#define Reserved          (0x0200)
2389
//#define Reserved          (0x0080)
2390
//#define Reserved          (0x0040)
2391
//#define Reserved          (0x0020)
2392
#define RT1IP2_L               (0x0010)       /* RTC Prescale Timer 1 Interrupt Interval Bit: 2 */
2393
#define RT1IP1_L               (0x0008)       /* RTC Prescale Timer 1 Interrupt Interval Bit: 1 */
2394
#define RT1IP0_L               (0x0004)       /* RTC Prescale Timer 1 Interrupt Interval Bit: 0 */
2395
#define RT1PSIE_L              (0x0002)       /* RTC Prescale Timer 1 Interrupt Enable Flag */
2396
#define RT1PSIFG_L             (0x0001)       /* RTC Prescale Timer 1 Interrupt Flag */
2397
 
2398
/* RTCPS1CTL Control Bits */
2399
#define RT1SSEL1_H             (0x0080)       /* RTC Prescale Timer 1 Source Select Bit 1 */
2400
#define RT1SSEL0_H             (0x0040)       /* RTC Prescale Timer 1 Source Select Bit 0 */
2401
#define RT1PSDIV2_H            (0x0020)       /* RTC Prescale Timer 1 Clock Divide Bit: 2 */
2402
#define RT1PSDIV1_H            (0x0010)       /* RTC Prescale Timer 1 Clock Divide Bit: 1 */
2403
#define RT1PSDIV0_H            (0x0008)       /* RTC Prescale Timer 1 Clock Divide Bit: 0 */
2404
//#define Reserved          (0x0400)
2405
//#define Reserved          (0x0200)
2406
#define RT1PSHOLD_H            (0x0001)       /* RTC Prescale Timer 1 Hold */
2407
//#define Reserved          (0x0080)
2408
//#define Reserved          (0x0040)
2409
//#define Reserved          (0x0020)
2410
 
2411
#define RT1IP_0                (0x0000)       /* RTC Prescale Timer 1 Interrupt Interval /2 */
2412
#define RT1IP_1                (0x0004)       /* RTC Prescale Timer 1 Interrupt Interval /4 */
2413
#define RT1IP_2                (0x0008)       /* RTC Prescale Timer 1 Interrupt Interval /8 */
2414
#define RT1IP_3                (0x000C)       /* RTC Prescale Timer 1 Interrupt Interval /16 */
2415
#define RT1IP_4                (0x0010)       /* RTC Prescale Timer 1 Interrupt Interval /32 */
2416
#define RT1IP_5                (0x0014)       /* RTC Prescale Timer 1 Interrupt Interval /64 */
2417
#define RT1IP_6                (0x0018)       /* RTC Prescale Timer 1 Interrupt Interval /128 */
2418
#define RT1IP_7                (0x001C)       /* RTC Prescale Timer 1 Interrupt Interval /256 */
2419
 
2420
#define RT1PSDIV_0             (0x0000)       /* RTC Prescale Timer 1 Clock Divide /2 */
2421
#define RT1PSDIV_1             (0x0800)       /* RTC Prescale Timer 1 Clock Divide /4 */
2422
#define RT1PSDIV_2             (0x1000)       /* RTC Prescale Timer 1 Clock Divide /8 */
2423
#define RT1PSDIV_3             (0x1800)       /* RTC Prescale Timer 1 Clock Divide /16 */
2424
#define RT1PSDIV_4             (0x2000)       /* RTC Prescale Timer 1 Clock Divide /32 */
2425
#define RT1PSDIV_5             (0x2800)       /* RTC Prescale Timer 1 Clock Divide /64 */
2426
#define RT1PSDIV_6             (0x3000)       /* RTC Prescale Timer 1 Clock Divide /128 */
2427
#define RT1PSDIV_7             (0x3800)       /* RTC Prescale Timer 1 Clock Divide /256 */
2428
 
2429
#define RT1SSEL_0              (0x0000)       /* RTC Prescale Timer Source Select ACLK */
2430
#define RT1SSEL_1              (0x4000)       /* RTC Prescale Timer Source Select SMCLK */
2431
#define RT1SSEL_2              (0x8000)       /* RTC Prescale Timer Source Select RT0PS */
2432
#define RT1SSEL_3              (0xC000)       /* RTC Prescale Timer Source Select RT0PS */
2433
 
2434
/* RTC Definitions */
2435
#define RTCIV_NONE             (0x0000)       /* No Interrupt pending */
2436
#define RTCIV_RTCRDYIFG        (0x0002)       /* RTC ready: RTCRDYIFG */
2437
#define RTCIV_RTCTEVIFG        (0x0004)       /* RTC interval timer: RTCTEVIFG */
2438
#define RTCIV_RTCAIFG          (0x0006)       /* RTC user alarm: RTCAIFG */
2439
#define RTCIV_RT0PSIFG         (0x0008)       /* RTC prescaler 0: RT0PSIFG */
2440
#define RTCIV_RT1PSIFG         (0x000A)       /* RTC prescaler 1: RT1PSIFG */
2441
 
2442
/* Legacy Definitions */
2443
#define RTC_NONE               (0x0000)       /* No Interrupt pending */
2444
#define RTC_RTCRDYIFG          (0x0002)       /* RTC ready: RTCRDYIFG */
2445
#define RTC_RTCTEVIFG          (0x0004)       /* RTC interval timer: RTCTEVIFG */
2446
#define RTC_RTCAIFG            (0x0006)       /* RTC user alarm: RTCAIFG */
2447
#define RTC_RT0PSIFG           (0x0008)       /* RTC prescaler 0: RT0PSIFG */
2448
#define RTC_RT1PSIFG           (0x000A)       /* RTC prescaler 1: RT1PSIFG */
2449
 
2450
/************************************************************
2451
* SFR - Special Function Register Module
2452
************************************************************/
2453
#define __MSP430_HAS_SFR__                    /* Definition to show that Module is available */
2454
#define __MSP430_BASEADDRESS_SFR__ 0x0100
2455
 
2456
SFR_16BIT(SFRIE1);                            /* Interrupt Enable 1 */
2457
SFR_8BIT(SFRIE1_L);                           /* Interrupt Enable 1 */
2458
SFR_8BIT(SFRIE1_H);                           /* Interrupt Enable 1 */
2459
 
2460
/* SFRIE1 Control Bits */
2461
#define WDTIE                  (0x0001)       /* WDT Interrupt Enable */
2462
#define OFIE                   (0x0002)       /* Osc Fault Enable */
2463
//#define Reserved          (0x0004)
2464
#define VMAIE                  (0x0008)       /* Vacant Memory Interrupt Enable */
2465
#define NMIIE                  (0x0010)       /* NMI Interrupt Enable */
2466
#define ACCVIE                 (0x0020)       /* Flash Access Violation Interrupt Enable */
2467
#define JMBINIE                (0x0040)       /* JTAG Mail Box input Interrupt Enable */
2468
#define JMBOUTIE               (0x0080)       /* JTAG Mail Box output Interrupt Enable */
2469
 
2470
#define WDTIE_L                (0x0001)       /* WDT Interrupt Enable */
2471
#define OFIE_L                 (0x0002)       /* Osc Fault Enable */
2472
//#define Reserved          (0x0004)
2473
#define VMAIE_L                (0x0008)       /* Vacant Memory Interrupt Enable */
2474
#define NMIIE_L                (0x0010)       /* NMI Interrupt Enable */
2475
#define ACCVIE_L               (0x0020)       /* Flash Access Violation Interrupt Enable */
2476
#define JMBINIE_L              (0x0040)       /* JTAG Mail Box input Interrupt Enable */
2477
#define JMBOUTIE_L             (0x0080)       /* JTAG Mail Box output Interrupt Enable */
2478
 
2479
//#define Reserved          (0x0004)
2480
 
2481
SFR_16BIT(SFRIFG1);                           /* Interrupt Flag 1 */
2482
SFR_8BIT(SFRIFG1_L);                          /* Interrupt Flag 1 */
2483
SFR_8BIT(SFRIFG1_H);                          /* Interrupt Flag 1 */
2484
/* SFRIFG1 Control Bits */
2485
#define WDTIFG                 (0x0001)       /* WDT Interrupt Flag */
2486
#define OFIFG                  (0x0002)       /* Osc Fault Flag */
2487
//#define Reserved          (0x0004)
2488
#define VMAIFG                 (0x0008)       /* Vacant Memory Interrupt Flag */
2489
#define NMIIFG                 (0x0010)       /* NMI Interrupt Flag */
2490
//#define Reserved          (0x0020)
2491
#define JMBINIFG               (0x0040)       /* JTAG Mail Box input Interrupt Flag */
2492
#define JMBOUTIFG              (0x0080)       /* JTAG Mail Box output Interrupt Flag */
2493
 
2494
#define WDTIFG_L               (0x0001)       /* WDT Interrupt Flag */
2495
#define OFIFG_L                (0x0002)       /* Osc Fault Flag */
2496
//#define Reserved          (0x0004)
2497
#define VMAIFG_L               (0x0008)       /* Vacant Memory Interrupt Flag */
2498
#define NMIIFG_L               (0x0010)       /* NMI Interrupt Flag */
2499
//#define Reserved          (0x0020)
2500
#define JMBINIFG_L             (0x0040)       /* JTAG Mail Box input Interrupt Flag */
2501
#define JMBOUTIFG_L            (0x0080)       /* JTAG Mail Box output Interrupt Flag */
2502
 
2503
//#define Reserved          (0x0004)
2504
//#define Reserved          (0x0020)
2505
 
2506
SFR_16BIT(SFRRPCR);                           /* RESET Pin Control Register */
2507
SFR_8BIT(SFRRPCR_L);                          /* RESET Pin Control Register */
2508
SFR_8BIT(SFRRPCR_H);                          /* RESET Pin Control Register */
2509
/* SFRRPCR Control Bits */
2510
#define SYSNMI                 (0x0001)       /* NMI select */
2511
#define SYSNMIIES              (0x0002)       /* NMI edge select */
2512
#define SYSRSTUP               (0x0004)       /* RESET Pin pull down/up select */
2513
#define SYSRSTRE               (0x0008)       /* RESET Pin Resistor enable */
2514
 
2515
#define SYSNMI_L               (0x0001)       /* NMI select */
2516
#define SYSNMIIES_L            (0x0002)       /* NMI edge select */
2517
#define SYSRSTUP_L             (0x0004)       /* RESET Pin pull down/up select */
2518
#define SYSRSTRE_L             (0x0008)       /* RESET Pin Resistor enable */
2519
 
2520
/************************************************************
2521
* SYS - System Module
2522
************************************************************/
2523
#define __MSP430_HAS_SYS__                    /* Definition to show that Module is available */
2524
#define __MSP430_BASEADDRESS_SYS__ 0x0180
2525
 
2526
SFR_16BIT(SYSCTL);                            /* System control */
2527
SFR_8BIT(SYSCTL_L);                           /* System control */
2528
SFR_8BIT(SYSCTL_H);                           /* System control */
2529
SFR_16BIT(SYSBSLC);                           /* Boot strap configuration area */
2530
SFR_8BIT(SYSBSLC_L);                          /* Boot strap configuration area */
2531
SFR_8BIT(SYSBSLC_H);                          /* Boot strap configuration area */
2532
SFR_16BIT(SYSJMBC);                           /* JTAG mailbox control */
2533
SFR_8BIT(SYSJMBC_L);                          /* JTAG mailbox control */
2534
SFR_8BIT(SYSJMBC_H);                          /* JTAG mailbox control */
2535
SFR_16BIT(SYSJMBI0);                          /* JTAG mailbox input 0 */
2536
SFR_8BIT(SYSJMBI0_L);                         /* JTAG mailbox input 0 */
2537
SFR_8BIT(SYSJMBI0_H);                         /* JTAG mailbox input 0 */
2538
SFR_16BIT(SYSJMBI1);                          /* JTAG mailbox input 1 */
2539
SFR_8BIT(SYSJMBI1_L);                         /* JTAG mailbox input 1 */
2540
SFR_8BIT(SYSJMBI1_H);                         /* JTAG mailbox input 1 */
2541
SFR_16BIT(SYSJMBO0);                          /* JTAG mailbox output 0 */
2542
SFR_8BIT(SYSJMBO0_L);                         /* JTAG mailbox output 0 */
2543
SFR_8BIT(SYSJMBO0_H);                         /* JTAG mailbox output 0 */
2544
SFR_16BIT(SYSJMBO1);                          /* JTAG mailbox output 1 */
2545
SFR_8BIT(SYSJMBO1_L);                         /* JTAG mailbox output 1 */
2546
SFR_8BIT(SYSJMBO1_H);                         /* JTAG mailbox output 1 */
2547
 
2548
SFR_16BIT(SYSBERRIV);                         /* Bus Error vector generator */
2549
SFR_8BIT(SYSBERRIV_L);                        /* Bus Error vector generator */
2550
SFR_8BIT(SYSBERRIV_H);                        /* Bus Error vector generator */
2551
SFR_16BIT(SYSUNIV);                           /* User NMI vector generator */
2552
SFR_8BIT(SYSUNIV_L);                          /* User NMI vector generator */
2553
SFR_8BIT(SYSUNIV_H);                          /* User NMI vector generator */
2554
SFR_16BIT(SYSSNIV);                           /* System NMI vector generator */
2555
SFR_8BIT(SYSSNIV_L);                          /* System NMI vector generator */
2556
SFR_8BIT(SYSSNIV_H);                          /* System NMI vector generator */
2557
SFR_16BIT(SYSRSTIV);                          /* Reset vector generator */
2558
SFR_8BIT(SYSRSTIV_L);                         /* Reset vector generator */
2559
SFR_8BIT(SYSRSTIV_H);                         /* Reset vector generator */
2560
 
2561
/* SYSCTL Control Bits */
2562
#define SYSRIVECT              (0x0001)       /* SYS - RAM based interrupt vectors */
2563
//#define RESERVED            (0x0002)  /* SYS - Reserved */
2564
#define SYSPMMPE               (0x0004)       /* SYS - PMM access protect */
2565
//#define RESERVED            (0x0008)  /* SYS - Reserved */
2566
#define SYSBSLIND              (0x0010)       /* SYS - TCK/RST indication detected */
2567
#define SYSJTAGPIN             (0x0020)       /* SYS - Dedicated JTAG pins enabled */
2568
//#define RESERVED            (0x0040)  /* SYS - Reserved */
2569
//#define RESERVED            (0x0080)  /* SYS - Reserved */
2570
//#define RESERVED            (0x0100)  /* SYS - Reserved */
2571
//#define RESERVED            (0x0200)  /* SYS - Reserved */
2572
//#define RESERVED            (0x0400)  /* SYS - Reserved */
2573
//#define RESERVED            (0x0800)  /* SYS - Reserved */
2574
//#define RESERVED            (0x1000)  /* SYS - Reserved */
2575
//#define RESERVED            (0x2000)  /* SYS - Reserved */
2576
//#define RESERVED            (0x4000)  /* SYS - Reserved */
2577
//#define RESERVED            (0x8000)  /* SYS - Reserved */
2578
 
2579
/* SYSCTL Control Bits */
2580
#define SYSRIVECT_L            (0x0001)       /* SYS - RAM based interrupt vectors */
2581
//#define RESERVED            (0x0002)  /* SYS - Reserved */
2582
#define SYSPMMPE_L             (0x0004)       /* SYS - PMM access protect */
2583
//#define RESERVED            (0x0008)  /* SYS - Reserved */
2584
#define SYSBSLIND_L            (0x0010)       /* SYS - TCK/RST indication detected */
2585
#define SYSJTAGPIN_L           (0x0020)       /* SYS - Dedicated JTAG pins enabled */
2586
//#define RESERVED            (0x0040)  /* SYS - Reserved */
2587
//#define RESERVED            (0x0080)  /* SYS - Reserved */
2588
//#define RESERVED            (0x0100)  /* SYS - Reserved */
2589
//#define RESERVED            (0x0200)  /* SYS - Reserved */
2590
//#define RESERVED            (0x0400)  /* SYS - Reserved */
2591
//#define RESERVED            (0x0800)  /* SYS - Reserved */
2592
//#define RESERVED            (0x1000)  /* SYS - Reserved */
2593
//#define RESERVED            (0x2000)  /* SYS - Reserved */
2594
//#define RESERVED            (0x4000)  /* SYS - Reserved */
2595
//#define RESERVED            (0x8000)  /* SYS - Reserved */
2596
 
2597
/* SYSCTL Control Bits */
2598
//#define RESERVED            (0x0002)  /* SYS - Reserved */
2599
//#define RESERVED            (0x0008)  /* SYS - Reserved */
2600
//#define RESERVED            (0x0040)  /* SYS - Reserved */
2601
//#define RESERVED            (0x0080)  /* SYS - Reserved */
2602
//#define RESERVED            (0x0100)  /* SYS - Reserved */
2603
//#define RESERVED            (0x0200)  /* SYS - Reserved */
2604
//#define RESERVED            (0x0400)  /* SYS - Reserved */
2605
//#define RESERVED            (0x0800)  /* SYS - Reserved */
2606
//#define RESERVED            (0x1000)  /* SYS - Reserved */
2607
//#define RESERVED            (0x2000)  /* SYS - Reserved */
2608
//#define RESERVED            (0x4000)  /* SYS - Reserved */
2609
//#define RESERVED            (0x8000)  /* SYS - Reserved */
2610
 
2611
/* SYSBSLC Control Bits */
2612
#define SYSBSLSIZE0            (0x0001)       /* SYS - BSL Protection Size 0 */
2613
#define SYSBSLSIZE1            (0x0002)       /* SYS - BSL Protection Size 1 */
2614
#define SYSBSLR                (0x0004)       /* SYS - RAM assigned to BSL */
2615
//#define RESERVED            (0x0008)  /* SYS - Reserved */
2616
//#define RESERVED            (0x0010)  /* SYS - Reserved */
2617
//#define RESERVED            (0x0020)  /* SYS - Reserved */
2618
//#define RESERVED            (0x0040)  /* SYS - Reserved */
2619
//#define RESERVED            (0x0080)  /* SYS - Reserved */
2620
//#define RESERVED            (0x0100)  /* SYS - Reserved */
2621
//#define RESERVED            (0x0200)  /* SYS - Reserved */
2622
//#define RESERVED            (0x0400)  /* SYS - Reserved */
2623
//#define RESERVED            (0x0800)  /* SYS - Reserved */
2624
//#define RESERVED            (0x1000)  /* SYS - Reserved */
2625
//#define RESERVED            (0x2000)  /* SYS - Reserved */
2626
#define SYSBSLOFF              (0x4000)       /* SYS - BSL Memeory disabled */
2627
#define SYSBSLPE               (0x8000)       /* SYS - BSL Memory protection enabled */
2628
 
2629
/* SYSBSLC Control Bits */
2630
#define SYSBSLSIZE0_L          (0x0001)       /* SYS - BSL Protection Size 0 */
2631
#define SYSBSLSIZE1_L          (0x0002)       /* SYS - BSL Protection Size 1 */
2632
#define SYSBSLR_L              (0x0004)       /* SYS - RAM assigned to BSL */
2633
//#define RESERVED            (0x0008)  /* SYS - Reserved */
2634
//#define RESERVED            (0x0010)  /* SYS - Reserved */
2635
//#define RESERVED            (0x0020)  /* SYS - Reserved */
2636
//#define RESERVED            (0x0040)  /* SYS - Reserved */
2637
//#define RESERVED            (0x0080)  /* SYS - Reserved */
2638
//#define RESERVED            (0x0100)  /* SYS - Reserved */
2639
//#define RESERVED            (0x0200)  /* SYS - Reserved */
2640
//#define RESERVED            (0x0400)  /* SYS - Reserved */
2641
//#define RESERVED            (0x0800)  /* SYS - Reserved */
2642
//#define RESERVED            (0x1000)  /* SYS - Reserved */
2643
//#define RESERVED            (0x2000)  /* SYS - Reserved */
2644
 
2645
/* SYSBSLC Control Bits */
2646
//#define RESERVED            (0x0008)  /* SYS - Reserved */
2647
//#define RESERVED            (0x0010)  /* SYS - Reserved */
2648
//#define RESERVED            (0x0020)  /* SYS - Reserved */
2649
//#define RESERVED            (0x0040)  /* SYS - Reserved */
2650
//#define RESERVED            (0x0080)  /* SYS - Reserved */
2651
//#define RESERVED            (0x0100)  /* SYS - Reserved */
2652
//#define RESERVED            (0x0200)  /* SYS - Reserved */
2653
//#define RESERVED            (0x0400)  /* SYS - Reserved */
2654
//#define RESERVED            (0x0800)  /* SYS - Reserved */
2655
//#define RESERVED            (0x1000)  /* SYS - Reserved */
2656
//#define RESERVED            (0x2000)  /* SYS - Reserved */
2657
#define SYSBSLOFF_H            (0x0040)       /* SYS - BSL Memeory disabled */
2658
#define SYSBSLPE_H             (0x0080)       /* SYS - BSL Memory protection enabled */
2659
 
2660
/* SYSJMBC Control Bits */
2661
#define JMBIN0FG               (0x0001)       /* SYS - Incoming JTAG Mailbox 0 Flag */
2662
#define JMBIN1FG               (0x0002)       /* SYS - Incoming JTAG Mailbox 1 Flag */
2663
#define JMBOUT0FG              (0x0004)       /* SYS - Outgoing JTAG Mailbox 0 Flag */
2664
#define JMBOUT1FG              (0x0008)       /* SYS - Outgoing JTAG Mailbox 1 Flag */
2665
#define JMBMODE                (0x0010)       /* SYS - JMB 16/32 Bit Mode */
2666
//#define RESERVED            (0x0020)  /* SYS - Reserved */
2667
#define JMBCLR0OFF             (0x0040)       /* SYS - Incoming JTAG Mailbox 0 Flag auto-clear disalbe */
2668
#define JMBCLR1OFF             (0x0080)       /* SYS - Incoming JTAG Mailbox 1 Flag auto-clear disalbe */
2669
//#define RESERVED            (0x0100)  /* SYS - Reserved */
2670
//#define RESERVED            (0x0200)  /* SYS - Reserved */
2671
//#define RESERVED            (0x0400)  /* SYS - Reserved */
2672
//#define RESERVED            (0x0800)  /* SYS - Reserved */
2673
//#define RESERVED            (0x1000)  /* SYS - Reserved */
2674
//#define RESERVED            (0x2000)  /* SYS - Reserved */
2675
//#define RESERVED            (0x4000)  /* SYS - Reserved */
2676
//#define RESERVED            (0x8000)  /* SYS - Reserved */
2677
 
2678
/* SYSJMBC Control Bits */
2679
#define JMBIN0FG_L             (0x0001)       /* SYS - Incoming JTAG Mailbox 0 Flag */
2680
#define JMBIN1FG_L             (0x0002)       /* SYS - Incoming JTAG Mailbox 1 Flag */
2681
#define JMBOUT0FG_L            (0x0004)       /* SYS - Outgoing JTAG Mailbox 0 Flag */
2682
#define JMBOUT1FG_L            (0x0008)       /* SYS - Outgoing JTAG Mailbox 1 Flag */
2683
#define JMBMODE_L              (0x0010)       /* SYS - JMB 16/32 Bit Mode */
2684
//#define RESERVED            (0x0020)  /* SYS - Reserved */
2685
#define JMBCLR0OFF_L           (0x0040)       /* SYS - Incoming JTAG Mailbox 0 Flag auto-clear disalbe */
2686
#define JMBCLR1OFF_L           (0x0080)       /* SYS - Incoming JTAG Mailbox 1 Flag auto-clear disalbe */
2687
//#define RESERVED            (0x0100)  /* SYS - Reserved */
2688
//#define RESERVED            (0x0200)  /* SYS - Reserved */
2689
//#define RESERVED            (0x0400)  /* SYS - Reserved */
2690
//#define RESERVED            (0x0800)  /* SYS - Reserved */
2691
//#define RESERVED            (0x1000)  /* SYS - Reserved */
2692
//#define RESERVED            (0x2000)  /* SYS - Reserved */
2693
//#define RESERVED            (0x4000)  /* SYS - Reserved */
2694
//#define RESERVED            (0x8000)  /* SYS - Reserved */
2695
 
2696
/* SYSJMBC Control Bits */
2697
//#define RESERVED            (0x0020)  /* SYS - Reserved */
2698
//#define RESERVED            (0x0100)  /* SYS - Reserved */
2699
//#define RESERVED            (0x0200)  /* SYS - Reserved */
2700
//#define RESERVED            (0x0400)  /* SYS - Reserved */
2701
//#define RESERVED            (0x0800)  /* SYS - Reserved */
2702
//#define RESERVED            (0x1000)  /* SYS - Reserved */
2703
//#define RESERVED            (0x2000)  /* SYS - Reserved */
2704
//#define RESERVED            (0x4000)  /* SYS - Reserved */
2705
//#define RESERVED            (0x8000)  /* SYS - Reserved */
2706
 
2707
/* SYSUNIV Definitions */
2708
#define SYSUNIV_NONE           (0x0000)       /* No Interrupt pending */
2709
#define SYSUNIV_NMIIFG         (0x0002)       /* SYSUNIV : NMIIFG */
2710
#define SYSUNIV_OFIFG          (0x0004)       /* SYSUNIV : Osc. Fail - OFIFG */
2711
#define SYSUNIV_ACCVIFG        (0x0006)       /* SYSUNIV : Access Violation - ACCVIFG */
2712
#define SYSUNIV_BUSIFG         (0x0008)       /* SYSUNIV : Bus Error */
2713
#define SYSUNIV_SYSBUSIV       (0x0008)       /* SYSUNIV : Bus Error - SYSBERRIFG (legacy) */
2714
 
2715
/* SYSSNIV Definitions */
2716
#define SYSSNIV_NONE           (0x0000)       /* No Interrupt pending */
2717
#define SYSSNIV_SVMLIFG        (0x0002)       /* SYSSNIV : SVMLIFG */
2718
#define SYSSNIV_SVMHIFG        (0x0004)       /* SYSSNIV : SVMHIFG */
2719
#define SYSSNIV_DLYLIFG        (0x0006)       /* SYSSNIV : DLYLIFG */
2720
#define SYSSNIV_DLYHIFG        (0x0008)       /* SYSSNIV : DLYHIFG */
2721
#define SYSSNIV_VMAIFG         (0x000A)       /* SYSSNIV : VMAIFG */
2722
#define SYSSNIV_JMBINIFG       (0x000C)       /* SYSSNIV : JMBINIFG */
2723
#define SYSSNIV_JMBOUTIFG      (0x000E)       /* SYSSNIV : JMBOUTIFG */
2724
#define SYSSNIV_VLRLIFG        (0x0010)       /* SYSSNIV : VLRLIFG */
2725
#define SYSSNIV_VLRHIFG        (0x0012)       /* SYSSNIV : VLRHIFG */
2726
 
2727
/* SYSRSTIV Definitions */
2728
#define SYSRSTIV_NONE          (0x0000)       /* No Interrupt pending */
2729
#define SYSRSTIV_BOR           (0x0002)       /* SYSRSTIV : BOR */
2730
#define SYSRSTIV_RSTNMI        (0x0004)       /* SYSRSTIV : RST/NMI */
2731
#define SYSRSTIV_DOBOR         (0x0006)       /* SYSRSTIV : Do BOR */
2732
#define SYSRSTIV_LPM5WU        (0x0008)       /* SYSRSTIV : Port LPM5 Wake Up */
2733
#define SYSRSTIV_SECYV         (0x000A)       /* SYSRSTIV : Security violation */
2734
#define SYSRSTIV_SVSL          (0x000C)       /* SYSRSTIV : SVSL */
2735
#define SYSRSTIV_SVSH          (0x000E)       /* SYSRSTIV : SVSH */
2736
#define SYSRSTIV_SVML_OVP      (0x0010)       /* SYSRSTIV : SVML_OVP */
2737
#define SYSRSTIV_SVMH_OVP      (0x0012)       /* SYSRSTIV : SVMH_OVP */
2738
#define SYSRSTIV_DOPOR         (0x0014)       /* SYSRSTIV : Do POR */
2739
#define SYSRSTIV_WDTTO         (0x0016)       /* SYSRSTIV : WDT Time out */
2740
#define SYSRSTIV_WDTKEY        (0x0018)       /* SYSRSTIV : WDTKEY violation */
2741
#define SYSRSTIV_KEYV          (0x001A)       /* SYSRSTIV : Flash Key violation */
2742
#define SYSRSTIV_FLLUL         (0x001C)       /* SYSRSTIV : FLL unlock */
2743
#define SYSRSTIV_PERF          (0x001E)       /* SYSRSTIV : peripheral/config area fetch */
2744
#define SYSRSTIV_PMMKEY        (0x0020)       /* SYSRSTIV : PMMKEY violation */
2745
 
2746
/************************************************************
2747
* Timer0_A5
2748
************************************************************/
2749
#define __MSP430_HAS_T0A5__                   /* Definition to show that Module is available */
2750
#define __MSP430_BASEADDRESS_T0A5__ 0x0340
2751
 
2752
SFR_16BIT(TA0CTL);                            /* Timer0_A5 Control */
2753
SFR_16BIT(TA0CCTL0);                          /* Timer0_A5 Capture/Compare Control 0 */
2754
SFR_16BIT(TA0CCTL1);                          /* Timer0_A5 Capture/Compare Control 1 */
2755
SFR_16BIT(TA0CCTL2);                          /* Timer0_A5 Capture/Compare Control 2 */
2756
SFR_16BIT(TA0CCTL3);                          /* Timer0_A5 Capture/Compare Control 3 */
2757
SFR_16BIT(TA0CCTL4);                          /* Timer0_A5 Capture/Compare Control 4 */
2758
SFR_16BIT(TA0R);                              /* Timer0_A5 */
2759
SFR_16BIT(TA0CCR0);                           /* Timer0_A5 Capture/Compare 0 */
2760
SFR_16BIT(TA0CCR1);                           /* Timer0_A5 Capture/Compare 1 */
2761
SFR_16BIT(TA0CCR2);                           /* Timer0_A5 Capture/Compare 2 */
2762
SFR_16BIT(TA0CCR3);                           /* Timer0_A5 Capture/Compare 3 */
2763
SFR_16BIT(TA0CCR4);                           /* Timer0_A5 Capture/Compare 4 */
2764
SFR_16BIT(TA0IV);                             /* Timer0_A5 Interrupt Vector Word */
2765
SFR_16BIT(TA0EX0);                            /* Timer0_A5 Expansion Register 0 */
2766
 
2767
/* TAxCTL Control Bits */
2768
#define TASSEL1                (0x0200)       /* Timer A clock source select 0 */
2769
#define TASSEL0                (0x0100)       /* Timer A clock source select 1 */
2770
#define ID1                    (0x0080)       /* Timer A clock input divider 1 */
2771
#define ID0                    (0x0040)       /* Timer A clock input divider 0 */
2772
#define MC1                    (0x0020)       /* Timer A mode control 1 */
2773
#define MC0                    (0x0010)       /* Timer A mode control 0 */
2774
#define TACLR                  (0x0004)       /* Timer A counter clear */
2775
#define TAIE                   (0x0002)       /* Timer A counter interrupt enable */
2776
#define TAIFG                  (0x0001)       /* Timer A counter interrupt flag */
2777
 
2778
#define MC_0                   (0*0x10u)      /* Timer A mode control: 0 - Stop */
2779
#define MC_1                   (1*0x10u)      /* Timer A mode control: 1 - Up to CCR0 */
2780
#define MC_2                   (2*0x10u)      /* Timer A mode control: 2 - Continous up */
2781
#define MC_3                   (3*0x10u)      /* Timer A mode control: 3 - Up/Down */
2782
#define ID_0                   (0*0x40u)      /* Timer A input divider: 0 - /1 */
2783
#define ID_1                   (1*0x40u)      /* Timer A input divider: 1 - /2 */
2784
#define ID_2                   (2*0x40u)      /* Timer A input divider: 2 - /4 */
2785
#define ID_3                   (3*0x40u)      /* Timer A input divider: 3 - /8 */
2786
#define TASSEL_0               (0*0x100u)     /* Timer A clock source select: 0 - TACLK */
2787
#define TASSEL_1               (1*0x100u)     /* Timer A clock source select: 1 - ACLK  */
2788
#define TASSEL_2               (2*0x100u)     /* Timer A clock source select: 2 - SMCLK */
2789
#define TASSEL_3               (3*0x100u)     /* Timer A clock source select: 3 - INCLK */
2790
#define MC__STOP               (0*0x10u)      /* Timer A mode control: 0 - Stop */
2791
#define MC__UP                 (1*0x10u)      /* Timer A mode control: 1 - Up to CCR0 */
2792
#define MC__CONTINOUS          (2*0x10u)      /* Timer A mode control: 2 - Continous up */
2793
#define MC__UPDOWN             (3*0x10u)      /* Timer A mode control: 3 - Up/Down */
2794
#define ID__1                  (0*0x40u)      /* Timer A input divider: 0 - /1 */
2795
#define ID__2                  (1*0x40u)      /* Timer A input divider: 1 - /2 */
2796
#define ID__4                  (2*0x40u)      /* Timer A input divider: 2 - /4 */
2797
#define ID__8                  (3*0x40u)      /* Timer A input divider: 3 - /8 */
2798
#define TASSEL__TACLK          (0*0x100u)     /* Timer A clock source select: 0 - TACLK */
2799
#define TASSEL__ACLK           (1*0x100u)     /* Timer A clock source select: 1 - ACLK  */
2800
#define TASSEL__SMCLK          (2*0x100u)     /* Timer A clock source select: 2 - SMCLK */
2801
#define TASSEL__INCLK          (3*0x100u)     /* Timer A clock source select: 3 - INCLK */
2802
 
2803
/* TAxCCTLx Control Bits */
2804
#define CM1                    (0x8000)       /* Capture mode 1 */
2805
#define CM0                    (0x4000)       /* Capture mode 0 */
2806
#define CCIS1                  (0x2000)       /* Capture input select 1 */
2807
#define CCIS0                  (0x1000)       /* Capture input select 0 */
2808
#define SCS                    (0x0800)       /* Capture sychronize */
2809
#define SCCI                   (0x0400)       /* Latched capture signal (read) */
2810
#define CAP                    (0x0100)       /* Capture mode: 1 /Compare mode : 0 */
2811
#define OUTMOD2                (0x0080)       /* Output mode 2 */
2812
#define OUTMOD1                (0x0040)       /* Output mode 1 */
2813
#define OUTMOD0                (0x0020)       /* Output mode 0 */
2814
#define CCIE                   (0x0010)       /* Capture/compare interrupt enable */
2815
#define CCI                    (0x0008)       /* Capture input signal (read) */
2816
#define OUT                    (0x0004)       /* PWM Output signal if output mode 0 */
2817
#define COV                    (0x0002)       /* Capture/compare overflow flag */
2818
#define CCIFG                  (0x0001)       /* Capture/compare interrupt flag */
2819
 
2820
#define OUTMOD_0               (0*0x20u)      /* PWM output mode: 0 - output only */
2821
#define OUTMOD_1               (1*0x20u)      /* PWM output mode: 1 - set */
2822
#define OUTMOD_2               (2*0x20u)      /* PWM output mode: 2 - PWM toggle/reset */
2823
#define OUTMOD_3               (3*0x20u)      /* PWM output mode: 3 - PWM set/reset */
2824
#define OUTMOD_4               (4*0x20u)      /* PWM output mode: 4 - toggle */
2825
#define OUTMOD_5               (5*0x20u)      /* PWM output mode: 5 - Reset */
2826
#define OUTMOD_6               (6*0x20u)      /* PWM output mode: 6 - PWM toggle/set */
2827
#define OUTMOD_7               (7*0x20u)      /* PWM output mode: 7 - PWM reset/set */
2828
#define CCIS_0                 (0*0x1000u)    /* Capture input select: 0 - CCIxA */
2829
#define CCIS_1                 (1*0x1000u)    /* Capture input select: 1 - CCIxB */
2830
#define CCIS_2                 (2*0x1000u)    /* Capture input select: 2 - GND */
2831
#define CCIS_3                 (3*0x1000u)    /* Capture input select: 3 - Vcc */
2832
#define CM_0                   (0*0x4000u)    /* Capture mode: 0 - disabled */
2833
#define CM_1                   (1*0x4000u)    /* Capture mode: 1 - pos. edge */
2834
#define CM_2                   (2*0x4000u)    /* Capture mode: 1 - neg. edge */
2835
#define CM_3                   (3*0x4000u)    /* Capture mode: 1 - both edges */
2836
 
2837
/* TAxEX0 Control Bits */
2838
#define TAIDEX0                (0x0001)       /* Timer A Input divider expansion Bit: 0 */
2839
#define TAIDEX1                (0x0002)       /* Timer A Input divider expansion Bit: 1 */
2840
#define TAIDEX2                (0x0004)       /* Timer A Input divider expansion Bit: 2 */
2841
 
2842
#define TAIDEX_0               (0*0x0001u)    /* Timer A Input divider expansion : /1 */
2843
#define TAIDEX_1               (1*0x0001u)    /* Timer A Input divider expansion : /2 */
2844
#define TAIDEX_2               (2*0x0001u)    /* Timer A Input divider expansion : /3 */
2845
#define TAIDEX_3               (3*0x0001u)    /* Timer A Input divider expansion : /4 */
2846
#define TAIDEX_4               (4*0x0001u)    /* Timer A Input divider expansion : /5 */
2847
#define TAIDEX_5               (5*0x0001u)    /* Timer A Input divider expansion : /6 */
2848
#define TAIDEX_6               (6*0x0001u)    /* Timer A Input divider expansion : /7 */
2849
#define TAIDEX_7               (7*0x0001u)    /* Timer A Input divider expansion : /8 */
2850
 
2851
/* T0A5IV Definitions */
2852
#define TA0IV_NONE             (0x0000)       /* No Interrupt pending */
2853
#define TA0IV_TA0CCR1          (0x0002)       /* TA0CCR1_CCIFG */
2854
#define TA0IV_TA0CCR2          (0x0004)       /* TA0CCR2_CCIFG */
2855
#define TA0IV_TA0CCR3          (0x0006)       /* TA0CCR3_CCIFG */
2856
#define TA0IV_TA0CCR4          (0x0008)       /* TA0CCR4_CCIFG */
2857
#define TA0IV_5                (0x000A)       /* Reserved */
2858
#define TA0IV_6                (0x000C)       /* Reserved */
2859
#define TA0IV_TA0IFG           (0x000E)       /* TA0IFG */
2860
 
2861
/************************************************************
2862
* Timer1_A3
2863
************************************************************/
2864
#define __MSP430_HAS_T1A3__                   /* Definition to show that Module is available */
2865
#define __MSP430_BASEADDRESS_T1A3__ 0x0380
2866
 
2867
SFR_16BIT(TA1CTL);                            /* Timer1_A3 Control */
2868
SFR_16BIT(TA1CCTL0);                          /* Timer1_A3 Capture/Compare Control 0 */
2869
SFR_16BIT(TA1CCTL1);                          /* Timer1_A3 Capture/Compare Control 1 */
2870
SFR_16BIT(TA1CCTL2);                          /* Timer1_A3 Capture/Compare Control 2 */
2871
SFR_16BIT(TA1R);                              /* Timer1_A3 */
2872
SFR_16BIT(TA1CCR0);                           /* Timer1_A3 Capture/Compare 0 */
2873
SFR_16BIT(TA1CCR1);                           /* Timer1_A3 Capture/Compare 1 */
2874
SFR_16BIT(TA1CCR2);                           /* Timer1_A3 Capture/Compare 2 */
2875
SFR_16BIT(TA1IV);                             /* Timer1_A3 Interrupt Vector Word */
2876
SFR_16BIT(TA1EX0);                            /* Timer1_A3 Expansion Register 0 */
2877
 
2878
/* Bits are already defined within the Timer0_Ax */
2879
 
2880
/* TA1IV Definitions */
2881
#define TA1IV_NONE             (0x0000)       /* No Interrupt pending */
2882
#define TA1IV_TA1CCR1          (0x0002)       /* TA1CCR1_CCIFG */
2883
#define TA1IV_TA1CCR2          (0x0004)       /* TA1CCR2_CCIFG */
2884
#define TA1IV_3                (0x0006)       /* Reserved */
2885
#define TA1IV_4                (0x0008)       /* Reserved */
2886
#define TA1IV_5                (0x000A)       /* Reserved */
2887
#define TA1IV_6                (0x000C)       /* Reserved */
2888
#define TA1IV_TA1IFG           (0x000E)       /* TA1IFG */
2889
 
2890
/************************************************************
2891
* Timer2_A3
2892
************************************************************/
2893
#define __MSP430_HAS_T2A3__                   /* Definition to show that Module is available */
2894
#define __MSP430_BASEADDRESS_T2A3__ 0x0400
2895
 
2896
SFR_16BIT(TA2CTL);                            /* Timer2_A3 Control */
2897
SFR_16BIT(TA2CCTL0);                          /* Timer2_A3 Capture/Compare Control 0 */
2898
SFR_16BIT(TA2CCTL1);                          /* Timer2_A3 Capture/Compare Control 1 */
2899
SFR_16BIT(TA2CCTL2);                          /* Timer2_A3 Capture/Compare Control 2 */
2900
SFR_16BIT(TA2R);                              /* Timer2_A3 */
2901
SFR_16BIT(TA2CCR0);                           /* Timer2_A3 Capture/Compare 0 */
2902
SFR_16BIT(TA2CCR1);                           /* Timer2_A3 Capture/Compare 1 */
2903
SFR_16BIT(TA2CCR2);                           /* Timer2_A3 Capture/Compare 2 */
2904
SFR_16BIT(TA2IV);                             /* Timer2_A3 Interrupt Vector Word */
2905
SFR_16BIT(TA2EX0);                            /* Timer2_A3 Expansion Register 0 */
2906
 
2907
/* Bits are already defined within the Timer0_Ax */
2908
 
2909
/* TA2IV Definitions */
2910
#define TA2IV_NONE             (0x0000)       /* No Interrupt pending */
2911
#define TA2IV_TA1CCR1          (0x0002)       /* TA2CCR1_CCIFG */
2912
#define TA2IV_TA1CCR2          (0x0004)       /* TA2CCR2_CCIFG */
2913
#define TA2IV_3                (0x0006)       /* Reserved */
2914
#define TA2IV_4                (0x0008)       /* Reserved */
2915
#define TA2IV_5                (0x000A)       /* Reserved */
2916
#define TA2IV_6                (0x000C)       /* Reserved */
2917
#define TA2IV_TA2IFG           (0x000E)       /* TA2IFG */
2918
 
2919
/************************************************************
2920
* Timer0_B7
2921
************************************************************/
2922
#define __MSP430_HAS_T0B7__                   /* Definition to show that Module is available */
2923
#define __MSP430_BASEADDRESS_T0B7__ 0x03C0
2924
 
2925
SFR_16BIT(TB0CTL);                            /* Timer0_B7 Control */
2926
SFR_16BIT(TB0CCTL0);                          /* Timer0_B7 Capture/Compare Control 0 */
2927
SFR_16BIT(TB0CCTL1);                          /* Timer0_B7 Capture/Compare Control 1 */
2928
SFR_16BIT(TB0CCTL2);                          /* Timer0_B7 Capture/Compare Control 2 */
2929
SFR_16BIT(TB0CCTL3);                          /* Timer0_B7 Capture/Compare Control 3 */
2930
SFR_16BIT(TB0CCTL4);                          /* Timer0_B7 Capture/Compare Control 4 */
2931
SFR_16BIT(TB0CCTL5);                          /* Timer0_B7 Capture/Compare Control 5 */
2932
SFR_16BIT(TB0CCTL6);                          /* Timer0_B7 Capture/Compare Control 6 */
2933
SFR_16BIT(TB0R);                              /* Timer0_B7 */
2934
SFR_16BIT(TB0CCR0);                           /* Timer0_B7 Capture/Compare 0 */
2935
SFR_16BIT(TB0CCR1);                           /* Timer0_B7 Capture/Compare 1 */
2936
SFR_16BIT(TB0CCR2);                           /* Timer0_B7 Capture/Compare 2 */
2937
SFR_16BIT(TB0CCR3);                           /* Timer0_B7 Capture/Compare 3 */
2938
SFR_16BIT(TB0CCR4);                           /* Timer0_B7 Capture/Compare 4 */
2939
SFR_16BIT(TB0CCR5);                           /* Timer0_B7 Capture/Compare 5 */
2940
SFR_16BIT(TB0CCR6);                           /* Timer0_B7 Capture/Compare 6 */
2941
SFR_16BIT(TB0EX0);                            /* Timer0_B7 Expansion Register 0 */
2942
SFR_16BIT(TB0IV);                             /* Timer0_B7 Interrupt Vector Word */
2943
 
2944
/* Legacy Type Definitions for TimerB */
2945
#define TBCTL                  TB0CTL         /* Timer0_B7 Control */
2946
#define TBCCTL0                TB0CCTL0       /* Timer0_B7 Capture/Compare Control 0 */
2947
#define TBCCTL1                TB0CCTL1       /* Timer0_B7 Capture/Compare Control 1 */
2948
#define TBCCTL2                TB0CCTL2       /* Timer0_B7 Capture/Compare Control 2 */
2949
#define TBCCTL3                TB0CCTL3       /* Timer0_B7 Capture/Compare Control 3 */
2950
#define TBCCTL4                TB0CCTL4       /* Timer0_B7 Capture/Compare Control 4 */
2951
#define TBCCTL5                TB0CCTL5       /* Timer0_B7 Capture/Compare Control 5 */
2952
#define TBCCTL6                TB0CCTL6       /* Timer0_B7 Capture/Compare Control 6 */
2953
#define TBR                    TB0R           /* Timer0_B7 */
2954
#define TBCCR0                 TB0CCR0        /* Timer0_B7 Capture/Compare 0 */
2955
#define TBCCR1                 TB0CCR1        /* Timer0_B7 Capture/Compare 1 */
2956
#define TBCCR2                 TB0CCR2        /* Timer0_B7 Capture/Compare 2 */
2957
#define TBCCR3                 TB0CCR3        /* Timer0_B7 Capture/Compare 3 */
2958
#define TBCCR4                 TB0CCR4        /* Timer0_B7 Capture/Compare 4 */
2959
#define TBCCR5                 TB0CCR5        /* Timer0_B7 Capture/Compare 5 */
2960
#define TBCCR6                 TB0CCR6        /* Timer0_B7 Capture/Compare 6 */
2961
#define TBEX0                  TB0EX0         /* Timer0_B7 Expansion Register 0 */
2962
#define TBIV                   TB0IV          /* Timer0_B7 Interrupt Vector Word */
2963
#define TIMERB1_VECTOR       TIMER0_B1_VECTOR /* Timer0_B7 CC1-6, TB */
2964
#define TIMERB0_VECTOR       TIMER0_B0_VECTOR /* Timer0_B7 CC0 */
2965
 
2966
/* TBxCTL Control Bits */
2967
#define TBCLGRP1               (0x4000)       /* Timer0_B7 Compare latch load group 1 */
2968
#define TBCLGRP0               (0x2000)       /* Timer0_B7 Compare latch load group 0 */
2969
#define CNTL1                  (0x1000)       /* Counter lenght 1 */
2970
#define CNTL0                  (0x0800)       /* Counter lenght 0 */
2971
#define TBSSEL1                (0x0200)       /* Clock source 1 */
2972
#define TBSSEL0                (0x0100)       /* Clock source 0 */
2973
#define TBCLR                  (0x0004)       /* Timer0_B7 counter clear */
2974
#define TBIE                   (0x0002)       /* Timer0_B7 interrupt enable */
2975
#define TBIFG                  (0x0001)       /* Timer0_B7 interrupt flag */
2976
 
2977
#define SHR1                   (0x4000)       /* Timer0_B7 Compare latch load group 1 */
2978
#define SHR0                   (0x2000)       /* Timer0_B7 Compare latch load group 0 */
2979
 
2980
#define TBSSEL_0               (0*0x0100u)    /* Clock Source: TBCLK */
2981
#define TBSSEL_1               (1*0x0100u)    /* Clock Source: ACLK  */
2982
#define TBSSEL_2               (2*0x0100u)    /* Clock Source: SMCLK */
2983
#define TBSSEL_3               (3*0x0100u)    /* Clock Source: INCLK */
2984
#define CNTL_0                 (0*0x0800u)    /* Counter lenght: 16 bit */
2985
#define CNTL_1                 (1*0x0800u)    /* Counter lenght: 12 bit */
2986
#define CNTL_2                 (2*0x0800u)    /* Counter lenght: 10 bit */
2987
#define CNTL_3                 (3*0x0800u)    /* Counter lenght:  8 bit */
2988
#define SHR_0                  (0*0x2000u)    /* Timer0_B7 Group: 0 - individually */
2989
#define SHR_1                  (1*0x2000u)    /* Timer0_B7 Group: 1 - 3 groups (1-2, 3-4, 5-6) */
2990
#define SHR_2                  (2*0x2000u)    /* Timer0_B7 Group: 2 - 2 groups (1-3, 4-6)*/
2991
#define SHR_3                  (3*0x2000u)    /* Timer0_B7 Group: 3 - 1 group (all) */
2992
#define TBCLGRP_0              (0*0x2000u)    /* Timer0_B7 Group: 0 - individually */
2993
#define TBCLGRP_1              (1*0x2000u)    /* Timer0_B7 Group: 1 - 3 groups (1-2, 3-4, 5-6) */
2994
#define TBCLGRP_2              (2*0x2000u)    /* Timer0_B7 Group: 2 - 2 groups (1-3, 4-6)*/
2995
#define TBCLGRP_3              (3*0x2000u)    /* Timer0_B7 Group: 3 - 1 group (all) */
2996
#define TBSSEL__TACLK          (0*0x100u)     /* Timer0_B7 clock source select: 0 - TACLK */
2997
#define TBSSEL__ACLK           (1*0x100u)     /* Timer0_B7 clock source select: 1 - ACLK  */
2998
#define TBSSEL__SMCLK          (2*0x100u)     /* Timer0_B7 clock source select: 2 - SMCLK */
2999
#define TBSSEL__INCLK          (3*0x100u)     /* Timer0_B7 clock source select: 3 - INCLK */
3000
#define CNTL__16               (0*0x0800u)    /* Counter lenght: 16 bit */
3001
#define CNTL__12               (1*0x0800u)    /* Counter lenght: 12 bit */
3002
#define CNTL__10               (2*0x0800u)    /* Counter lenght: 10 bit */
3003
#define CNTL__8                (3*0x0800u)    /* Counter lenght:  8 bit */
3004
 
3005
/* Additional Timer B Control Register bits are defined in Timer A */
3006
/* TBxCCTLx Control Bits */
3007
#define CLLD1                  (0x0400)       /* Compare latch load source 1 */
3008
#define CLLD0                  (0x0200)       /* Compare latch load source 0 */
3009
 
3010
#define SLSHR1                 (0x0400)       /* Compare latch load source 1 */
3011
#define SLSHR0                 (0x0200)       /* Compare latch load source 0 */
3012
 
3013
#define SLSHR_0                (0*0x0200u)    /* Compare latch load sourec : 0 - immediate */
3014
#define SLSHR_1                (1*0x0200u)    /* Compare latch load sourec : 1 - TBR counts to 0 */
3015
#define SLSHR_2                (2*0x0200u)    /* Compare latch load sourec : 2 - up/down */
3016
#define SLSHR_3                (3*0x0200u)    /* Compare latch load sourec : 3 - TBR counts to TBCTL0 */
3017
 
3018
#define CLLD_0                 (0*0x0200u)    /* Compare latch load sourec : 0 - immediate */
3019
#define CLLD_1                 (1*0x0200u)    /* Compare latch load sourec : 1 - TBR counts to 0 */
3020
#define CLLD_2                 (2*0x0200u)    /* Compare latch load sourec : 2 - up/down */
3021
#define CLLD_3                 (3*0x0200u)    /* Compare latch load sourec : 3 - TBR counts to TBCTL0 */
3022
 
3023
/* TBxEX0 Control Bits */
3024
#define TBIDEX0                (0x0001)       /* Timer0_B7 Input divider expansion Bit: 0 */
3025
#define TBIDEX1                (0x0002)       /* Timer0_B7 Input divider expansion Bit: 1 */
3026
#define TBIDEX2                (0x0004)       /* Timer0_B7 Input divider expansion Bit: 2 */
3027
 
3028
#define TBIDEX_0               (0*0x0001u)    /* Timer0_B7 Input divider expansion : /1 */
3029
#define TBIDEX_1               (1*0x0001u)    /* Timer0_B7 Input divider expansion : /2 */
3030
#define TBIDEX_2               (2*0x0001u)    /* Timer0_B7 Input divider expansion : /3 */
3031
#define TBIDEX_3               (3*0x0001u)    /* Timer0_B7 Input divider expansion : /4 */
3032
#define TBIDEX_4               (4*0x0001u)    /* Timer0_B7 Input divider expansion : /5 */
3033
#define TBIDEX_5               (5*0x0001u)    /* Timer0_B7 Input divider expansion : /6 */
3034
#define TBIDEX_6               (6*0x0001u)    /* Timer0_B7 Input divider expansion : /7 */
3035
#define TBIDEX_7               (7*0x0001u)    /* Timer0_B7 Input divider expansion : /8 */
3036
#define TBIDEX__1              (0*0x0001u)    /* Timer0_B7 Input divider expansion : /1 */
3037
#define TBIDEX__2              (1*0x0001u)    /* Timer0_B7 Input divider expansion : /2 */
3038
#define TBIDEX__3              (2*0x0001u)    /* Timer0_B7 Input divider expansion : /3 */
3039
#define TBIDEX__4              (3*0x0001u)    /* Timer0_B7 Input divider expansion : /4 */
3040
#define TBIDEX__5              (4*0x0001u)    /* Timer0_B7 Input divider expansion : /5 */
3041
#define TBIDEX__6              (5*0x0001u)    /* Timer0_B7 Input divider expansion : /6 */
3042
#define TBIDEX__7              (6*0x0001u)    /* Timer0_B7 Input divider expansion : /7 */
3043
#define TBIDEX__8              (7*0x0001u)    /* Timer0_B7 Input divider expansion : /8 */
3044
 
3045
/* TB0IV Definitions */
3046
#define TB0IV_NONE             (0x0000)       /* No Interrupt pending */
3047
#define TB0IV_TB1CCR1          (0x0002)       /* TBCCR1_CCIFG */
3048
#define TB0IV_TB1CCR2          (0x0004)       /* TBCCR2_CCIFG */
3049
#define TB0IV_3                (0x0006)       /* Reserved */
3050
#define TB0IV_4                (0x0008)       /* Reserved */
3051
#define TB0IV_5                (0x000A)       /* Reserved */
3052
#define TB0IV_6                (0x000C)       /* Reserved */
3053
#define TB0IV_TB0IFG           (0x000E)       /* TBIFG */
3054
 
3055
 
3056
/************************************************************
3057
* USB
3058
************************************************************/
3059
#define __MSP430_HAS_USB__                    /* Definition to show that Module is available */
3060
#define __MSP430_BASEADDRESS_USB__ 0x0900
3061
 
3062
/* ========================================================================= */
3063
/* USB Configuration Registers */
3064
/* ========================================================================= */
3065
SFR_16BIT(USBKEYID);                          /* USB Controller key register */
3066
SFR_8BIT(USBKEYID_L);                         /* USB Controller key register */
3067
SFR_8BIT(USBKEYID_H);                         /* USB Controller key register */
3068
SFR_16BIT(USBCNF);                            /* USB Module  configuration register */
3069
SFR_8BIT(USBCNF_L);                           /* USB Module  configuration register */
3070
SFR_8BIT(USBCNF_H);                           /* USB Module  configuration register */
3071
SFR_16BIT(USBPHYCTL);                         /* USB PHY control register */
3072
SFR_8BIT(USBPHYCTL_L);                        /* USB PHY control register */
3073
SFR_8BIT(USBPHYCTL_H);                        /* USB PHY control register */
3074
SFR_16BIT(USBPWRCTL);                         /* USB Power control register */
3075
SFR_8BIT(USBPWRCTL_L);                        /* USB Power control register */
3076
SFR_8BIT(USBPWRCTL_H);                        /* USB Power control register */
3077
SFR_16BIT(USBPLLCTL);                         /* USB PLL control register */
3078
SFR_8BIT(USBPLLCTL_L);                        /* USB PLL control register */
3079
SFR_8BIT(USBPLLCTL_H);                        /* USB PLL control register */
3080
SFR_16BIT(USBPLLDIVB);                        /* USB PLL Clock Divider Buffer control register */
3081
SFR_8BIT(USBPLLDIVB_L);                       /* USB PLL Clock Divider Buffer control register */
3082
SFR_8BIT(USBPLLDIVB_H);                       /* USB PLL Clock Divider Buffer control register */
3083
SFR_16BIT(USBPLLIR);                          /* USB PLL Interrupt control register */
3084
SFR_8BIT(USBPLLIR_L);                         /* USB PLL Interrupt control register */
3085
SFR_8BIT(USBPLLIR_H);                         /* USB PLL Interrupt control register */
3086
 
3087
#define USBKEYPID              USBKEYID       /* Legacy Definition: USB Controller key register */
3088
#define USBKEY                 (0x9628)       /* USB Control Register key */
3089
 
3090
/* USBCNF Control Bits */
3091
#define USB_EN                 (0x0001)       /* USB - Module enable */
3092
#define PUR_EN                 (0x0002)       /* USB - PUR pin enable */
3093
#define PUR_IN                 (0x0004)       /* USB - PUR pin input value */
3094
#define BLKRDY                 (0x0008)       /* USB - Block ready signal for DMA */
3095
#define FNTEN                  (0x0010)       /* USB - Frame Number receive Trigger enable for DMA */
3096
//#define RESERVED            (0x0020)  /* USB -  */
3097
//#define RESERVED            (0x0040)  /* USB -  */
3098
//#define RESERVED            (0x0080)  /* USB -  */
3099
//#define RESERVED            (0x0100)  /* USB -  */
3100
//#define RESERVED            (0x0200)  /* USB -  */
3101
//#define RESERVED            (0x0400)  /* USB -  */
3102
//#define RESERVED            (0x0800)  /* USB -  */
3103
//#define RESERVED            (0x1000)  /* USB -  */
3104
//#define RESERVED            (0x2000)  /* USB -  */
3105
//#define RESERVED            (0x4000)  /* USB -  */
3106
//#define RESERVED            (0x8000)  /* USB -  */
3107
 
3108
/* USBCNF Control Bits */
3109
#define USB_EN_L               (0x0001)       /* USB - Module enable */
3110
#define PUR_EN_L               (0x0002)       /* USB - PUR pin enable */
3111
#define PUR_IN_L               (0x0004)       /* USB - PUR pin input value */
3112
#define BLKRDY_L               (0x0008)       /* USB - Block ready signal for DMA */
3113
#define FNTEN_L                (0x0010)       /* USB - Frame Number receive Trigger enable for DMA */
3114
//#define RESERVED            (0x0020)  /* USB -  */
3115
//#define RESERVED            (0x0040)  /* USB -  */
3116
//#define RESERVED            (0x0080)  /* USB -  */
3117
//#define RESERVED            (0x0100)  /* USB -  */
3118
//#define RESERVED            (0x0200)  /* USB -  */
3119
//#define RESERVED            (0x0400)  /* USB -  */
3120
//#define RESERVED            (0x0800)  /* USB -  */
3121
//#define RESERVED            (0x1000)  /* USB -  */
3122
//#define RESERVED            (0x2000)  /* USB -  */
3123
//#define RESERVED            (0x4000)  /* USB -  */
3124
//#define RESERVED            (0x8000)  /* USB -  */
3125
 
3126
/* USBCNF Control Bits */
3127
//#define RESERVED            (0x0020)  /* USB -  */
3128
//#define RESERVED            (0x0040)  /* USB -  */
3129
//#define RESERVED            (0x0080)  /* USB -  */
3130
//#define RESERVED            (0x0100)  /* USB -  */
3131
//#define RESERVED            (0x0200)  /* USB -  */
3132
//#define RESERVED            (0x0400)  /* USB -  */
3133
//#define RESERVED            (0x0800)  /* USB -  */
3134
//#define RESERVED            (0x1000)  /* USB -  */
3135
//#define RESERVED            (0x2000)  /* USB -  */
3136
//#define RESERVED            (0x4000)  /* USB -  */
3137
//#define RESERVED            (0x8000)  /* USB -  */
3138
 
3139
/* USBPHYCTL Control Bits */
3140
#define PUOUT0                 (0x0001)       /* USB - USB Port Output Signal Bit 0 */
3141
#define PUOUT1                 (0x0002)       /* USB - USB Port Output Signal Bit 1 */
3142
#define PUIN0                  (0x0004)       /* USB - PU0/DP Input Data */
3143
#define PUIN1                  (0x0008)       /* USB - PU1/DM Input Data */
3144
//#define RESERVED            (0x0010)  /* USB -  */
3145
#define PUOPE                  (0x0020)       /* USB - USB Port Output Enable */
3146
//#define RESERVED            (0x0040)  /* USB -  */
3147
#define PUSEL                  (0x0080)       /* USB - USB Port Function Select */
3148
#define PUIPE                  (0x0100)       /* USB - PHY Single Ended Input enable */
3149
//#define RESERVED            (0x0200)  /* USB -  */
3150
//#define RESERVED            (0x0100)  /* USB -  */
3151
//#define RESERVED            (0x0200)  /* USB -  */
3152
//#define RESERVED            (0x0400)  /* USB -  */
3153
//#define RESERVED            (0x0800)  /* USB -  */
3154
//#define RESERVED            (0x1000)  /* USB -  */
3155
//#define RESERVED            (0x2000)  /* USB -  */
3156
//#define RESERVED            (0x4000)  /* USB -  */
3157
//#define RESERVED            (0x8000)  /* USB -  */
3158
 
3159
/* USBPHYCTL Control Bits */
3160
#define PUOUT0_L               (0x0001)       /* USB - USB Port Output Signal Bit 0 */
3161
#define PUOUT1_L               (0x0002)       /* USB - USB Port Output Signal Bit 1 */
3162
#define PUIN0_L                (0x0004)       /* USB - PU0/DP Input Data */
3163
#define PUIN1_L                (0x0008)       /* USB - PU1/DM Input Data */
3164
//#define RESERVED            (0x0010)  /* USB -  */
3165
#define PUOPE_L                (0x0020)       /* USB - USB Port Output Enable */
3166
//#define RESERVED            (0x0040)  /* USB -  */
3167
#define PUSEL_L                (0x0080)       /* USB - USB Port Function Select */
3168
//#define RESERVED            (0x0200)  /* USB -  */
3169
//#define RESERVED            (0x0100)  /* USB -  */
3170
//#define RESERVED            (0x0200)  /* USB -  */
3171
//#define RESERVED            (0x0400)  /* USB -  */
3172
//#define RESERVED            (0x0800)  /* USB -  */
3173
//#define RESERVED            (0x1000)  /* USB -  */
3174
//#define RESERVED            (0x2000)  /* USB -  */
3175
//#define RESERVED            (0x4000)  /* USB -  */
3176
//#define RESERVED            (0x8000)  /* USB -  */
3177
 
3178
/* USBPHYCTL Control Bits */
3179
//#define RESERVED            (0x0010)  /* USB -  */
3180
//#define RESERVED            (0x0040)  /* USB -  */
3181
#define PUIPE_H                (0x0001)       /* USB - PHY Single Ended Input enable */
3182
//#define RESERVED            (0x0200)  /* USB -  */
3183
//#define RESERVED            (0x0100)  /* USB -  */
3184
//#define RESERVED            (0x0200)  /* USB -  */
3185
//#define RESERVED            (0x0400)  /* USB -  */
3186
//#define RESERVED            (0x0800)  /* USB -  */
3187
//#define RESERVED            (0x1000)  /* USB -  */
3188
//#define RESERVED            (0x2000)  /* USB -  */
3189
//#define RESERVED            (0x4000)  /* USB -  */
3190
//#define RESERVED            (0x8000)  /* USB -  */
3191
 
3192
#define PUDIR                  (0x0020)       /* USB - Legacy Definition: USB Port Output Enable */
3193
#define PSEIEN                 (0x0100)       /* USB - Legacy Definition: PHY Single Ended Input enable */
3194
 
3195
/* USBPWRCTL Control Bits */
3196
#define VUOVLIFG               (0x0001)       /* USB - VUSB Overload Interrupt Flag */
3197
#define VBONIFG                (0x0002)       /* USB - VBUS "Coming ON" Interrupt Flag */
3198
#define VBOFFIFG               (0x0004)       /* USB - VBUS "Going OFF" Interrupt Flag */
3199
#define USBBGVBV               (0x0008)       /* USB - USB Bandgap and VBUS valid */
3200
#define USBDETEN               (0x0010)       /* USB - VBUS on/off events enable */
3201
#define OVLAOFF                (0x0020)       /* USB - LDO overload auto off enable */
3202
#define SLDOAON                (0x0040)       /* USB - Secondary LDO auto on enable */
3203
//#define RESERVED            (0x0080)  /* USB -  */
3204
#define VUOVLIE                (0x0100)       /* USB - Overload indication Interrupt Enable */
3205
#define VBONIE                 (0x0200)       /* USB - VBUS "Coming ON" Interrupt Enable */
3206
#define VBOFFIE                (0x0400)       /* USB - VBUS "Going OFF" Interrupt Enable */
3207
#define VUSBEN                 (0x0800)       /* USB - LDO Enable (3.3V) */
3208
#define SLDOEN                 (0x1000)       /* USB - Secondary LDO Enable (1.8V) */
3209
//#define RESERVED            (0x2000)  /* USB -  */
3210
//#define RESERVED            (0x4000)  /* USB -  */
3211
//#define RESERVED            (0x8000)  /* USB -  */
3212
 
3213
/* USBPWRCTL Control Bits */
3214
#define VUOVLIFG_L             (0x0001)       /* USB - VUSB Overload Interrupt Flag */
3215
#define VBONIFG_L              (0x0002)       /* USB - VBUS "Coming ON" Interrupt Flag */
3216
#define VBOFFIFG_L             (0x0004)       /* USB - VBUS "Going OFF" Interrupt Flag */
3217
#define USBBGVBV_L             (0x0008)       /* USB - USB Bandgap and VBUS valid */
3218
#define USBDETEN_L             (0x0010)       /* USB - VBUS on/off events enable */
3219
#define OVLAOFF_L              (0x0020)       /* USB - LDO overload auto off enable */
3220
#define SLDOAON_L              (0x0040)       /* USB - Secondary LDO auto on enable */
3221
//#define RESERVED            (0x0080)  /* USB -  */
3222
//#define RESERVED            (0x2000)  /* USB -  */
3223
//#define RESERVED            (0x4000)  /* USB -  */
3224
//#define RESERVED            (0x8000)  /* USB -  */
3225
 
3226
/* USBPWRCTL Control Bits */
3227
//#define RESERVED            (0x0080)  /* USB -  */
3228
#define VUOVLIE_H              (0x0001)       /* USB - Overload indication Interrupt Enable */
3229
#define VBONIE_H               (0x0002)       /* USB - VBUS "Coming ON" Interrupt Enable */
3230
#define VBOFFIE_H              (0x0004)       /* USB - VBUS "Going OFF" Interrupt Enable */
3231
#define VUSBEN_H               (0x0008)       /* USB - LDO Enable (3.3V) */
3232
#define SLDOEN_H               (0x0010)       /* USB - Secondary LDO Enable (1.8V) */
3233
//#define RESERVED            (0x2000)  /* USB -  */
3234
//#define RESERVED            (0x4000)  /* USB -  */
3235
//#define RESERVED            (0x8000)  /* USB -  */
3236
 
3237
/* USBPLLCTL Control Bits */
3238
//#define RESERVED            (0x0001)  /* USB -  */
3239
//#define RESERVED            (0x0002)  /* USB -  */
3240
//#define RESERVED            (0x0004)  /* USB -  */
3241
//#define RESERVED            (0x0008)  /* USB -  */
3242
//#define RESERVED            (0x0010)  /* USB -  */
3243
//#define RESERVED            (0x0020)  /* USB -  */
3244
#define UCLKSEL0               (0x0040)       /* USB - Module Clock Select Bit 0 */
3245
#define UCLKSEL1               (0x0080)       /* USB - Module Clock Select Bit 1 */
3246
#define UPLLEN                 (0x0100)       /* USB - PLL enable */
3247
#define UPFDEN                 (0x0200)       /* USB - Phase Freq. Discriminator enable */
3248
//#define RESERVED            (0x0400)  /* USB -  */
3249
//#define RESERVED            (0x0800)  /* USB -  */
3250
#define UPCS0                  (0x1000)       /* USB - PLL Clock Select Bit 0 */
3251
//#define RESERVED            (0x2000)  /* USB -  */
3252
//#define RESERVED            (0x4000)  /* USB -  */
3253
//#define RESERVED            (0x8000)  /* USB -  */
3254
 
3255
/* USBPLLCTL Control Bits */
3256
//#define RESERVED            (0x0001)  /* USB -  */
3257
//#define RESERVED            (0x0002)  /* USB -  */
3258
//#define RESERVED            (0x0004)  /* USB -  */
3259
//#define RESERVED            (0x0008)  /* USB -  */
3260
//#define RESERVED            (0x0010)  /* USB -  */
3261
//#define RESERVED            (0x0020)  /* USB -  */
3262
#define UCLKSEL0_L             (0x0040)       /* USB - Module Clock Select Bit 0 */
3263
#define UCLKSEL1_L             (0x0080)       /* USB - Module Clock Select Bit 1 */
3264
//#define RESERVED            (0x0400)  /* USB -  */
3265
//#define RESERVED            (0x0800)  /* USB -  */
3266
//#define RESERVED            (0x2000)  /* USB -  */
3267
//#define RESERVED            (0x4000)  /* USB -  */
3268
//#define RESERVED            (0x8000)  /* USB -  */
3269
 
3270
/* USBPLLCTL Control Bits */
3271
//#define RESERVED            (0x0001)  /* USB -  */
3272
//#define RESERVED            (0x0002)  /* USB -  */
3273
//#define RESERVED            (0x0004)  /* USB -  */
3274
//#define RESERVED            (0x0008)  /* USB -  */
3275
//#define RESERVED            (0x0010)  /* USB -  */
3276
//#define RESERVED            (0x0020)  /* USB -  */
3277
#define UPLLEN_H               (0x0001)       /* USB - PLL enable */
3278
#define UPFDEN_H               (0x0002)       /* USB - Phase Freq. Discriminator enable */
3279
//#define RESERVED            (0x0400)  /* USB -  */
3280
//#define RESERVED            (0x0800)  /* USB -  */
3281
#define UPCS0_H                (0x0010)       /* USB - PLL Clock Select Bit 0 */
3282
//#define RESERVED            (0x2000)  /* USB -  */
3283
//#define RESERVED            (0x4000)  /* USB -  */
3284
//#define RESERVED            (0x8000)  /* USB -  */
3285
 
3286
#define UCLKSEL_0              (0x0000)       /* USB - Module Clock Select: 0 */
3287
#define UCLKSEL_1              (0x0040)       /* USB - Module Clock Select: 1 */
3288
#define UCLKSEL_2              (0x0080)       /* USB - Module Clock Select: 2 */
3289
#define UCLKSEL_3              (0x00C0)       /* USB - Module Clock Select: 3 (Reserved) */
3290
 
3291
#define UCLKSEL__PLLCLK        (0x0000)       /* USB - Module Clock Select: PLLCLK */
3292
#define UCLKSEL__XT1CLK        (0x0040)       /* USB - Module Clock Select: XT1CLK */
3293
#define UCLKSEL__XT2CLK        (0x0080)       /* USB - Module Clock Select: XT2CLK */
3294
 
3295
/* USBPLLDIVB Control Bits */
3296
#define UPMB0                  (0x0001)       /* USB - PLL feedback divider buffer Bit 0 */
3297
#define UPMB1                  (0x0002)       /* USB - PLL feedback divider buffer Bit 1 */
3298
#define UPMB2                  (0x0004)       /* USB - PLL feedback divider buffer Bit 2 */
3299
#define UPMB3                  (0x0008)       /* USB - PLL feedback divider buffer Bit 3 */
3300
#define UPMB4                  (0x0010)       /* USB - PLL feedback divider buffer Bit 4 */
3301
#define UPMB5                  (0x0020)       /* USB - PLL feedback divider buffer Bit 5 */
3302
//#define RESERVED            (0x0040)  /* USB -  */
3303
//#define RESERVED            (0x0080)  /* USB -  */
3304
#define UPQB0                  (0x0100)       /* USB - PLL prescale divider buffer Bit 0 */
3305
#define UPQB1                  (0x0200)       /* USB - PLL prescale divider buffer Bit 1 */
3306
#define UPQB2                  (0x0400)       /* USB - PLL prescale divider buffer Bit 2 */
3307
//#define RESERVED            (0x0800)  /* USB -  */
3308
//#define RESERVED            (0x1000)  /* USB -  */
3309
//#define RESERVED            (0x2000)  /* USB -  */
3310
//#define RESERVED            (0x4000)  /* USB -  */
3311
//#define RESERVED            (0x8000)  /* USB -  */
3312
 
3313
/* USBPLLDIVB Control Bits */
3314
#define UPMB0_L                (0x0001)       /* USB - PLL feedback divider buffer Bit 0 */
3315
#define UPMB1_L                (0x0002)       /* USB - PLL feedback divider buffer Bit 1 */
3316
#define UPMB2_L                (0x0004)       /* USB - PLL feedback divider buffer Bit 2 */
3317
#define UPMB3_L                (0x0008)       /* USB - PLL feedback divider buffer Bit 3 */
3318
#define UPMB4_L                (0x0010)       /* USB - PLL feedback divider buffer Bit 4 */
3319
#define UPMB5_L                (0x0020)       /* USB - PLL feedback divider buffer Bit 5 */
3320
//#define RESERVED            (0x0040)  /* USB -  */
3321
//#define RESERVED            (0x0080)  /* USB -  */
3322
//#define RESERVED            (0x0800)  /* USB -  */
3323
//#define RESERVED            (0x1000)  /* USB -  */
3324
//#define RESERVED            (0x2000)  /* USB -  */
3325
//#define RESERVED            (0x4000)  /* USB -  */
3326
//#define RESERVED            (0x8000)  /* USB -  */
3327
 
3328
/* USBPLLDIVB Control Bits */
3329
//#define RESERVED            (0x0040)  /* USB -  */
3330
//#define RESERVED            (0x0080)  /* USB -  */
3331
#define UPQB0_H                (0x0001)       /* USB - PLL prescale divider buffer Bit 0 */
3332
#define UPQB1_H                (0x0002)       /* USB - PLL prescale divider buffer Bit 1 */
3333
#define UPQB2_H                (0x0004)       /* USB - PLL prescale divider buffer Bit 2 */
3334
//#define RESERVED            (0x0800)  /* USB -  */
3335
//#define RESERVED            (0x1000)  /* USB -  */
3336
//#define RESERVED            (0x2000)  /* USB -  */
3337
//#define RESERVED            (0x4000)  /* USB -  */
3338
//#define RESERVED            (0x8000)  /* USB -  */
3339
 
3340
#define USBPLL_SETCLK_1_5      (UPMB0*31      | UPQB0*0)  /* USB - PLL Set for 1.5 MHz input clock */
3341
#define USBPLL_SETCLK_1_6      (UPMB0*29      | UPQB0*0)  /* USB - PLL Set for 1.6 MHz input clock */
3342
#define USBPLL_SETCLK_1_7778   (UPMB0*26      | UPQB0*0)  /* USB - PLL Set for 1.7778 MHz input clock */
3343
#define USBPLL_SETCLK_1_8432   (UPMB0*25      | UPQB0*0)  /* USB - PLL Set for 1.8432 MHz input clock */
3344
#define USBPLL_SETCLK_1_8461   (UPMB0*25      | UPQB0*0)  /* USB - PLL Set for 1.8461 MHz input clock */
3345
#define USBPLL_SETCLK_1_92     (UPMB0*24      | UPQB0*0)  /* USB - PLL Set for 1.92 MHz input clock */
3346
#define USBPLL_SETCLK_2_0      (UPMB0*23      | UPQB0*0)  /* USB - PLL Set for 2.0 MHz input clock */
3347
#define USBPLL_SETCLK_2_4      (UPMB0*19      | UPQB0*0)  /* USB - PLL Set for 2.4 MHz input clock */
3348
#define USBPLL_SETCLK_2_6667   (UPMB0*17      | UPQB0*0)  /* USB - PLL Set for 2.6667 MHz input clock */
3349
#define USBPLL_SETCLK_3_0      (UPMB0*15      | UPQB0*0)  /* USB - PLL Set for 3.0 MHz input clock */
3350
#define USBPLL_SETCLK_3_2      (UPMB0*29      | UPQB0*1)  /* USB - PLL Set for 3.2 MHz input clock */
3351
#define USBPLL_SETCLK_3_5556   (UPMB0*26      | UPQB0*1)  /* USB - PLL Set for 3.5556 MHz input clock */
3352
#define USBPLL_SETCLK_3_579545 (UPMB0*26      | UPQB0*1)  /* USB - PLL Set for 3.579546 MHz input clock */
3353
#define USBPLL_SETCLK_3_84     (UPMB0*24      | UPQB0*1)  /* USB - PLL Set for 3.84 MHz input clock */
3354
#define USBPLL_SETCLK_4_0      (UPMB0*23      | UPQB0*1)  /* USB - PLL Set for 4.0 MHz input clock */
3355
#define USBPLL_SETCLK_4_1739   (UPMB0*22      | UPQB0*1)  /* USB - PLL Set for 4.1739 MHz input clock */
3356
#define USBPLL_SETCLK_4_1943   (UPMB0*22      | UPQB0*1)  /* USB - PLL Set for 4.1943 MHz input clock */
3357
#define USBPLL_SETCLK_4_332    (UPMB0*21      | UPQB0*1)  /* USB - PLL Set for 4.332 MHz input clock */
3358
#define USBPLL_SETCLK_4_3636   (UPMB0*21      | UPQB0*1)  /* USB - PLL Set for 4.3636 MHz input clock */
3359
#define USBPLL_SETCLK_4_5      (UPMB0*31      | UPQB0*2)  /* USB - PLL Set for 4.5 MHz input clock */
3360
#define USBPLL_SETCLK_4_8      (UPMB0*19      | UPQB0*1)  /* USB - PLL Set for 4.8 MHz input clock */
3361
#define USBPLL_SETCLK_5_33     (UPMB0*17      | UPQB0*1)  /* USB - PLL Set for 5.33 MHz input clock */
3362
#define USBPLL_SETCLK_5_76     (UPMB0*24      | UPQB0*2)  /* USB - PLL Set for 5.76 MHz input clock */
3363
#define USBPLL_SETCLK_6_0      (UPMB0*23      | UPQB0*2)  /* USB - PLL Set for 6.0 MHz input clock */
3364
#define USBPLL_SETCLK_6_4      (UPMB0*29      | UPQB0*3)  /* USB - PLL Set for 6.4 MHz input clock */
3365
#define USBPLL_SETCLK_7_2      (UPMB0*19      | UPQB0*2)  /* USB - PLL Set for 7.2 MHz input clock */
3366
#define USBPLL_SETCLK_7_68     (UPMB0*24      | UPQB0*3)  /* USB - PLL Set for 7.68 MHz input clock */
3367
#define USBPLL_SETCLK_8_0      (UPMB0*17      | UPQB0*2)  /* USB - PLL Set for 8.0 MHz input clock */
3368
#define USBPLL_SETCLK_9_0      (UPMB0*15      | UPQB0*2)  /* USB - PLL Set for 9.0 MHz input clock */
3369
#define USBPLL_SETCLK_9_6      (UPMB0*19      | UPQB0*3)  /* USB - PLL Set for 9.6 MHz input clock */
3370
#define USBPLL_SETCLK_10_66    (UPMB0*17      | UPQB0*3)  /* USB - PLL Set for 10.66 MHz input clock */
3371
#define USBPLL_SETCLK_12_0     (UPMB0*15      | UPQB0*3)  /* USB - PLL Set for 12.0 MHz input clock */
3372
#define USBPLL_SETCLK_12_8     (UPMB0*29      | UPQB0*5)  /* USB - PLL Set for 12.8 MHz input clock */
3373
#define USBPLL_SETCLK_14_4     (UPMB0*19      | UPQB0*4)  /* USB - PLL Set for 14.4 MHz input clock */
3374
#define USBPLL_SETCLK_16_0     (UPMB0*17      | UPQB0*4)  /* USB - PLL Set for 16.0 MHz input clock */
3375
#define USBPLL_SETCLK_16_9344  (UPMB0*16      | UPQB0*4)  /* USB - PLL Set for 16.9344 MHz input clock */
3376
#define USBPLL_SETCLK_16_94118 (UPMB0*16      | UPQB0*4)  /* USB - PLL Set for 16.94118 MHz input clock */
3377
#define USBPLL_SETCLK_18_0     (UPMB0*15      | UPQB0*4)  /* USB - PLL Set for 18.0 MHz input clock */
3378
#define USBPLL_SETCLK_19_2     (UPMB0*19      | UPQB0*5)  /* USB - PLL Set for 19.2 MHz input clock */
3379
#define USBPLL_SETCLK_24_0     (UPMB0*15      | UPQB0*5)  /* USB - PLL Set for 24.0 MHz input clock */
3380
#define USBPLL_SETCLK_25_6     (UPMB0*29      | UPQB0*7)  /* USB - PLL Set for 25.6 MHz input clock */
3381
#define USBPLL_SETCLK_26_0     (UPMB0*23      | UPQB0*6)  /* USB - PLL Set for 26.0 MHz input clock */
3382
#define USBPLL_SETCLK_32_0     (UPMB0*23      | UPQB0*7)  /* USB - PLL Set for 32.0 MHz input clock */
3383
 
3384
/* USBPLLIR Control Bits */
3385
#define USBOOLIFG              (0x0001)       /* USB - PLL out of lock Interrupt Flag */
3386
#define USBLOSIFG              (0x0002)       /* USB - PLL loss of signal Interrupt Flag */
3387
#define USBOORIFG              (0x0004)       /* USB - PLL out of range Interrupt Flag */
3388
//#define RESERVED            (0x0008)  /* USB -  */
3389
//#define RESERVED            (0x0010)  /* USB -  */
3390
//#define RESERVED            (0x0020)  /* USB -  */
3391
//#define RESERVED            (0x0040)  /* USB -  */
3392
//#define RESERVED            (0x0080)  /* USB -  */
3393
#define USBOOLIE               (0x0100)       /* USB - PLL out of lock Interrupt enable */
3394
#define USBLOSIE               (0x0200)       /* USB - PLL loss of signal Interrupt enable */
3395
#define USBOORIE               (0x0400)       /* USB - PLL out of range Interrupt enable */
3396
//#define RESERVED            (0x0800)  /* USB -  */
3397
//#define RESERVED            (0x1000)  /* USB -  */
3398
//#define RESERVED            (0x2000)  /* USB -  */
3399
//#define RESERVED            (0x4000)  /* USB -  */
3400
//#define RESERVED            (0x8000)  /* USB -  */
3401
 
3402
/* USBPLLIR Control Bits */
3403
#define USBOOLIFG_L            (0x0001)       /* USB - PLL out of lock Interrupt Flag */
3404
#define USBLOSIFG_L            (0x0002)       /* USB - PLL loss of signal Interrupt Flag */
3405
#define USBOORIFG_L            (0x0004)       /* USB - PLL out of range Interrupt Flag */
3406
//#define RESERVED            (0x0008)  /* USB -  */
3407
//#define RESERVED            (0x0010)  /* USB -  */
3408
//#define RESERVED            (0x0020)  /* USB -  */
3409
//#define RESERVED            (0x0040)  /* USB -  */
3410
//#define RESERVED            (0x0080)  /* USB -  */
3411
//#define RESERVED            (0x0800)  /* USB -  */
3412
//#define RESERVED            (0x1000)  /* USB -  */
3413
//#define RESERVED            (0x2000)  /* USB -  */
3414
//#define RESERVED            (0x4000)  /* USB -  */
3415
//#define RESERVED            (0x8000)  /* USB -  */
3416
 
3417
/* USBPLLIR Control Bits */
3418
//#define RESERVED            (0x0008)  /* USB -  */
3419
//#define RESERVED            (0x0010)  /* USB -  */
3420
//#define RESERVED            (0x0020)  /* USB -  */
3421
//#define RESERVED            (0x0040)  /* USB -  */
3422
//#define RESERVED            (0x0080)  /* USB -  */
3423
#define USBOOLIE_H             (0x0001)       /* USB - PLL out of lock Interrupt enable */
3424
#define USBLOSIE_H             (0x0002)       /* USB - PLL loss of signal Interrupt enable */
3425
#define USBOORIE_H             (0x0004)       /* USB - PLL out of range Interrupt enable */
3426
//#define RESERVED            (0x0800)  /* USB -  */
3427
//#define RESERVED            (0x1000)  /* USB -  */
3428
//#define RESERVED            (0x2000)  /* USB -  */
3429
//#define RESERVED            (0x4000)  /* USB -  */
3430
//#define RESERVED            (0x8000)  /* USB -  */
3431
 
3432
/* ========================================================================= */
3433
/* USB Control Registers */
3434
/* ========================================================================= */
3435
SFR_8BIT(USBIEPCNF_0);                        /* USB Input endpoint_0: Configuration */
3436
SFR_8BIT(USBIEPCNT_0);                        /* USB Input endpoint_0: Byte Count */
3437
SFR_8BIT(USBOEPCNF_0);                        /* USB Output endpoint_0: Configuration */
3438
SFR_8BIT(USBOEPCNT_0);                        /* USB Output endpoint_0: byte count */
3439
SFR_8BIT(USBIEPIE);                           /* USB Input endpoint interrupt enable flags */
3440
SFR_8BIT(USBOEPIE);                           /* USB Output endpoint interrupt enable flags */
3441
SFR_8BIT(USBIEPIFG);                          /* USB Input endpoint interrupt flags */
3442
SFR_8BIT(USBOEPIFG);                          /* USB Output endpoint interrupt flags */
3443
SFR_16BIT(USBVECINT);                         /* USB Vector interrupt register */
3444
SFR_8BIT(USBVECINT_L);                        /* USB Vector interrupt register */
3445
SFR_8BIT(USBVECINT_H);                        /* USB Vector interrupt register */
3446
SFR_16BIT(USBMAINT);                          /* USB maintenance register */
3447
SFR_8BIT(USBMAINT_L);                         /* USB maintenance register */
3448
SFR_8BIT(USBMAINT_H);                         /* USB maintenance register */
3449
SFR_16BIT(USBTSREG);                          /* USB Time Stamp register */
3450
SFR_8BIT(USBTSREG_L);                         /* USB Time Stamp register */
3451
SFR_8BIT(USBTSREG_H);                         /* USB Time Stamp register */
3452
SFR_16BIT(USBFN);                             /* USB Frame number */
3453
SFR_8BIT(USBFN_L);                            /* USB Frame number */
3454
SFR_8BIT(USBFN_H);                            /* USB Frame number */
3455
SFR_8BIT(USBCTL);                             /* USB control register */
3456
SFR_8BIT(USBIE);                              /* USB interrupt enable register */
3457
SFR_8BIT(USBIFG);                             /* USB interrupt flag register */
3458
SFR_8BIT(USBFUNADR);                          /* USB Function address register */
3459
 
3460
#define USBIV                  USBVECINT      /* USB Vector interrupt register (alternate define) */
3461
 
3462
/* USBIEPCNF_0 Control Bits */
3463
/* USBOEPCNF_0 Control Bits */
3464
//#define RESERVED       (0x0001)  /* USB -  */
3465
//#define RESERVED       (0x0001)  /* USB -  */
3466
#define USBIIE                 (0x0004)       /* USB - Transaction Interrupt indication enable */
3467
#define STALL                  (0x0008)       /* USB - Stall Condition */
3468
//#define RESERVED       (0x0010)  /* USB -  */
3469
#define TOGGLE                 (0x0020)       /* USB - Toggle Bit */
3470
//#define RESERVED       (0x0040)  /* USB -  */
3471
#define UBME                   (0x0080)       /* USB - UBM In-Endpoint Enable */
3472
 
3473
/* USBIEPBCNT_0 Control Bits */
3474
/* USBOEPBCNT_0 Control Bits */
3475
#define CNT0                   (0x0001)       /* USB - Byte Count Bit 0 */
3476
#define CNT1                   (0x0001)       /* USB - Byte Count Bit 1 */
3477
#define CNT2                   (0x0004)       /* USB - Byte Count Bit 2 */
3478
#define CNT3                   (0x0008)       /* USB - Byte Count Bit 3 */
3479
//#define RESERVED       (0x0010)  /* USB -  */
3480
//#define RESERVED       (0x0020)  /* USB -  */
3481
//#define RESERVED       (0x0040)  /* USB -  */
3482
#define NAK                    (0x0080)       /* USB - No Acknowledge Status Bit */
3483
 
3484
/* USBMAINT Control Bits */
3485
#define UTIFG                  (0x0001)       /* USB - Timer Interrupt Flag */
3486
#define UTIE                   (0x0002)       /* USB - Timer Interrupt Enable */
3487
//#define RESERVED       (0x0004)  /* USB -  */
3488
//#define RESERVED       (0x0008)  /* USB -  */
3489
//#define RESERVED       (0x0010)  /* USB -  */
3490
//#define RESERVED       (0x0020)  /* USB -  */
3491
//#define RESERVED       (0x0040)  /* USB -  */
3492
//#define RESERVED       (0x0080)  /* USB -  */
3493
#define TSGEN                  (0x0100)       /* USB - Time Stamp Generator Enable */
3494
#define TSESEL0                (0x0200)       /* USB - Time Stamp Event Select Bit 0 */
3495
#define TSESEL1                (0x0400)       /* USB - Time Stamp Event Select Bit 1 */
3496
#define TSE3                   (0x0800)       /* USB - Time Stamp Event #3 Bit */
3497
//#define RESERVED       (0x1000)  /* USB -  */
3498
#define UTSEL0                 (0x2000)       /* USB - Timer Select Bit 0 */
3499
#define UTSEL1                 (0x4000)       /* USB - Timer Select Bit 1 */
3500
#define UTSEL2                 (0x8000)       /* USB - Timer Select Bit 2 */
3501
 
3502
/* USBMAINT Control Bits */
3503
#define UTIFG_L                (0x0001)       /* USB - Timer Interrupt Flag */
3504
#define UTIE_L                 (0x0002)       /* USB - Timer Interrupt Enable */
3505
//#define RESERVED       (0x0004)  /* USB -  */
3506
//#define RESERVED       (0x0008)  /* USB -  */
3507
//#define RESERVED       (0x0010)  /* USB -  */
3508
//#define RESERVED       (0x0020)  /* USB -  */
3509
//#define RESERVED       (0x0040)  /* USB -  */
3510
//#define RESERVED       (0x0080)  /* USB -  */
3511
//#define RESERVED       (0x1000)  /* USB -  */
3512
 
3513
/* USBMAINT Control Bits */
3514
//#define RESERVED       (0x0004)  /* USB -  */
3515
//#define RESERVED       (0x0008)  /* USB -  */
3516
//#define RESERVED       (0x0010)  /* USB -  */
3517
//#define RESERVED       (0x0020)  /* USB -  */
3518
//#define RESERVED       (0x0040)  /* USB -  */
3519
//#define RESERVED       (0x0080)  /* USB -  */
3520
#define TSGEN_H                (0x0001)       /* USB - Time Stamp Generator Enable */
3521
#define TSESEL0_H              (0x0002)       /* USB - Time Stamp Event Select Bit 0 */
3522
#define TSESEL1_H              (0x0004)       /* USB - Time Stamp Event Select Bit 1 */
3523
#define TSE3_H                 (0x0008)       /* USB - Time Stamp Event #3 Bit */
3524
//#define RESERVED       (0x1000)  /* USB -  */
3525
#define UTSEL0_H               (0x0020)       /* USB - Timer Select Bit 0 */
3526
#define UTSEL1_H               (0x0040)       /* USB - Timer Select Bit 1 */
3527
#define UTSEL2_H               (0x0080)       /* USB - Timer Select Bit 2 */
3528
 
3529
#define TSESEL_0               (0x0000)       /* USB - Time Stamp Event Select: 0 */
3530
#define TSESEL_1               (0x0200)       /* USB - Time Stamp Event Select: 1 */
3531
#define TSESEL_2               (0x0400)       /* USB - Time Stamp Event Select: 2 */
3532
#define TSESEL_3               (0x0600)       /* USB - Time Stamp Event Select: 3 */
3533
 
3534
#define UTSEL_0                (0x0000)       /* USB - Timer Select: 0 */
3535
#define UTSEL_1                (0x2000)       /* USB - Timer Select: 1 */
3536
#define UTSEL_2                (0x4000)       /* USB - Timer Select: 2 */
3537
#define UTSEL_3                (0x6000)       /* USB - Timer Select: 3 */
3538
#define UTSEL_4                (0x8000)       /* USB - Timer Select: 4 */
3539
#define UTSEL_5                (0xA000)       /* USB - Timer Select: 5 */
3540
#define UTSEL_6                (0xC000)       /* USB - Timer Select: 6 */
3541
#define UTSEL_7                (0xE000)       /* USB - Timer Select: 7 */
3542
 
3543
/* USBCTL Control Bits */
3544
#define DIR                    (0x0001)       /* USB - Data Response Bit */
3545
//#define RESERVED       (0x0002)  /* USB -  */
3546
//#define RESERVED       (0x0004)  /* USB -  */
3547
//#define RESERVED       (0x0008)  /* USB -  */
3548
#define FRSTE                  (0x0010)       /* USB - Function Reset Connection Enable */
3549
#define RWUP                   (0x0020)       /* USB - Device Remote Wakeup Request */
3550
#define FEN                    (0x0040)       /* USB - Function Enable Bit */
3551
//#define RESERVED       (0x0080)  /* USB -  */
3552
 
3553
/* USBIE Control Bits */
3554
#define STPOWIE                (0x0001)       /* USB - Setup Overwrite Interrupt Enable */
3555
//#define RESERVED       (0x0002)  /* USB -  */
3556
#define SETUPIE                (0x0004)       /* USB - Setup Interrupt Enable */
3557
//#define RESERVED       (0x0008)  /* USB -  */
3558
//#define RESERVED       (0x0010)  /* USB -  */
3559
#define RESRIE                 (0x0020)       /* USB - Function Resume Request Interrupt Enable */
3560
#define SUSRIE                 (0x0040)       /* USB - Function Suspend Request Interrupt Enable */
3561
#define RSTRIE                 (0x0080)       /* USB - Function Reset Request Interrupt Enable */
3562
 
3563
/* USBIFG Control Bits */
3564
#define STPOWIFG               (0x0001)       /* USB - Setup Overwrite Interrupt Flag */
3565
//#define RESERVED       (0x0002)  /* USB -  */
3566
#define SETUPIFG               (0x0004)       /* USB - Setup Interrupt Flag */
3567
//#define RESERVED       (0x0008)  /* USB -  */
3568
//#define RESERVED       (0x0010)  /* USB -  */
3569
#define RESRIFG                (0x0020)       /* USB - Function Resume Request Interrupt Flag */
3570
#define SUSRIFG                (0x0040)       /* USB - Function Suspend Request Interrupt Flag */
3571
#define RSTRIFG                (0x0080)       /* USB - Function Reset Request Interrupt Flag */
3572
 
3573
//values of USBVECINT when USB-interrupt occured
3574
#define     USBVECINT_NONE     0x00
3575
#define     USBVECINT_PWR_DROP 0x02
3576
#define     USBVECINT_PLL_LOCK 0x04
3577
#define     USBVECINT_PLL_SIGNAL 0x06
3578
#define     USBVECINT_PLL_RANGE 0x08
3579
#define     USBVECINT_PWR_VBUSOn 0x0A
3580
#define     USBVECINT_PWR_VBUSOff 0x0C
3581
#define     USBVECINT_USB_TIMESTAMP 0x10
3582
#define     USBVECINT_INPUT_ENDPOINT0 0x12
3583
#define     USBVECINT_OUTPUT_ENDPOINT0 0x14
3584
#define     USBVECINT_RSTR     0x16
3585
#define     USBVECINT_SUSR     0x18
3586
#define     USBVECINT_RESR     0x1A
3587
#define     USBVECINT_SETUP_PACKET_RECEIVED 0x20
3588
#define     USBVECINT_STPOW_PACKET_RECEIVED 0x22
3589
#define     USBVECINT_INPUT_ENDPOINT1 0x24
3590
#define     USBVECINT_INPUT_ENDPOINT2 0x26
3591
#define     USBVECINT_INPUT_ENDPOINT3 0x28
3592
#define     USBVECINT_INPUT_ENDPOINT4 0x2A
3593
#define     USBVECINT_INPUT_ENDPOINT5 0x2C
3594
#define     USBVECINT_INPUT_ENDPOINT6 0x2E
3595
#define     USBVECINT_INPUT_ENDPOINT7 0x30
3596
#define     USBVECINT_OUTPUT_ENDPOINT1 0x32
3597
#define     USBVECINT_OUTPUT_ENDPOINT2 0x34
3598
#define     USBVECINT_OUTPUT_ENDPOINT3 0x36
3599
#define     USBVECINT_OUTPUT_ENDPOINT4 0x38
3600
#define     USBVECINT_OUTPUT_ENDPOINT5 0x3A
3601
#define     USBVECINT_OUTPUT_ENDPOINT6 0x3C
3602
#define     USBVECINT_OUTPUT_ENDPOINT7 0x3E
3603
 
3604
 
3605
/* ========================================================================= */
3606
/* USB Operation Registers */
3607
/* ========================================================================= */
3608
 
3609
SFR_8BIT(USBIEPSIZXY_7);                      /* Input Endpoint_7: X/Y-buffer size  */
3610
SFR_8BIT(USBIEPBCTY_7);                       /* Input Endpoint_7: Y-byte count  */
3611
SFR_8BIT(USBIEPBBAY_7);                       /* Input Endpoint_7: Y-buffer base addr.  */
3612
//sfrb    Spare    (0x23FC)   /* Not used  */
3613
//sfrb    Spare    (0x23FB)   /* Not used  */
3614
SFR_8BIT(USBIEPBCTX_7);                       /* Input Endpoint_7: X-byte count  */
3615
SFR_8BIT(USBIEPBBAX_7);                       /* Input Endpoint_7: X-buffer base addr. */
3616
SFR_8BIT(USBIEPCNF_7);                        /* Input Endpoint_7: Configuration  */
3617
SFR_8BIT(USBIEPSIZXY_6);                      /* Input Endpoint_6: X/Y-buffer size  */
3618
SFR_8BIT(USBIEPBCTY_6);                       /* Input Endpoint_6: Y-byte count */
3619
SFR_8BIT(USBIEPBBAY_6);                       /* Input Endpoint_6: Y-buffer base addr. */
3620
//sfrb    Spare    (0x23F4)   /* Not used  */
3621
//sfrb    Spare    (0x23F3)   /* Not used  */
3622
SFR_8BIT(USBIEPBCTX_6);                       /* Input Endpoint_6: X-byte count */
3623
SFR_8BIT(USBIEPBBAX_6);                       /* Input Endpoint_6: X-buffer base addr. */
3624
SFR_8BIT(USBIEPCNF_6);                        /* Input Endpoint_6: Configuration */
3625
SFR_8BIT(USBIEPSIZXY_5);                      /* Input Endpoint_5: X/Y-buffer size */
3626
SFR_8BIT(USBIEPBCTY_5);                       /* Input Endpoint_5: Y-byte count */
3627
SFR_8BIT(USBIEPBBAY_5);                       /* Input Endpoint_5: Y-buffer base addr. */
3628
//sfrb    Spare    (0x23EC)   /* Not used */
3629
//sfrb    Spare    (0x23EB)   /* Not used */
3630
SFR_8BIT(USBIEPBCTX_5);                       /* Input Endpoint_5: X-byte count */
3631
SFR_8BIT(USBIEPBBAX_5);                       /* Input Endpoint_5: X-buffer base addr. */
3632
SFR_8BIT(USBIEPCNF_5);                        /* Input Endpoint_5: Configuration */
3633
SFR_8BIT(USBIEPSIZXY_4);                      /* Input Endpoint_4: X/Y-buffer size */
3634
SFR_8BIT(USBIEPBCTY_4);                       /* Input Endpoint_4: Y-byte count */
3635
SFR_8BIT(USBIEPBBAY_4);                       /* Input Endpoint_4: Y-buffer base addr. */
3636
//sfrb    Spare    (0x23E4)   /* Not used */
3637
//sfrb    Spare    (0x23E3)   /* Not used */
3638
SFR_8BIT(USBIEPBCTX_4);                       /* Input Endpoint_4: X-byte count */
3639
SFR_8BIT(USBIEPBBAX_4);                       /* Input Endpoint_4: X-buffer base addr. */
3640
SFR_8BIT(USBIEPCNF_4);                        /* Input Endpoint_4: Configuration */
3641
SFR_8BIT(USBIEPSIZXY_3);                      /* Input Endpoint_3: X/Y-buffer size */
3642
SFR_8BIT(USBIEPBCTY_3);                       /* Input Endpoint_3: Y-byte count */
3643
SFR_8BIT(USBIEPBBAY_3);                       /* Input Endpoint_3: Y-buffer base addr. */
3644
//sfrb    Spare    (0x23DC)   /* Not used */
3645
//sfrb    Spare    (0x23DB)   /* Not used */
3646
SFR_8BIT(USBIEPBCTX_3);                       /* Input Endpoint_3: X-byte count */
3647
SFR_8BIT(USBIEPBBAX_3);                       /* Input Endpoint_3: X-buffer base addr. */
3648
SFR_8BIT(USBIEPCNF_3);                        /* Input Endpoint_3: Configuration */
3649
SFR_8BIT(USBIEPSIZXY_2);                      /* Input Endpoint_2: X/Y-buffer size */
3650
SFR_8BIT(USBIEPBCTY_2);                       /* Input Endpoint_2: Y-byte count */
3651
SFR_8BIT(USBIEPBBAY_2);                       /* Input Endpoint_2: Y-buffer base addr. */
3652
//sfrb    Spare    (0x23D4)   /* Not used */
3653
//sfrb    Spare    (0x23D3)   /* Not used */
3654
SFR_8BIT(USBIEPBCTX_2);                       /* Input Endpoint_2: X-byte count */
3655
SFR_8BIT(USBIEPBBAX_2);                       /* Input Endpoint_2: X-buffer base addr. */
3656
SFR_8BIT(USBIEPCNF_2);                        /* Input Endpoint_2: Configuration */
3657
SFR_8BIT(USBIEPSIZXY_1);                      /* Input Endpoint_1: X/Y-buffer size */
3658
SFR_8BIT(USBIEPBCTY_1);                       /* Input Endpoint_1: Y-byte count */
3659
SFR_8BIT(USBIEPBBAY_1);                       /* Input Endpoint_1: Y-buffer base addr. */
3660
//sfrb    Spare    (0x23CC)   /* Not used */
3661
//sfrb    Spare    (0x23CB)   /* Not used */
3662
SFR_8BIT(USBIEPBCTX_1);                       /* Input Endpoint_1: X-byte count */
3663
SFR_8BIT(USBIEPBBAX_1);                       /* Input Endpoint_1: X-buffer base addr. */
3664
SFR_8BIT(USBIEPCNF_1);                        /* Input Endpoint_1: Configuration */
3665
//sfrb       (0x23C7)   0x0000 */
3666
//sfrb     RESERVED      (0x1C00)    /* */
3667
//sfrb       (0x23C0)   0x0000 */
3668
SFR_8BIT(USBOEPSIZXY_7);                      /* Output Endpoint_7: X/Y-buffer size */
3669
SFR_8BIT(USBOEPBCTY_7);                       /* Output Endpoint_7: Y-byte count */
3670
SFR_8BIT(USBOEPBBAY_7);                       /* Output Endpoint_7: Y-buffer base addr. */
3671
//sfrb    Spare    (0x23BC)   /* Not used */
3672
//sfrb    Spare    (0x23BB)   /* Not used */
3673
SFR_8BIT(USBOEPBCTX_7);                       /* Output Endpoint_7: X-byte count */
3674
SFR_8BIT(USBOEPBBAX_7);                       /* Output Endpoint_7: X-buffer base addr. */
3675
SFR_8BIT(USBOEPCNF_7);                        /* Output Endpoint_7: Configuration */
3676
SFR_8BIT(USBOEPSIZXY_6);                      /* Output Endpoint_6: X/Y-buffer size */
3677
SFR_8BIT(USBOEPBCTY_6);                       /* Output Endpoint_6: Y-byte count */
3678
SFR_8BIT(USBOEPBBAY_6);                       /* Output Endpoint_6: Y-buffer base addr. */
3679
//sfrb    Spare    (0x23B4)   /* Not used */
3680
//sfrb    Spare    (0x23B3)   /* Not used */
3681
SFR_8BIT(USBOEPBCTX_6);                       /* Output Endpoint_6: X-byte count */
3682
SFR_8BIT(USBOEPBBAX_6);                       /* Output Endpoint_6: X-buffer base addr. */
3683
SFR_8BIT(USBOEPCNF_6);                        /* Output Endpoint_6: Configuration */
3684
SFR_8BIT(USBOEPSIZXY_5);                      /* Output Endpoint_5: X/Y-buffer size */
3685
SFR_8BIT(USBOEPBCTY_5);                       /* Output Endpoint_5: Y-byte count */
3686
SFR_8BIT(USBOEPBBAY_5);                       /* Output Endpoint_5: Y-buffer base addr. */
3687
//sfrb    Spare    (0x23AC)   /* Not used */
3688
//sfrb    Spare    (0x23AB)   /* Not used */
3689
SFR_8BIT(USBOEPBCTX_5);                       /* Output Endpoint_5: X-byte count */
3690
SFR_8BIT(USBOEPBBAX_5);                       /* Output Endpoint_5: X-buffer base addr. */
3691
SFR_8BIT(USBOEPCNF_5);                        /* Output Endpoint_5: Configuration */
3692
SFR_8BIT(USBOEPSIZXY_4);                      /* Output Endpoint_4: X/Y-buffer size */
3693
SFR_8BIT(USBOEPBCTY_4);                       /* Output Endpoint_4: Y-byte count */
3694
SFR_8BIT(USBOEPBBAY_4);                       /* Output Endpoint_4: Y-buffer base addr. */
3695
//sfrb    Spare    (0x23A4)   /* Not used */
3696
//sfrb    Spare    (0x23A3)   /* Not used */
3697
SFR_8BIT(USBOEPBCTX_4);                       /* Output Endpoint_4: X-byte count */
3698
SFR_8BIT(USBOEPBBAX_4);                       /* Output Endpoint_4: X-buffer base addr. */
3699
SFR_8BIT(USBOEPCNF_4);                        /* Output Endpoint_4: Configuration */
3700
SFR_8BIT(USBOEPSIZXY_3);                      /* Output Endpoint_3: X/Y-buffer size */
3701
SFR_8BIT(USBOEPBCTY_3);                       /* Output Endpoint_3: Y-byte count */
3702
SFR_8BIT(USBOEPBBAY_3);                       /* Output Endpoint_3: Y-buffer base addr. */
3703
//sfrb    Spare    (0x239C)   /* Not used */
3704
//sfrb    Spare    (0x239B)   /* Not used */
3705
SFR_8BIT(USBOEPBCTX_3);                       /* Output Endpoint_3: X-byte count */
3706
SFR_8BIT(USBOEPBBAX_3);                       /* Output Endpoint_3: X-buffer base addr. */
3707
SFR_8BIT(USBOEPCNF_3);                        /* Output Endpoint_3: Configuration */
3708
SFR_8BIT(USBOEPSIZXY_2);                      /* Output Endpoint_2: X/Y-buffer size */
3709
SFR_8BIT(USBOEPBCTY_2);                       /* Output Endpoint_2: Y-byte count */
3710
SFR_8BIT(USBOEPBBAY_2);                       /* Output Endpoint_2: Y-buffer base addr. */
3711
//sfrb    Spare    (0x2394)   /* Not used */
3712
//sfrb    Spare    (0x2393)   /* Not used */
3713
SFR_8BIT(USBOEPBCTX_2);                       /* Output Endpoint_2: X-byte count */
3714
SFR_8BIT(USBOEPBBAX_2);                       /* Output Endpoint_2: X-buffer base addr. */
3715
SFR_8BIT(USBOEPCNF_2);                        /* Output Endpoint_2: Configuration */
3716
SFR_8BIT(USBOEPSIZXY_1);                      /* Output Endpoint_1: X/Y-buffer size */
3717
SFR_8BIT(USBOEPBCTY_1);                       /* Output Endpoint_1: Y-byte count */
3718
SFR_8BIT(USBOEPBBAY_1);                       /* Output Endpoint_1: Y-buffer base addr. */
3719
//sfrb    Spare    (0x238C)   /* Not used */
3720
//sfrb    Spare    (0x238B)   /* Not used */
3721
SFR_8BIT(USBOEPBCTX_1);                       /* Output Endpoint_1: X-byte count */
3722
SFR_8BIT(USBOEPBBAX_1);                       /* Output Endpoint_1: X-buffer base addr. */
3723
SFR_8BIT(USBOEPCNF_1);                        /* Output Endpoint_1: Configuration */
3724
SFR_8BIT(USBSUBLK);                           /* Setup Packet Block */
3725
SFR_8BIT(USBIEP0BUF);                         /* Input endpoint_0 buffer */
3726
SFR_8BIT(USBOEP0BUF);                         /* Output endpoint_0 buffer */
3727
SFR_8BIT(USBTOPBUFF);                         /* Top of buffer space */
3728
//         (1904 Bytes)               /* Buffer space */
3729
SFR_8BIT(USBSTABUFF);                         /* Start of buffer space */
3730
 
3731
/* USBIEPCNF_n Control Bits */
3732
/* USBOEPCNF_n Control Bits */
3733
//#define RESERVED       (0x0001)  /* USB -  */
3734
//#define RESERVED       (0x0001)  /* USB -  */
3735
#define DBUF                   (0x0010)       /* USB - Double Buffer Enable */
3736
//#define RESERVED       (0x0040)  /* USB -  */
3737
 
3738
/* USBIEPBCNT_n Control Bits */
3739
/* USBOEPBCNT_n Control Bits */
3740
#define CNT4                   (0x0010)       /* USB - Byte Count Bit 3 */
3741
#define CNT5                   (0x0020)       /* USB - Byte Count Bit 3 */
3742
#define CNT6                   (0x0040)       /* USB - Byte Count Bit 3 */
3743
/************************************************************
3744
* UNIFIED CLOCK SYSTEM
3745
************************************************************/
3746
#define __MSP430_HAS_UCS__                    /* Definition to show that Module is available */
3747
#define __MSP430_BASEADDRESS_UCS__ 0x0160
3748
 
3749
SFR_16BIT(UCSCTL0);                           /* UCS Control Register 0 */
3750
SFR_8BIT(UCSCTL0_L);                          /* UCS Control Register 0 */
3751
SFR_8BIT(UCSCTL0_H);                          /* UCS Control Register 0 */
3752
SFR_16BIT(UCSCTL1);                           /* UCS Control Register 1 */
3753
SFR_8BIT(UCSCTL1_L);                          /* UCS Control Register 1 */
3754
SFR_8BIT(UCSCTL1_H);                          /* UCS Control Register 1 */
3755
SFR_16BIT(UCSCTL2);                           /* UCS Control Register 2 */
3756
SFR_8BIT(UCSCTL2_L);                          /* UCS Control Register 2 */
3757
SFR_8BIT(UCSCTL2_H);                          /* UCS Control Register 2 */
3758
SFR_16BIT(UCSCTL3);                           /* UCS Control Register 3 */
3759
SFR_8BIT(UCSCTL3_L);                          /* UCS Control Register 3 */
3760
SFR_8BIT(UCSCTL3_H);                          /* UCS Control Register 3 */
3761
SFR_16BIT(UCSCTL4);                           /* UCS Control Register 4 */
3762
SFR_8BIT(UCSCTL4_L);                          /* UCS Control Register 4 */
3763
SFR_8BIT(UCSCTL4_H);                          /* UCS Control Register 4 */
3764
SFR_16BIT(UCSCTL5);                           /* UCS Control Register 5 */
3765
SFR_8BIT(UCSCTL5_L);                          /* UCS Control Register 5 */
3766
SFR_8BIT(UCSCTL5_H);                          /* UCS Control Register 5 */
3767
SFR_16BIT(UCSCTL6);                           /* UCS Control Register 6 */
3768
SFR_8BIT(UCSCTL6_L);                          /* UCS Control Register 6 */
3769
SFR_8BIT(UCSCTL6_H);                          /* UCS Control Register 6 */
3770
SFR_16BIT(UCSCTL7);                           /* UCS Control Register 7 */
3771
SFR_8BIT(UCSCTL7_L);                          /* UCS Control Register 7 */
3772
SFR_8BIT(UCSCTL7_H);                          /* UCS Control Register 7 */
3773
SFR_16BIT(UCSCTL8);                           /* UCS Control Register 8 */
3774
SFR_8BIT(UCSCTL8_L);                          /* UCS Control Register 8 */
3775
SFR_8BIT(UCSCTL8_H);                          /* UCS Control Register 8 */
3776
 
3777
/* UCSCTL0 Control Bits */
3778
//#define RESERVED            (0x0001)    /* RESERVED */
3779
//#define RESERVED            (0x0002)    /* RESERVED */
3780
//#define RESERVED            (0x0004)    /* RESERVED */
3781
#define MOD0                   (0x0008)       /* Modulation Bit Counter Bit : 0 */
3782
#define MOD1                   (0x0010)       /* Modulation Bit Counter Bit : 1 */
3783
#define MOD2                   (0x0020)       /* Modulation Bit Counter Bit : 2 */
3784
#define MOD3                   (0x0040)       /* Modulation Bit Counter Bit : 3 */
3785
#define MOD4                   (0x0080)       /* Modulation Bit Counter Bit : 4 */
3786
#define DCO0                   (0x0100)       /* DCO TAP Bit : 0 */
3787
#define DCO1                   (0x0200)       /* DCO TAP Bit : 1 */
3788
#define DCO2                   (0x0400)       /* DCO TAP Bit : 2 */
3789
#define DCO3                   (0x0800)       /* DCO TAP Bit : 3 */
3790
#define DCO4                   (0x1000)       /* DCO TAP Bit : 4 */
3791
//#define RESERVED            (0x2000)    /* RESERVED */
3792
//#define RESERVED            (0x4000)    /* RESERVED */
3793
//#define RESERVED            (0x8000)    /* RESERVED */
3794
 
3795
/* UCSCTL0 Control Bits */
3796
//#define RESERVED            (0x0001)    /* RESERVED */
3797
//#define RESERVED            (0x0002)    /* RESERVED */
3798
//#define RESERVED            (0x0004)    /* RESERVED */
3799
#define MOD0_L                 (0x0008)       /* Modulation Bit Counter Bit : 0 */
3800
#define MOD1_L                 (0x0010)       /* Modulation Bit Counter Bit : 1 */
3801
#define MOD2_L                 (0x0020)       /* Modulation Bit Counter Bit : 2 */
3802
#define MOD3_L                 (0x0040)       /* Modulation Bit Counter Bit : 3 */
3803
#define MOD4_L                 (0x0080)       /* Modulation Bit Counter Bit : 4 */
3804
//#define RESERVED            (0x2000)    /* RESERVED */
3805
//#define RESERVED            (0x4000)    /* RESERVED */
3806
//#define RESERVED            (0x8000)    /* RESERVED */
3807
 
3808
/* UCSCTL0 Control Bits */
3809
//#define RESERVED            (0x0001)    /* RESERVED */
3810
//#define RESERVED            (0x0002)    /* RESERVED */
3811
//#define RESERVED            (0x0004)    /* RESERVED */
3812
#define DCO0_H                 (0x0001)       /* DCO TAP Bit : 0 */
3813
#define DCO1_H                 (0x0002)       /* DCO TAP Bit : 1 */
3814
#define DCO2_H                 (0x0004)       /* DCO TAP Bit : 2 */
3815
#define DCO3_H                 (0x0008)       /* DCO TAP Bit : 3 */
3816
#define DCO4_H                 (0x0010)       /* DCO TAP Bit : 4 */
3817
//#define RESERVED            (0x2000)    /* RESERVED */
3818
//#define RESERVED            (0x4000)    /* RESERVED */
3819
//#define RESERVED            (0x8000)    /* RESERVED */
3820
 
3821
/* UCSCTL1 Control Bits */
3822
#define DISMOD                 (0x0001)       /* Disable Modulation */
3823
//#define RESERVED            (0x0002)    /* RESERVED */
3824
//#define RESERVED            (0x0004)    /* RESERVED */
3825
//#define RESERVED            (0x0008)    /* RESERVED */
3826
#define DCORSEL0               (0x0010)       /* DCO Freq. Range Select Bit : 0 */
3827
#define DCORSEL1               (0x0020)       /* DCO Freq. Range Select Bit : 1 */
3828
#define DCORSEL2               (0x0040)       /* DCO Freq. Range Select Bit : 2 */
3829
//#define RESERVED            (0x0080)    /* RESERVED */
3830
//#define RESERVED            (0x0100)    /* RESERVED */
3831
//#define RESERVED            (0x0200)    /* RESERVED */
3832
//#define RESERVED            (0x0400)    /* RESERVED */
3833
//#define RESERVED            (0x0800)    /* RESERVED */
3834
//#define RESERVED            (0x1000)    /* RESERVED */
3835
//#define RESERVED            (0x2000)    /* RESERVED */
3836
//#define RESERVED            (0x4000)    /* RESERVED */
3837
//#define RESERVED            (0x8000)    /* RESERVED */
3838
 
3839
/* UCSCTL1 Control Bits */
3840
#define DISMOD_L               (0x0001)       /* Disable Modulation */
3841
//#define RESERVED            (0x0002)    /* RESERVED */
3842
//#define RESERVED            (0x0004)    /* RESERVED */
3843
//#define RESERVED            (0x0008)    /* RESERVED */
3844
#define DCORSEL0_L             (0x0010)       /* DCO Freq. Range Select Bit : 0 */
3845
#define DCORSEL1_L             (0x0020)       /* DCO Freq. Range Select Bit : 1 */
3846
#define DCORSEL2_L             (0x0040)       /* DCO Freq. Range Select Bit : 2 */
3847
//#define RESERVED            (0x0080)    /* RESERVED */
3848
//#define RESERVED            (0x0100)    /* RESERVED */
3849
//#define RESERVED            (0x0200)    /* RESERVED */
3850
//#define RESERVED            (0x0400)    /* RESERVED */
3851
//#define RESERVED            (0x0800)    /* RESERVED */
3852
//#define RESERVED            (0x1000)    /* RESERVED */
3853
//#define RESERVED            (0x2000)    /* RESERVED */
3854
//#define RESERVED            (0x4000)    /* RESERVED */
3855
//#define RESERVED            (0x8000)    /* RESERVED */
3856
 
3857
/* UCSCTL1 Control Bits */
3858
//#define RESERVED            (0x0002)    /* RESERVED */
3859
//#define RESERVED            (0x0004)    /* RESERVED */
3860
//#define RESERVED            (0x0008)    /* RESERVED */
3861
//#define RESERVED            (0x0080)    /* RESERVED */
3862
//#define RESERVED            (0x0100)    /* RESERVED */
3863
//#define RESERVED            (0x0200)    /* RESERVED */
3864
//#define RESERVED            (0x0400)    /* RESERVED */
3865
//#define RESERVED            (0x0800)    /* RESERVED */
3866
//#define RESERVED            (0x1000)    /* RESERVED */
3867
//#define RESERVED            (0x2000)    /* RESERVED */
3868
//#define RESERVED            (0x4000)    /* RESERVED */
3869
//#define RESERVED            (0x8000)    /* RESERVED */
3870
 
3871
#define DCORSEL_0              (0x0000)       /* DCO RSEL 0 */
3872
#define DCORSEL_1              (0x0010)       /* DCO RSEL 1 */
3873
#define DCORSEL_2              (0x0020)       /* DCO RSEL 2 */
3874
#define DCORSEL_3              (0x0030)       /* DCO RSEL 3 */
3875
#define DCORSEL_4              (0x0040)       /* DCO RSEL 4 */
3876
#define DCORSEL_5              (0x0050)       /* DCO RSEL 5 */
3877
#define DCORSEL_6              (0x0060)       /* DCO RSEL 6 */
3878
#define DCORSEL_7              (0x0070)       /* DCO RSEL 7 */
3879
 
3880
/* UCSCTL2 Control Bits */
3881
#define FLLN0                  (0x0001)       /* FLL Multipier Bit : 0 */
3882
#define FLLN1                  (0x0002)       /* FLL Multipier Bit : 1 */
3883
#define FLLN2                  (0x0004)       /* FLL Multipier Bit : 2 */
3884
#define FLLN3                  (0x0008)       /* FLL Multipier Bit : 3 */
3885
#define FLLN4                  (0x0010)       /* FLL Multipier Bit : 4 */
3886
#define FLLN5                  (0x0020)       /* FLL Multipier Bit : 5 */
3887
#define FLLN6                  (0x0040)       /* FLL Multipier Bit : 6 */
3888
#define FLLN7                  (0x0080)       /* FLL Multipier Bit : 7 */
3889
#define FLLN8                  (0x0100)       /* FLL Multipier Bit : 8 */
3890
#define FLLN9                  (0x0200)       /* FLL Multipier Bit : 9 */
3891
//#define RESERVED            (0x0400)    /* RESERVED */
3892
//#define RESERVED            (0x0800)    /* RESERVED */
3893
#define FLLD0                  (0x1000)       /* Loop Divider Bit : 0 */
3894
#define FLLD1                  (0x2000)       /* Loop Divider Bit : 1 */
3895
#define FLLD2                  (0x4000)       /* Loop Divider Bit : 1 */
3896
//#define RESERVED            (0x8000)    /* RESERVED */
3897
 
3898
/* UCSCTL2 Control Bits */
3899
#define FLLN0_L                (0x0001)       /* FLL Multipier Bit : 0 */
3900
#define FLLN1_L                (0x0002)       /* FLL Multipier Bit : 1 */
3901
#define FLLN2_L                (0x0004)       /* FLL Multipier Bit : 2 */
3902
#define FLLN3_L                (0x0008)       /* FLL Multipier Bit : 3 */
3903
#define FLLN4_L                (0x0010)       /* FLL Multipier Bit : 4 */
3904
#define FLLN5_L                (0x0020)       /* FLL Multipier Bit : 5 */
3905
#define FLLN6_L                (0x0040)       /* FLL Multipier Bit : 6 */
3906
#define FLLN7_L                (0x0080)       /* FLL Multipier Bit : 7 */
3907
//#define RESERVED            (0x0400)    /* RESERVED */
3908
//#define RESERVED            (0x0800)    /* RESERVED */
3909
//#define RESERVED            (0x8000)    /* RESERVED */
3910
 
3911
/* UCSCTL2 Control Bits */
3912
#define FLLN8_H                (0x0001)       /* FLL Multipier Bit : 8 */
3913
#define FLLN9_H                (0x0002)       /* FLL Multipier Bit : 9 */
3914
//#define RESERVED            (0x0400)    /* RESERVED */
3915
//#define RESERVED            (0x0800)    /* RESERVED */
3916
#define FLLD0_H                (0x0010)       /* Loop Divider Bit : 0 */
3917
#define FLLD1_H                (0x0020)       /* Loop Divider Bit : 1 */
3918
#define FLLD2_H                (0x0040)       /* Loop Divider Bit : 1 */
3919
//#define RESERVED            (0x8000)    /* RESERVED */
3920
 
3921
#define FLLD_0                 (0x0000)       /* Multiply Selected Loop Freq. 1 */
3922
#define FLLD_1                 (0x1000)       /* Multiply Selected Loop Freq. 2 */
3923
#define FLLD_2                 (0x2000)       /* Multiply Selected Loop Freq. 4 */
3924
#define FLLD_3                 (0x3000)       /* Multiply Selected Loop Freq. 8 */
3925
#define FLLD_4                 (0x4000)       /* Multiply Selected Loop Freq. 16 */
3926
#define FLLD_5                 (0x5000)       /* Multiply Selected Loop Freq. 32 */
3927
#define FLLD_6                 (0x6000)       /* Multiply Selected Loop Freq. 32 */
3928
#define FLLD_7                 (0x7000)       /* Multiply Selected Loop Freq. 32 */
3929
#define FLLD__1                (0x0000)       /* Multiply Selected Loop Freq. By 1 */
3930
#define FLLD__2                (0x1000)       /* Multiply Selected Loop Freq. By 2 */
3931
#define FLLD__4                (0x2000)       /* Multiply Selected Loop Freq. By 4 */
3932
#define FLLD__8                (0x3000)       /* Multiply Selected Loop Freq. By 8 */
3933
#define FLLD__16               (0x4000)       /* Multiply Selected Loop Freq. By 16 */
3934
#define FLLD__32               (0x5000)       /* Multiply Selected Loop Freq. By 32 */
3935
 
3936
/* UCSCTL3 Control Bits */
3937
#define FLLREFDIV0             (0x0001)       /* Reference Divider Bit : 0 */
3938
#define FLLREFDIV1             (0x0002)       /* Reference Divider Bit : 1 */
3939
#define FLLREFDIV2             (0x0004)       /* Reference Divider Bit : 2 */
3940
//#define RESERVED            (0x0008)    /* RESERVED */
3941
#define SELREF0                (0x0010)       /* FLL Reference Clock Select Bit : 0 */
3942
#define SELREF1                (0x0020)       /* FLL Reference Clock Select Bit : 1 */
3943
#define SELREF2                (0x0040)       /* FLL Reference Clock Select Bit : 2 */
3944
//#define RESERVED            (0x0080)    /* RESERVED */
3945
//#define RESERVED            (0x0100)    /* RESERVED */
3946
//#define RESERVED            (0x0200)    /* RESERVED */
3947
//#define RESERVED            (0x0400)    /* RESERVED */
3948
//#define RESERVED            (0x0800)    /* RESERVED */
3949
//#define RESERVED            (0x1000)    /* RESERVED */
3950
//#define RESERVED            (0x2000)    /* RESERVED */
3951
//#define RESERVED            (0x4000)    /* RESERVED */
3952
//#define RESERVED            (0x8000)    /* RESERVED */
3953
 
3954
/* UCSCTL3 Control Bits */
3955
#define FLLREFDIV0_L           (0x0001)       /* Reference Divider Bit : 0 */
3956
#define FLLREFDIV1_L           (0x0002)       /* Reference Divider Bit : 1 */
3957
#define FLLREFDIV2_L           (0x0004)       /* Reference Divider Bit : 2 */
3958
//#define RESERVED            (0x0008)    /* RESERVED */
3959
#define SELREF0_L              (0x0010)       /* FLL Reference Clock Select Bit : 0 */
3960
#define SELREF1_L              (0x0020)       /* FLL Reference Clock Select Bit : 1 */
3961
#define SELREF2_L              (0x0040)       /* FLL Reference Clock Select Bit : 2 */
3962
//#define RESERVED            (0x0080)    /* RESERVED */
3963
//#define RESERVED            (0x0100)    /* RESERVED */
3964
//#define RESERVED            (0x0200)    /* RESERVED */
3965
//#define RESERVED            (0x0400)    /* RESERVED */
3966
//#define RESERVED            (0x0800)    /* RESERVED */
3967
//#define RESERVED            (0x1000)    /* RESERVED */
3968
//#define RESERVED            (0x2000)    /* RESERVED */
3969
//#define RESERVED            (0x4000)    /* RESERVED */
3970
//#define RESERVED            (0x8000)    /* RESERVED */
3971
 
3972
/* UCSCTL3 Control Bits */
3973
//#define RESERVED            (0x0008)    /* RESERVED */
3974
//#define RESERVED            (0x0080)    /* RESERVED */
3975
//#define RESERVED            (0x0100)    /* RESERVED */
3976
//#define RESERVED            (0x0200)    /* RESERVED */
3977
//#define RESERVED            (0x0400)    /* RESERVED */
3978
//#define RESERVED            (0x0800)    /* RESERVED */
3979
//#define RESERVED            (0x1000)    /* RESERVED */
3980
//#define RESERVED            (0x2000)    /* RESERVED */
3981
//#define RESERVED            (0x4000)    /* RESERVED */
3982
//#define RESERVED            (0x8000)    /* RESERVED */
3983
 
3984
#define FLLREFDIV_0            (0x0000)       /* Reference Divider: f(LFCLK)/1 */
3985
#define FLLREFDIV_1            (0x0001)       /* Reference Divider: f(LFCLK)/2 */
3986
#define FLLREFDIV_2            (0x0002)       /* Reference Divider: f(LFCLK)/4 */
3987
#define FLLREFDIV_3            (0x0003)       /* Reference Divider: f(LFCLK)/8 */
3988
#define FLLREFDIV_4            (0x0004)       /* Reference Divider: f(LFCLK)/12 */
3989
#define FLLREFDIV_5            (0x0005)       /* Reference Divider: f(LFCLK)/16 */
3990
#define FLLREFDIV_6            (0x0006)       /* Reference Divider: f(LFCLK)/16 */
3991
#define FLLREFDIV_7            (0x0007)       /* Reference Divider: f(LFCLK)/16 */
3992
#define FLLREFDIV__1           (0x0000)       /* Reference Divider: f(LFCLK)/1 */
3993
#define FLLREFDIV__2           (0x0001)       /* Reference Divider: f(LFCLK)/2 */
3994
#define FLLREFDIV__4           (0x0002)       /* Reference Divider: f(LFCLK)/4 */
3995
#define FLLREFDIV__8           (0x0003)       /* Reference Divider: f(LFCLK)/8 */
3996
#define FLLREFDIV__12          (0x0004)       /* Reference Divider: f(LFCLK)/12 */
3997
#define FLLREFDIV__16          (0x0005)       /* Reference Divider: f(LFCLK)/16 */
3998
#define SELREF_0               (0x0000)       /* FLL Reference Clock Select 0 */
3999
#define SELREF_1               (0x0010)       /* FLL Reference Clock Select 1 */
4000
#define SELREF_2               (0x0020)       /* FLL Reference Clock Select 2 */
4001
#define SELREF_3               (0x0030)       /* FLL Reference Clock Select 3 */
4002
#define SELREF_4               (0x0040)       /* FLL Reference Clock Select 4 */
4003
#define SELREF_5               (0x0050)       /* FLL Reference Clock Select 5 */
4004
#define SELREF_6               (0x0060)       /* FLL Reference Clock Select 6 */
4005
#define SELREF_7               (0x0070)       /* FLL Reference Clock Select 7 */
4006
#define SELREF__XT1CLK         (0x0000)       /* Multiply Selected Loop Freq. By XT1CLK */
4007
#define SELREF__REFOCLK        (0x0020)       /* Multiply Selected Loop Freq. By REFOCLK */
4008
#define SELREF__XT2CLK         (0x0050)       /* Multiply Selected Loop Freq. By XT2CLK */
4009
 
4010
/* UCSCTL4 Control Bits */
4011
#define SELM0                  (0x0001)       /* MCLK Source Select Bit: 0 */
4012
#define SELM1                  (0x0002)       /* MCLK Source Select Bit: 1 */
4013
#define SELM2                  (0x0004)       /* MCLK Source Select Bit: 2 */
4014
//#define RESERVED            (0x0008)    /* RESERVED */
4015
#define SELS0                  (0x0010)       /* SMCLK Source Select Bit: 0 */
4016
#define SELS1                  (0x0020)       /* SMCLK Source Select Bit: 1 */
4017
#define SELS2                  (0x0040)       /* SMCLK Source Select Bit: 2 */
4018
//#define RESERVED            (0x0080)    /* RESERVED */
4019
#define SELA0                  (0x0100)       /* ACLK Source Select Bit: 0 */
4020
#define SELA1                  (0x0200)       /* ACLK Source Select Bit: 1 */
4021
#define SELA2                  (0x0400)       /* ACLK Source Select Bit: 2 */
4022
//#define RESERVED            (0x0800)    /* RESERVED */
4023
//#define RESERVED            (0x1000)    /* RESERVED */
4024
//#define RESERVED            (0x2000)    /* RESERVED */
4025
//#define RESERVED            (0x4000)    /* RESERVED */
4026
//#define RESERVED            (0x8000)    /* RESERVED */
4027
 
4028
/* UCSCTL4 Control Bits */
4029
#define SELM0_L                (0x0001)       /* MCLK Source Select Bit: 0 */
4030
#define SELM1_L                (0x0002)       /* MCLK Source Select Bit: 1 */
4031
#define SELM2_L                (0x0004)       /* MCLK Source Select Bit: 2 */
4032
//#define RESERVED            (0x0008)    /* RESERVED */
4033
#define SELS0_L                (0x0010)       /* SMCLK Source Select Bit: 0 */
4034
#define SELS1_L                (0x0020)       /* SMCLK Source Select Bit: 1 */
4035
#define SELS2_L                (0x0040)       /* SMCLK Source Select Bit: 2 */
4036
//#define RESERVED            (0x0080)    /* RESERVED */
4037
//#define RESERVED            (0x0800)    /* RESERVED */
4038
//#define RESERVED            (0x1000)    /* RESERVED */
4039
//#define RESERVED            (0x2000)    /* RESERVED */
4040
//#define RESERVED            (0x4000)    /* RESERVED */
4041
//#define RESERVED            (0x8000)    /* RESERVED */
4042
 
4043
/* UCSCTL4 Control Bits */
4044
//#define RESERVED            (0x0008)    /* RESERVED */
4045
//#define RESERVED            (0x0080)    /* RESERVED */
4046
#define SELA0_H                (0x0001)       /* ACLK Source Select Bit: 0 */
4047
#define SELA1_H                (0x0002)       /* ACLK Source Select Bit: 1 */
4048
#define SELA2_H                (0x0004)       /* ACLK Source Select Bit: 2 */
4049
//#define RESERVED            (0x0800)    /* RESERVED */
4050
//#define RESERVED            (0x1000)    /* RESERVED */
4051
//#define RESERVED            (0x2000)    /* RESERVED */
4052
//#define RESERVED            (0x4000)    /* RESERVED */
4053
//#define RESERVED            (0x8000)    /* RESERVED */
4054
 
4055
#define SELM_0                 (0x0000)       /* MCLK Source Select 0 */
4056
#define SELM_1                 (0x0001)       /* MCLK Source Select 1 */
4057
#define SELM_2                 (0x0002)       /* MCLK Source Select 2 */
4058
#define SELM_3                 (0x0003)       /* MCLK Source Select 3 */
4059
#define SELM_4                 (0x0004)       /* MCLK Source Select 4 */
4060
#define SELM_5                 (0x0005)       /* MCLK Source Select 5 */
4061
#define SELM_6                 (0x0006)       /* MCLK Source Select 6 */
4062
#define SELM_7                 (0x0007)       /* MCLK Source Select 7 */
4063
#define SELM__XT1CLK           (0x0000)       /* MCLK Source Select XT1CLK */
4064
#define SELM__VLOCLK           (0x0001)       /* MCLK Source Select VLOCLK */
4065
#define SELM__REFOCLK          (0x0002)       /* MCLK Source Select REFOCLK */
4066
#define SELM__DCOCLK           (0x0003)       /* MCLK Source Select DCOCLK */
4067
#define SELM__DCOCLKDIV        (0x0004)       /* MCLK Source Select DCOCLKDIV */
4068
#define SELM__XT2CLK           (0x0005)       /* MCLK Source Select XT2CLK */
4069
 
4070
#define SELS_0                 (0x0000)       /* SMCLK Source Select 0 */
4071
#define SELS_1                 (0x0010)       /* SMCLK Source Select 1 */
4072
#define SELS_2                 (0x0020)       /* SMCLK Source Select 2 */
4073
#define SELS_3                 (0x0030)       /* SMCLK Source Select 3 */
4074
#define SELS_4                 (0x0040)       /* SMCLK Source Select 4 */
4075
#define SELS_5                 (0x0050)       /* SMCLK Source Select 5 */
4076
#define SELS_6                 (0x0060)       /* SMCLK Source Select 6 */
4077
#define SELS_7                 (0x0070)       /* SMCLK Source Select 7 */
4078
#define SELS__XT1CLK           (0x0000)       /* SMCLK Source Select XT1CLK */
4079
#define SELS__VLOCLK           (0x0010)       /* SMCLK Source Select VLOCLK */
4080
#define SELS__REFOCLK          (0x0020)       /* SMCLK Source Select REFOCLK */
4081
#define SELS__DCOCLK           (0x0030)       /* SMCLK Source Select DCOCLK */
4082
#define SELS__DCOCLKDIV        (0x0040)       /* SMCLK Source Select DCOCLKDIV */
4083
#define SELS__XT2CLK           (0x0050)       /* SMCLK Source Select XT2CLK */
4084
 
4085
#define SELA_0                 (0x0000)       /* ACLK Source Select 0 */
4086
#define SELA_1                 (0x0100)       /* ACLK Source Select 1 */
4087
#define SELA_2                 (0x0200)       /* ACLK Source Select 2 */
4088
#define SELA_3                 (0x0300)       /* ACLK Source Select 3 */
4089
#define SELA_4                 (0x0400)       /* ACLK Source Select 4 */
4090
#define SELA_5                 (0x0500)       /* ACLK Source Select 5 */
4091
#define SELA_6                 (0x0600)       /* ACLK Source Select 6 */
4092
#define SELA_7                 (0x0700)       /* ACLK Source Select 7 */
4093
#define SELA__XT1CLK           (0x0000)       /* ACLK Source Select XT1CLK */
4094
#define SELA__VLOCLK           (0x0100)       /* ACLK Source Select VLOCLK */
4095
#define SELA__REFOCLK          (0x0200)       /* ACLK Source Select REFOCLK */
4096
#define SELA__DCOCLK           (0x0300)       /* ACLK Source Select DCOCLK */
4097
#define SELA__DCOCLKDIV        (0x0400)       /* ACLK Source Select DCOCLKDIV */
4098
#define SELA__XT2CLK           (0x0500)       /* ACLK Source Select XT2CLK */
4099
 
4100
/* UCSCTL5 Control Bits */
4101
#define DIVM0                  (0x0001)       /* MCLK Divider Bit: 0 */
4102
#define DIVM1                  (0x0002)       /* MCLK Divider Bit: 1 */
4103
#define DIVM2                  (0x0004)       /* MCLK Divider Bit: 2 */
4104
//#define RESERVED            (0x0008)    /* RESERVED */
4105
#define DIVS0                  (0x0010)       /* SMCLK Divider Bit: 0 */
4106
#define DIVS1                  (0x0020)       /* SMCLK Divider Bit: 1 */
4107
#define DIVS2                  (0x0040)       /* SMCLK Divider Bit: 2 */
4108
//#define RESERVED            (0x0080)    /* RESERVED */
4109
#define DIVA0                  (0x0100)       /* ACLK Divider Bit: 0 */
4110
#define DIVA1                  (0x0200)       /* ACLK Divider Bit: 1 */
4111
#define DIVA2                  (0x0400)       /* ACLK Divider Bit: 2 */
4112
//#define RESERVED            (0x0800)    /* RESERVED */
4113
#define DIVPA0                 (0x1000)       /* ACLK from Pin Divider Bit: 0 */
4114
#define DIVPA1                 (0x2000)       /* ACLK from Pin Divider Bit: 1 */
4115
#define DIVPA2                 (0x4000)       /* ACLK from Pin Divider Bit: 2 */
4116
//#define RESERVED            (0x8000)    /* RESERVED */
4117
 
4118
/* UCSCTL5 Control Bits */
4119
#define DIVM0_L                (0x0001)       /* MCLK Divider Bit: 0 */
4120
#define DIVM1_L                (0x0002)       /* MCLK Divider Bit: 1 */
4121
#define DIVM2_L                (0x0004)       /* MCLK Divider Bit: 2 */
4122
//#define RESERVED            (0x0008)    /* RESERVED */
4123
#define DIVS0_L                (0x0010)       /* SMCLK Divider Bit: 0 */
4124
#define DIVS1_L                (0x0020)       /* SMCLK Divider Bit: 1 */
4125
#define DIVS2_L                (0x0040)       /* SMCLK Divider Bit: 2 */
4126
//#define RESERVED            (0x0080)    /* RESERVED */
4127
//#define RESERVED            (0x0800)    /* RESERVED */
4128
//#define RESERVED            (0x8000)    /* RESERVED */
4129
 
4130
/* UCSCTL5 Control Bits */
4131
//#define RESERVED            (0x0008)    /* RESERVED */
4132
//#define RESERVED            (0x0080)    /* RESERVED */
4133
#define DIVA0_H                (0x0001)       /* ACLK Divider Bit: 0 */
4134
#define DIVA1_H                (0x0002)       /* ACLK Divider Bit: 1 */
4135
#define DIVA2_H                (0x0004)       /* ACLK Divider Bit: 2 */
4136
//#define RESERVED            (0x0800)    /* RESERVED */
4137
#define DIVPA0_H               (0x0010)       /* ACLK from Pin Divider Bit: 0 */
4138
#define DIVPA1_H               (0x0020)       /* ACLK from Pin Divider Bit: 1 */
4139
#define DIVPA2_H               (0x0040)       /* ACLK from Pin Divider Bit: 2 */
4140
//#define RESERVED            (0x8000)    /* RESERVED */
4141
 
4142
#define DIVM_0                 (0x0000)       /* MCLK Source Divider 0 */
4143
#define DIVM_1                 (0x0001)       /* MCLK Source Divider 1 */
4144
#define DIVM_2                 (0x0002)       /* MCLK Source Divider 2 */
4145
#define DIVM_3                 (0x0003)       /* MCLK Source Divider 3 */
4146
#define DIVM_4                 (0x0004)       /* MCLK Source Divider 4 */
4147
#define DIVM_5                 (0x0005)       /* MCLK Source Divider 5 */
4148
#define DIVM_6                 (0x0006)       /* MCLK Source Divider 6 */
4149
#define DIVM_7                 (0x0007)       /* MCLK Source Divider 7 */
4150
#define DIVM__1                (0x0000)       /* MCLK Source Divider f(MCLK)/1 */
4151
#define DIVM__2                (0x0001)       /* MCLK Source Divider f(MCLK)/2 */
4152
#define DIVM__4                (0x0002)       /* MCLK Source Divider f(MCLK)/4 */
4153
#define DIVM__8                (0x0003)       /* MCLK Source Divider f(MCLK)/8 */
4154
#define DIVM__16               (0x0004)       /* MCLK Source Divider f(MCLK)/16 */
4155
#define DIVM__32               (0x0005)       /* MCLK Source Divider f(MCLK)/32 */
4156
 
4157
#define DIVS_0                 (0x0000)       /* SMCLK Source Divider 0 */
4158
#define DIVS_1                 (0x0010)       /* SMCLK Source Divider 1 */
4159
#define DIVS_2                 (0x0020)       /* SMCLK Source Divider 2 */
4160
#define DIVS_3                 (0x0030)       /* SMCLK Source Divider 3 */
4161
#define DIVS_4                 (0x0040)       /* SMCLK Source Divider 4 */
4162
#define DIVS_5                 (0x0050)       /* SMCLK Source Divider 5 */
4163
#define DIVS_6                 (0x0060)       /* SMCLK Source Divider 6 */
4164
#define DIVS_7                 (0x0070)       /* SMCLK Source Divider 7 */
4165
#define DIVS__1                (0x0000)       /* SMCLK Source Divider f(SMCLK)/1 */
4166
#define DIVS__2                (0x0010)       /* SMCLK Source Divider f(SMCLK)/2 */
4167
#define DIVS__4                (0x0020)       /* SMCLK Source Divider f(SMCLK)/4 */
4168
#define DIVS__8                (0x0030)       /* SMCLK Source Divider f(SMCLK)/8 */
4169
#define DIVS__16               (0x0040)       /* SMCLK Source Divider f(SMCLK)/16 */
4170
#define DIVS__32               (0x0050)       /* SMCLK Source Divider f(SMCLK)/32 */
4171
 
4172
#define DIVA_0                 (0x0000)       /* ACLK Source Divider 0 */
4173
#define DIVA_1                 (0x0100)       /* ACLK Source Divider 1 */
4174
#define DIVA_2                 (0x0200)       /* ACLK Source Divider 2 */
4175
#define DIVA_3                 (0x0300)       /* ACLK Source Divider 3 */
4176
#define DIVA_4                 (0x0400)       /* ACLK Source Divider 4 */
4177
#define DIVA_5                 (0x0500)       /* ACLK Source Divider 5 */
4178
#define DIVA_6                 (0x0600)       /* ACLK Source Divider 6 */
4179
#define DIVA_7                 (0x0700)       /* ACLK Source Divider 7 */
4180
#define DIVA__1                (0x0000)       /* ACLK Source Divider f(ACLK)/1 */
4181
#define DIVA__2                (0x0100)       /* ACLK Source Divider f(ACLK)/2 */
4182
#define DIVA__4                (0x0200)       /* ACLK Source Divider f(ACLK)/4 */
4183
#define DIVA__8                (0x0300)       /* ACLK Source Divider f(ACLK)/8 */
4184
#define DIVA__16               (0x0400)       /* ACLK Source Divider f(ACLK)/16 */
4185
#define DIVA__32               (0x0500)       /* ACLK Source Divider f(ACLK)/32 */
4186
 
4187
#define DIVPA_0                (0x0000)       /* ACLK from Pin Source Divider 0 */
4188
#define DIVPA_1                (0x1000)       /* ACLK from Pin Source Divider 1 */
4189
#define DIVPA_2                (0x2000)       /* ACLK from Pin Source Divider 2 */
4190
#define DIVPA_3                (0x3000)       /* ACLK from Pin Source Divider 3 */
4191
#define DIVPA_4                (0x4000)       /* ACLK from Pin Source Divider 4 */
4192
#define DIVPA_5                (0x5000)       /* ACLK from Pin Source Divider 5 */
4193
#define DIVPA_6                (0x6000)       /* ACLK from Pin Source Divider 6 */
4194
#define DIVPA_7                (0x7000)       /* ACLK from Pin Source Divider 7 */
4195
#define DIVPA__1               (0x0000)       /* ACLK from Pin Source Divider f(ACLK)/1 */
4196
#define DIVPA__2               (0x1000)       /* ACLK from Pin Source Divider f(ACLK)/2 */
4197
#define DIVPA__4               (0x2000)       /* ACLK from Pin Source Divider f(ACLK)/4 */
4198
#define DIVPA__8               (0x3000)       /* ACLK from Pin Source Divider f(ACLK)/8 */
4199
#define DIVPA__16              (0x4000)       /* ACLK from Pin Source Divider f(ACLK)/16 */
4200
#define DIVPA__32              (0x5000)       /* ACLK from Pin Source Divider f(ACLK)/32 */
4201
 
4202
/* UCSCTL6 Control Bits */
4203
#define XT1OFF                 (0x0001)       /* High Frequency Oscillator 1 (XT1) disable */
4204
#define SMCLKOFF               (0x0002)       /* SMCLK Off */
4205
#define XCAP0                  (0x0004)       /* XIN/XOUT Cap Bit: 0 */
4206
#define XCAP1                  (0x0008)       /* XIN/XOUT Cap Bit: 1 */
4207
#define XT1BYPASS              (0x0010)       /* XT1 bypass mode : 0: internal 1:sourced from external pin */
4208
#define XTS                    (0x0020)       /* 1: Selects high-freq. oscillator */
4209
#define XT1DRIVE0              (0x0040)       /* XT1 Drive Level mode Bit 0 */
4210
#define XT1DRIVE1              (0x0080)       /* XT1 Drive Level mode Bit 1 */
4211
#define XT2OFF                 (0x0100)       /* High Frequency Oscillator 2 (XT2) disable */
4212
//#define RESERVED            (0x0200)    /* RESERVED */
4213
//#define RESERVED            (0x0400)    /* RESERVED */
4214
//#define RESERVED            (0x0800)    /* RESERVED */
4215
#define XT2BYPASS              (0x1000)       /* XT2 bypass mode : 0: internal 1:sourced from external pin */
4216
//#define RESERVED            (0x2000)    /* RESERVED */
4217
#define XT2DRIVE0              (0x4000)       /* XT2 Drive Level mode Bit 0 */
4218
#define XT2DRIVE1              (0x8000)       /* XT2 Drive Level mode Bit 1 */
4219
 
4220
/* UCSCTL6 Control Bits */
4221
#define XT1OFF_L               (0x0001)       /* High Frequency Oscillator 1 (XT1) disable */
4222
#define SMCLKOFF_L             (0x0002)       /* SMCLK Off */
4223
#define XCAP0_L                (0x0004)       /* XIN/XOUT Cap Bit: 0 */
4224
#define XCAP1_L                (0x0008)       /* XIN/XOUT Cap Bit: 1 */
4225
#define XT1BYPASS_L            (0x0010)       /* XT1 bypass mode : 0: internal 1:sourced from external pin */
4226
#define XTS_L                  (0x0020)       /* 1: Selects high-freq. oscillator */
4227
#define XT1DRIVE0_L            (0x0040)       /* XT1 Drive Level mode Bit 0 */
4228
#define XT1DRIVE1_L            (0x0080)       /* XT1 Drive Level mode Bit 1 */
4229
//#define RESERVED            (0x0200)    /* RESERVED */
4230
//#define RESERVED            (0x0400)    /* RESERVED */
4231
//#define RESERVED            (0x0800)    /* RESERVED */
4232
//#define RESERVED            (0x2000)    /* RESERVED */
4233
 
4234
/* UCSCTL6 Control Bits */
4235
#define XT2OFF_H               (0x0001)       /* High Frequency Oscillator 2 (XT2) disable */
4236
//#define RESERVED            (0x0200)    /* RESERVED */
4237
//#define RESERVED            (0x0400)    /* RESERVED */
4238
//#define RESERVED            (0x0800)    /* RESERVED */
4239
#define XT2BYPASS_H            (0x0010)       /* XT2 bypass mode : 0: internal 1:sourced from external pin */
4240
//#define RESERVED            (0x2000)    /* RESERVED */
4241
#define XT2DRIVE0_H            (0x0040)       /* XT2 Drive Level mode Bit 0 */
4242
#define XT2DRIVE1_H            (0x0080)       /* XT2 Drive Level mode Bit 1 */
4243
 
4244
#define XCAP_0                 (0x0000)       /* XIN/XOUT Cap 0 */
4245
#define XCAP_1                 (0x0004)       /* XIN/XOUT Cap 1 */
4246
#define XCAP_2                 (0x0008)       /* XIN/XOUT Cap 2 */
4247
#define XCAP_3                 (0x000C)       /* XIN/XOUT Cap 3 */
4248
#define XT1DRIVE_0             (0x0000)       /* XT1 Drive Level mode: 0 */
4249
#define XT1DRIVE_1             (0x0040)       /* XT1 Drive Level mode: 1 */
4250
#define XT1DRIVE_2             (0x0080)       /* XT1 Drive Level mode: 2 */
4251
#define XT1DRIVE_3             (0x00C0)       /* XT1 Drive Level mode: 3 */
4252
#define XT2DRIVE_0             (0x0000)       /* XT2 Drive Level mode: 0 */
4253
#define XT2DRIVE_1             (0x4000)       /* XT2 Drive Level mode: 1 */
4254
#define XT2DRIVE_2             (0x8000)       /* XT2 Drive Level mode: 2 */
4255
#define XT2DRIVE_3             (0xC000)       /* XT2 Drive Level mode: 3 */
4256
 
4257
/* UCSCTL7 Control Bits */
4258
#define DCOFFG                 (0x0001)       /* DCO Fault Flag */
4259
#define XT1LFOFFG              (0x0002)       /* XT1 Low Frequency Oscillator Fault Flag */
4260
//#define RESERVED            (0x0004)    /* RESERVED */
4261
#define XT2OFFG                (0x0008)       /* High Frequency Oscillator 2 Fault Flag */
4262
//#define RESERVED            (0x0010)    /* RESERVED */
4263
//#define RESERVED            (0x0020)    /* RESERVED */
4264
//#define RESERVED            (0x0040)    /* RESERVED */
4265
//#define RESERVED            (0x0080)    /* RESERVED */
4266
//#define RESERVED            (0x0100)    /* RESERVED */
4267
//#define RESERVED            (0x0200)    /* RESERVED */
4268
//#define RESERVED            (0x0400)    /* RESERVED */
4269
//#define RESERVED            (0x0800)    /* RESERVED */
4270
//#define RESERVED            (0x1000)    /* RESERVED */
4271
//#define RESERVED            (0x2000)    /* RESERVED */
4272
//#define RESERVED            (0x4000)    /* RESERVED */
4273
//#define RESERVED            (0x8000)    /* RESERVED */
4274
 
4275
/* UCSCTL7 Control Bits */
4276
#define DCOFFG_L               (0x0001)       /* DCO Fault Flag */
4277
#define XT1LFOFFG_L            (0x0002)       /* XT1 Low Frequency Oscillator Fault Flag */
4278
//#define RESERVED            (0x0004)    /* RESERVED */
4279
#define XT2OFFG_L              (0x0008)       /* High Frequency Oscillator 2 Fault Flag */
4280
//#define RESERVED            (0x0010)    /* RESERVED */
4281
//#define RESERVED            (0x0020)    /* RESERVED */
4282
//#define RESERVED            (0x0040)    /* RESERVED */
4283
//#define RESERVED            (0x0080)    /* RESERVED */
4284
//#define RESERVED            (0x0100)    /* RESERVED */
4285
//#define RESERVED            (0x0200)    /* RESERVED */
4286
//#define RESERVED            (0x0400)    /* RESERVED */
4287
//#define RESERVED            (0x0800)    /* RESERVED */
4288
//#define RESERVED            (0x1000)    /* RESERVED */
4289
//#define RESERVED            (0x2000)    /* RESERVED */
4290
//#define RESERVED            (0x4000)    /* RESERVED */
4291
//#define RESERVED            (0x8000)    /* RESERVED */
4292
 
4293
/* UCSCTL7 Control Bits */
4294
//#define RESERVED            (0x0004)    /* RESERVED */
4295
//#define RESERVED            (0x0010)    /* RESERVED */
4296
//#define RESERVED            (0x0020)    /* RESERVED */
4297
//#define RESERVED            (0x0040)    /* RESERVED */
4298
//#define RESERVED            (0x0080)    /* RESERVED */
4299
//#define RESERVED            (0x0100)    /* RESERVED */
4300
//#define RESERVED            (0x0200)    /* RESERVED */
4301
//#define RESERVED            (0x0400)    /* RESERVED */
4302
//#define RESERVED            (0x0800)    /* RESERVED */
4303
//#define RESERVED            (0x1000)    /* RESERVED */
4304
//#define RESERVED            (0x2000)    /* RESERVED */
4305
//#define RESERVED            (0x4000)    /* RESERVED */
4306
//#define RESERVED            (0x8000)    /* RESERVED */
4307
 
4308
/* UCSCTL8 Control Bits */
4309
#define ACLKREQEN              (0x0001)       /* ACLK Clock Request Enable */
4310
#define MCLKREQEN              (0x0002)       /* MCLK Clock Request Enable */
4311
#define SMCLKREQEN             (0x0004)       /* SMCLK Clock Request Enable */
4312
#define MODOSCREQEN            (0x0008)       /* MODOSC Clock Request Enable */
4313
//#define RESERVED            (0x0010)    /* RESERVED */
4314
//#define RESERVED            (0x0020)    /* RESERVED */
4315
//#define RESERVED            (0x0040)    /* RESERVED */
4316
//#define RESERVED            (0x0080)    /* RESERVED */
4317
//#define RESERVED            (0x0100)    /* RESERVED */
4318
//#define RESERVED            (0x0200)    /* RESERVED */
4319
//#define RESERVED            (0x0400)    /* RESERVED */
4320
//#define RESERVED            (0x0800)    /* RESERVED */
4321
//#define RESERVED            (0x1000)    /* RESERVED */
4322
//#define RESERVED            (0x2000)    /* RESERVED */
4323
//#define RESERVED            (0x4000)    /* RESERVED */
4324
//#define RESERVED            (0x8000)    /* RESERVED */
4325
 
4326
/* UCSCTL8 Control Bits */
4327
#define ACLKREQEN_L            (0x0001)       /* ACLK Clock Request Enable */
4328
#define MCLKREQEN_L            (0x0002)       /* MCLK Clock Request Enable */
4329
#define SMCLKREQEN_L           (0x0004)       /* SMCLK Clock Request Enable */
4330
#define MODOSCREQEN_L          (0x0008)       /* MODOSC Clock Request Enable */
4331
//#define RESERVED            (0x0010)    /* RESERVED */
4332
//#define RESERVED            (0x0020)    /* RESERVED */
4333
//#define RESERVED            (0x0040)    /* RESERVED */
4334
//#define RESERVED            (0x0080)    /* RESERVED */
4335
//#define RESERVED            (0x0100)    /* RESERVED */
4336
//#define RESERVED            (0x0200)    /* RESERVED */
4337
//#define RESERVED            (0x0400)    /* RESERVED */
4338
//#define RESERVED            (0x0800)    /* RESERVED */
4339
//#define RESERVED            (0x1000)    /* RESERVED */
4340
//#define RESERVED            (0x2000)    /* RESERVED */
4341
//#define RESERVED            (0x4000)    /* RESERVED */
4342
//#define RESERVED            (0x8000)    /* RESERVED */
4343
 
4344
/* UCSCTL8 Control Bits */
4345
//#define RESERVED            (0x0010)    /* RESERVED */
4346
//#define RESERVED            (0x0020)    /* RESERVED */
4347
//#define RESERVED            (0x0040)    /* RESERVED */
4348
//#define RESERVED            (0x0080)    /* RESERVED */
4349
//#define RESERVED            (0x0100)    /* RESERVED */
4350
//#define RESERVED            (0x0200)    /* RESERVED */
4351
//#define RESERVED            (0x0400)    /* RESERVED */
4352
//#define RESERVED            (0x0800)    /* RESERVED */
4353
//#define RESERVED            (0x1000)    /* RESERVED */
4354
//#define RESERVED            (0x2000)    /* RESERVED */
4355
//#define RESERVED            (0x4000)    /* RESERVED */
4356
//#define RESERVED            (0x8000)    /* RESERVED */
4357
 
4358
/************************************************************
4359
* USCI A0
4360
************************************************************/
4361
#define __MSP430_HAS_USCI_A0__                /* Definition to show that Module is available */
4362
#define __MSP430_BASEADDRESS_USCI_A0__ 0x05C0
4363
 
4364
SFR_16BIT(UCA0CTLW0);                         /* USCI A0 Control Word Register 0 */
4365
SFR_8BIT(UCA0CTLW0_L);                        /* USCI A0 Control Word Register 0 */
4366
SFR_8BIT(UCA0CTLW0_H);                        /* USCI A0 Control Word Register 0 */
4367
#define UCA0CTL1               UCA0CTLW0_L    /* USCI A0 Control Register 1 */
4368
#define UCA0CTL0               UCA0CTLW0_H    /* USCI A0 Control Register 0 */
4369
SFR_16BIT(UCA0BRW);                           /* USCI A0 Baud Word Rate 0 */
4370
SFR_8BIT(UCA0BRW_L);                          /* USCI A0 Baud Word Rate 0 */
4371
SFR_8BIT(UCA0BRW_H);                          /* USCI A0 Baud Word Rate 0 */
4372
#define UCA0BR0                UCA0BRW_L      /* USCI A0 Baud Rate 0 */
4373
#define UCA0BR1                UCA0BRW_H      /* USCI A0 Baud Rate 1 */
4374
SFR_8BIT(UCA0MCTL);                           /* USCI A0 Modulation Control */
4375
SFR_8BIT(UCA0STAT);                           /* USCI A0 Status Register */
4376
SFR_8BIT(UCA0RXBUF);                          /* USCI A0 Receive Buffer */
4377
SFR_8BIT(UCA0TXBUF);                          /* USCI A0 Transmit Buffer */
4378
SFR_8BIT(UCA0ABCTL);                          /* USCI A0 LIN Control */
4379
SFR_16BIT(UCA0IRCTL);                         /* USCI A0 IrDA Transmit Control */
4380
SFR_8BIT(UCA0IRCTL_L);                        /* USCI A0 IrDA Transmit Control */
4381
SFR_8BIT(UCA0IRCTL_H);                        /* USCI A0 IrDA Transmit Control */
4382
#define UCA0IRTCTL             UCA0IRCTL_L    /* USCI A0 IrDA Transmit Control */
4383
#define UCA0IRRCTL             UCA0IRCTL_H    /* USCI A0 IrDA Receive Control */
4384
SFR_16BIT(UCA0ICTL);                          /* USCI A0 Interrupt Enable Register */
4385
SFR_8BIT(UCA0ICTL_L);                         /* USCI A0 Interrupt Enable Register */
4386
SFR_8BIT(UCA0ICTL_H);                         /* USCI A0 Interrupt Enable Register */
4387
#define UCA0IE                 UCA0ICTL_L     /* USCI A0 Interrupt Enable Register */
4388
#define UCA0IFG                UCA0ICTL_H     /* USCI A0 Interrupt Flags Register */
4389
SFR_16BIT(UCA0IV);                            /* USCI A0 Interrupt Vector Register */
4390
 
4391
 
4392
/************************************************************
4393
* USCI B0
4394
************************************************************/
4395
#define __MSP430_HAS_USCI_B0__                /* Definition to show that Module is available */
4396
#define __MSP430_BASEADDRESS_USCI_B0__ 0x05E0
4397
 
4398
 
4399
SFR_16BIT(UCB0CTLW0);                         /* USCI B0 Control Word Register 0 */
4400
SFR_8BIT(UCB0CTLW0_L);                        /* USCI B0 Control Word Register 0 */
4401
SFR_8BIT(UCB0CTLW0_H);                        /* USCI B0 Control Word Register 0 */
4402
#define UCB0CTL1               UCB0CTLW0_L    /* USCI B0 Control Register 1 */
4403
#define UCB0CTL0               UCB0CTLW0_H    /* USCI B0 Control Register 0 */
4404
SFR_16BIT(UCB0BRW);                           /* USCI B0 Baud Word Rate 0 */
4405
SFR_8BIT(UCB0BRW_L);                          /* USCI B0 Baud Word Rate 0 */
4406
SFR_8BIT(UCB0BRW_H);                          /* USCI B0 Baud Word Rate 0 */
4407
#define UCB0BR0                UCB0BRW_L      /* USCI B0 Baud Rate 0 */
4408
#define UCB0BR1                UCB0BRW_H      /* USCI B0 Baud Rate 1 */
4409
SFR_8BIT(UCB0STAT);                           /* USCI B0 Status Register */
4410
SFR_8BIT(UCB0RXBUF);                          /* USCI B0 Receive Buffer */
4411
SFR_8BIT(UCB0TXBUF);                          /* USCI B0 Transmit Buffer */
4412
SFR_16BIT(UCB0I2COA);                         /* USCI B0 I2C Own Address */
4413
SFR_8BIT(UCB0I2COA_L);                        /* USCI B0 I2C Own Address */
4414
SFR_8BIT(UCB0I2COA_H);                        /* USCI B0 I2C Own Address */
4415
SFR_16BIT(UCB0I2CSA);                         /* USCI B0 I2C Slave Address */
4416
SFR_8BIT(UCB0I2CSA_L);                        /* USCI B0 I2C Slave Address */
4417
SFR_8BIT(UCB0I2CSA_H);                        /* USCI B0 I2C Slave Address */
4418
SFR_16BIT(UCB0ICTL);                          /* USCI B0 Interrupt Enable Register */
4419
SFR_8BIT(UCB0ICTL_L);                         /* USCI B0 Interrupt Enable Register */
4420
SFR_8BIT(UCB0ICTL_H);                         /* USCI B0 Interrupt Enable Register */
4421
#define UCB0IE                 UCB0ICTL_L     /* USCI B0 Interrupt Enable Register */
4422
#define UCB0IFG                UCB0ICTL_H     /* USCI B0 Interrupt Flags Register */
4423
SFR_16BIT(UCB0IV);                            /* USCI B0 Interrupt Vector Register */
4424
 
4425
// UCAxCTL0 UART-Mode Control Bits
4426
#define UCPEN                  (0x80)         /* Async. Mode: Parity enable */
4427
#define UCPAR                  (0x40)         /* Async. Mode: Parity     0:odd / 1:even */
4428
#define UCMSB                  (0x20)         /* Async. Mode: MSB first  0:LSB / 1:MSB */
4429
#define UC7BIT                 (0x10)         /* Async. Mode: Data Bits  0:8-bits / 1:7-bits */
4430
#define UCSPB                  (0x08)         /* Async. Mode: Stop Bits  0:one / 1: two */
4431
#define UCMODE1                (0x04)         /* Async. Mode: USCI Mode 1 */
4432
#define UCMODE0                (0x02)         /* Async. Mode: USCI Mode 0 */
4433
#define UCSYNC                 (0x01)         /* Sync-Mode  0:UART-Mode / 1:SPI-Mode */
4434
 
4435
// UCxxCTL0 SPI-Mode Control Bits
4436
#define UCCKPH                 (0x80)         /* Sync. Mode: Clock Phase */
4437
#define UCCKPL                 (0x40)         /* Sync. Mode: Clock Polarity */
4438
#define UCMST                  (0x08)         /* Sync. Mode: Master Select */
4439
 
4440
// UCBxCTL0 I2C-Mode Control Bits
4441
#define UCA10                  (0x80)         /* 10-bit Address Mode */
4442
#define UCSLA10                (0x40)         /* 10-bit Slave Address Mode */
4443
#define UCMM                   (0x20)         /* Multi-Master Environment */
4444
//#define res               (0x10)    /* reserved */
4445
#define UCMODE_0               (0x00)         /* Sync. Mode: USCI Mode: 0 */
4446
#define UCMODE_1               (0x02)         /* Sync. Mode: USCI Mode: 1 */
4447
#define UCMODE_2               (0x04)         /* Sync. Mode: USCI Mode: 2 */
4448
#define UCMODE_3               (0x06)         /* Sync. Mode: USCI Mode: 3 */
4449
 
4450
// UCAxCTL1 UART-Mode Control Bits
4451
#define UCSSEL1                (0x80)         /* USCI 0 Clock Source Select 1 */
4452
#define UCSSEL0                (0x40)         /* USCI 0 Clock Source Select 0 */
4453
#define UCRXEIE                (0x20)         /* RX Error interrupt enable */
4454
#define UCBRKIE                (0x10)         /* Break interrupt enable */
4455
#define UCDORM                 (0x08)         /* Dormant (Sleep) Mode */
4456
#define UCTXADDR               (0x04)         /* Send next Data as Address */
4457
#define UCTXBRK                (0x02)         /* Send next Data as Break */
4458
#define UCSWRST                (0x01)         /* USCI Software Reset */
4459
 
4460
// UCxxCTL1 SPI-Mode Control Bits
4461
//#define res               (0x20)    /* reserved */
4462
//#define res               (0x10)    /* reserved */
4463
//#define res               (0x08)    /* reserved */
4464
//#define res               (0x04)    /* reserved */
4465
//#define res               (0x02)    /* reserved */
4466
 
4467
// UCBxCTL1 I2C-Mode Control Bits
4468
//#define res               (0x20)    /* reserved */
4469
#define UCTR                   (0x10)         /* Transmit/Receive Select/Flag */
4470
#define UCTXNACK               (0x08)         /* Transmit NACK */
4471
#define UCTXSTP                (0x04)         /* Transmit STOP */
4472
#define UCTXSTT                (0x02)         /* Transmit START */
4473
#define UCSSEL_0               (0x00)         /* USCI 0 Clock Source: 0 */
4474
#define UCSSEL_1               (0x40)         /* USCI 0 Clock Source: 1 */
4475
#define UCSSEL_2               (0x80)         /* USCI 0 Clock Source: 2 */
4476
#define UCSSEL_3               (0xC0)         /* USCI 0 Clock Source: 3 */
4477
#define UCSSEL__UCLK           (0x00)         /* USCI 0 Clock Source: UCLK */
4478
#define UCSSEL__ACLK           (0x40)         /* USCI 0 Clock Source: ACLK */
4479
#define UCSSEL__SMCLK          (0x80)         /* USCI 0 Clock Source: SMCLK */
4480
 
4481
/* UCAxMCTL Control Bits */
4482
#define UCBRF3                 (0x80)         /* USCI First Stage Modulation Select 3 */
4483
#define UCBRF2                 (0x40)         /* USCI First Stage Modulation Select 2 */
4484
#define UCBRF1                 (0x20)         /* USCI First Stage Modulation Select 1 */
4485
#define UCBRF0                 (0x10)         /* USCI First Stage Modulation Select 0 */
4486
#define UCBRS2                 (0x08)         /* USCI Second Stage Modulation Select 2 */
4487
#define UCBRS1                 (0x04)         /* USCI Second Stage Modulation Select 1 */
4488
#define UCBRS0                 (0x02)         /* USCI Second Stage Modulation Select 0 */
4489
#define UCOS16                 (0x01)         /* USCI 16-times Oversampling enable */
4490
 
4491
#define UCBRF_0                (0x00)         /* USCI First Stage Modulation: 0 */
4492
#define UCBRF_1                (0x10)         /* USCI First Stage Modulation: 1 */
4493
#define UCBRF_2                (0x20)         /* USCI First Stage Modulation: 2 */
4494
#define UCBRF_3                (0x30)         /* USCI First Stage Modulation: 3 */
4495
#define UCBRF_4                (0x40)         /* USCI First Stage Modulation: 4 */
4496
#define UCBRF_5                (0x50)         /* USCI First Stage Modulation: 5 */
4497
#define UCBRF_6                (0x60)         /* USCI First Stage Modulation: 6 */
4498
#define UCBRF_7                (0x70)         /* USCI First Stage Modulation: 7 */
4499
#define UCBRF_8                (0x80)         /* USCI First Stage Modulation: 8 */
4500
#define UCBRF_9                (0x90)         /* USCI First Stage Modulation: 9 */
4501
#define UCBRF_10               (0xA0)         /* USCI First Stage Modulation: A */
4502
#define UCBRF_11               (0xB0)         /* USCI First Stage Modulation: B */
4503
#define UCBRF_12               (0xC0)         /* USCI First Stage Modulation: C */
4504
#define UCBRF_13               (0xD0)         /* USCI First Stage Modulation: D */
4505
#define UCBRF_14               (0xE0)         /* USCI First Stage Modulation: E */
4506
#define UCBRF_15               (0xF0)         /* USCI First Stage Modulation: F */
4507
 
4508
#define UCBRS_0                (0x00)         /* USCI Second Stage Modulation: 0 */
4509
#define UCBRS_1                (0x02)         /* USCI Second Stage Modulation: 1 */
4510
#define UCBRS_2                (0x04)         /* USCI Second Stage Modulation: 2 */
4511
#define UCBRS_3                (0x06)         /* USCI Second Stage Modulation: 3 */
4512
#define UCBRS_4                (0x08)         /* USCI Second Stage Modulation: 4 */
4513
#define UCBRS_5                (0x0A)         /* USCI Second Stage Modulation: 5 */
4514
#define UCBRS_6                (0x0C)         /* USCI Second Stage Modulation: 6 */
4515
#define UCBRS_7                (0x0E)         /* USCI Second Stage Modulation: 7 */
4516
 
4517
/* UCAxSTAT Control Bits */
4518
#define UCLISTEN               (0x80)         /* USCI Listen mode */
4519
#define UCFE                   (0x40)         /* USCI Frame Error Flag */
4520
#define UCOE                   (0x20)         /* USCI Overrun Error Flag */
4521
#define UCPE                   (0x10)         /* USCI Parity Error Flag */
4522
#define UCBRK                  (0x08)         /* USCI Break received */
4523
#define UCRXERR                (0x04)         /* USCI RX Error Flag */
4524
#define UCADDR                 (0x02)         /* USCI Address received Flag */
4525
#define UCBUSY                 (0x01)         /* USCI Busy Flag */
4526
#define UCIDLE                 (0x02)         /* USCI Idle line detected Flag */
4527
 
4528
/* UCBxSTAT Control Bits */
4529
#define UCSCLLOW               (0x40)         /* SCL low */
4530
#define UCGC                   (0x20)         /* General Call address received Flag */
4531
#define UCBBUSY                (0x10)         /* Bus Busy Flag */
4532
 
4533
/* UCAxIRTCTL Control Bits */
4534
#define UCIRTXPL5              (0x80)         /* IRDA Transmit Pulse Length 5 */
4535
#define UCIRTXPL4              (0x40)         /* IRDA Transmit Pulse Length 4 */
4536
#define UCIRTXPL3              (0x20)         /* IRDA Transmit Pulse Length 3 */
4537
#define UCIRTXPL2              (0x10)         /* IRDA Transmit Pulse Length 2 */
4538
#define UCIRTXPL1              (0x08)         /* IRDA Transmit Pulse Length 1 */
4539
#define UCIRTXPL0              (0x04)         /* IRDA Transmit Pulse Length 0 */
4540
#define UCIRTXCLK              (0x02)         /* IRDA Transmit Pulse Clock Select */
4541
#define UCIREN                 (0x01)         /* IRDA Encoder/Decoder enable */
4542
 
4543
/* UCAxIRRCTL Control Bits */
4544
#define UCIRRXFL5              (0x80)         /* IRDA Receive Filter Length 5 */
4545
#define UCIRRXFL4              (0x40)         /* IRDA Receive Filter Length 4 */
4546
#define UCIRRXFL3              (0x20)         /* IRDA Receive Filter Length 3 */
4547
#define UCIRRXFL2              (0x10)         /* IRDA Receive Filter Length 2 */
4548
#define UCIRRXFL1              (0x08)         /* IRDA Receive Filter Length 1 */
4549
#define UCIRRXFL0              (0x04)         /* IRDA Receive Filter Length 0 */
4550
#define UCIRRXPL               (0x02)         /* IRDA Receive Input Polarity */
4551
#define UCIRRXFE               (0x01)         /* IRDA Receive Filter enable */
4552
 
4553
/* UCAxABCTL Control Bits */
4554
//#define res               (0x80)    /* reserved */
4555
//#define res               (0x40)    /* reserved */
4556
#define UCDELIM1               (0x20)         /* Break Sync Delimiter 1 */
4557
#define UCDELIM0               (0x10)         /* Break Sync Delimiter 0 */
4558
#define UCSTOE                 (0x08)         /* Sync-Field Timeout error */
4559
#define UCBTOE                 (0x04)         /* Break Timeout error */
4560
//#define res               (0x02)    /* reserved */
4561
#define UCABDEN                (0x01)         /* Auto Baud Rate detect enable */
4562
 
4563
/* UCBxI2COA Control Bits */
4564
#define UCGCEN                 (0x8000)       /* I2C General Call enable */
4565
#define UCOA9                  (0x0200)       /* I2C Own Address 9 */
4566
#define UCOA8                  (0x0100)       /* I2C Own Address 8 */
4567
#define UCOA7                  (0x0080)       /* I2C Own Address 7 */
4568
#define UCOA6                  (0x0040)       /* I2C Own Address 6 */
4569
#define UCOA5                  (0x0020)       /* I2C Own Address 5 */
4570
#define UCOA4                  (0x0010)       /* I2C Own Address 4 */
4571
#define UCOA3                  (0x0008)       /* I2C Own Address 3 */
4572
#define UCOA2                  (0x0004)       /* I2C Own Address 2 */
4573
#define UCOA1                  (0x0002)       /* I2C Own Address 1 */
4574
#define UCOA0                  (0x0001)       /* I2C Own Address 0 */
4575
 
4576
/* UCBxI2COA Control Bits */
4577
#define UCOA7_L                (0x0080)       /* I2C Own Address 7 */
4578
#define UCOA6_L                (0x0040)       /* I2C Own Address 6 */
4579
#define UCOA5_L                (0x0020)       /* I2C Own Address 5 */
4580
#define UCOA4_L                (0x0010)       /* I2C Own Address 4 */
4581
#define UCOA3_L                (0x0008)       /* I2C Own Address 3 */
4582
#define UCOA2_L                (0x0004)       /* I2C Own Address 2 */
4583
#define UCOA1_L                (0x0002)       /* I2C Own Address 1 */
4584
#define UCOA0_L                (0x0001)       /* I2C Own Address 0 */
4585
 
4586
/* UCBxI2COA Control Bits */
4587
#define UCGCEN_H               (0x0080)       /* I2C General Call enable */
4588
#define UCOA9_H                (0x0002)       /* I2C Own Address 9 */
4589
#define UCOA8_H                (0x0001)       /* I2C Own Address 8 */
4590
 
4591
/* UCBxI2CSA Control Bits */
4592
#define UCSA9                  (0x0200)       /* I2C Slave Address 9 */
4593
#define UCSA8                  (0x0100)       /* I2C Slave Address 8 */
4594
#define UCSA7                  (0x0080)       /* I2C Slave Address 7 */
4595
#define UCSA6                  (0x0040)       /* I2C Slave Address 6 */
4596
#define UCSA5                  (0x0020)       /* I2C Slave Address 5 */
4597
#define UCSA4                  (0x0010)       /* I2C Slave Address 4 */
4598
#define UCSA3                  (0x0008)       /* I2C Slave Address 3 */
4599
#define UCSA2                  (0x0004)       /* I2C Slave Address 2 */
4600
#define UCSA1                  (0x0002)       /* I2C Slave Address 1 */
4601
#define UCSA0                  (0x0001)       /* I2C Slave Address 0 */
4602
 
4603
/* UCBxI2CSA Control Bits */
4604
#define UCSA7_L                (0x0080)       /* I2C Slave Address 7 */
4605
#define UCSA6_L                (0x0040)       /* I2C Slave Address 6 */
4606
#define UCSA5_L                (0x0020)       /* I2C Slave Address 5 */
4607
#define UCSA4_L                (0x0010)       /* I2C Slave Address 4 */
4608
#define UCSA3_L                (0x0008)       /* I2C Slave Address 3 */
4609
#define UCSA2_L                (0x0004)       /* I2C Slave Address 2 */
4610
#define UCSA1_L                (0x0002)       /* I2C Slave Address 1 */
4611
#define UCSA0_L                (0x0001)       /* I2C Slave Address 0 */
4612
 
4613
/* UCBxI2CSA Control Bits */
4614
#define UCSA9_H                (0x0002)       /* I2C Slave Address 9 */
4615
#define UCSA8_H                (0x0001)       /* I2C Slave Address 8 */
4616
 
4617
/* UCAxIE Control Bits */
4618
#define UCTXIE                 (0x0002)       /* USCI Transmit Interrupt Enable */
4619
#define UCRXIE                 (0x0001)       /* USCI Receive Interrupt Enable */
4620
 
4621
/* UCBxIE Control Bits */
4622
#define UCNACKIE               (0x0020)       /* NACK Condition interrupt enable */
4623
#define UCALIE                 (0x0010)       /* Arbitration Lost interrupt enable */
4624
#define UCSTPIE                (0x0008)       /* STOP Condition interrupt enable */
4625
#define UCSTTIE                (0x0004)       /* START Condition interrupt enable */
4626
#define UCTXIE                 (0x0002)       /* USCI Transmit Interrupt Enable */
4627
#define UCRXIE                 (0x0001)       /* USCI Receive Interrupt Enable */
4628
 
4629
/* UCAxIFG Control Bits */
4630
#define UCTXIFG                (0x0002)       /* USCI Transmit Interrupt Flag */
4631
#define UCRXIFG                (0x0001)       /* USCI Receive Interrupt Flag */
4632
 
4633
/* UCBxIFG Control Bits */
4634
#define UCNACKIFG              (0x0020)       /* NAK Condition interrupt Flag */
4635
#define UCALIFG                (0x0010)       /* Arbitration Lost interrupt Flag */
4636
#define UCSTPIFG               (0x0008)       /* STOP Condition interrupt Flag */
4637
#define UCSTTIFG               (0x0004)       /* START Condition interrupt Flag */
4638
#define UCTXIFG                (0x0002)       /* USCI Transmit Interrupt Flag */
4639
#define UCRXIFG                (0x0001)       /* USCI Receive Interrupt Flag */
4640
 
4641
/* USCI Definitions */
4642
#define USCI_NONE              (0x0000)       /* No Interrupt pending */
4643
#define USCI_UCRXIFG           (0x0002)       /* USCI UCRXIFG */
4644
#define USCI_UCTXIFG           (0x0004)       /* USCI UCTXIFG */
4645
#define USCI_I2C_UCALIFG       (0x0002)       /* USCI I2C Mode: UCALIFG */
4646
#define USCI_I2C_UCNACKIFG     (0x0004)       /* USCI I2C Mode: UCNACKIFG */
4647
#define USCI_I2C_UCSTTIFG      (0x0006)       /* USCI I2C Mode: UCSTTIFG*/
4648
#define USCI_I2C_UCSTPIFG      (0x0008)       /* USCI I2C Mode: UCSTPIFG*/
4649
#define USCI_I2C_UCRXIFG       (0x000A)       /* USCI I2C Mode: UCRXIFG */
4650
#define USCI_I2C_UCTXIFG       (0x000C)       /* USCI I2C Mode: UCTXIFG */
4651
 
4652
/************************************************************
4653
* USCI A1
4654
************************************************************/
4655
#define __MSP430_HAS_USCI_A1__                /* Definition to show that Module is available */
4656
#define __MSP430_BASEADDRESS_USCI_A1__ 0x0600
4657
 
4658
SFR_16BIT(UCA1CTLW0);                         /* USCI A1 Control Word Register 0 */
4659
SFR_8BIT(UCA1CTLW0_L);                        /* USCI A1 Control Word Register 0 */
4660
SFR_8BIT(UCA1CTLW0_H);                        /* USCI A1 Control Word Register 0 */
4661
#define UCA1CTL1               UCA1CTLW0_L    /* USCI A1 Control Register 1 */
4662
#define UCA1CTL0               UCA1CTLW0_H    /* USCI A1 Control Register 0 */
4663
SFR_16BIT(UCA1BRW);                           /* USCI A1 Baud Word Rate 0 */
4664
SFR_8BIT(UCA1BRW_L);                          /* USCI A1 Baud Word Rate 0 */
4665
SFR_8BIT(UCA1BRW_H);                          /* USCI A1 Baud Word Rate 0 */
4666
#define UCA1BR0                UCA1BRW_L      /* USCI A1 Baud Rate 0 */
4667
#define UCA1BR1                UCA1BRW_H      /* USCI A1 Baud Rate 1 */
4668
SFR_8BIT(UCA1MCTL);                           /* USCI A1 Modulation Control */
4669
SFR_8BIT(UCA1STAT);                           /* USCI A1 Status Register */
4670
SFR_8BIT(UCA1RXBUF);                          /* USCI A1 Receive Buffer */
4671
SFR_8BIT(UCA1TXBUF);                          /* USCI A1 Transmit Buffer */
4672
SFR_8BIT(UCA1ABCTL);                          /* USCI A1 LIN Control */
4673
SFR_16BIT(UCA1IRCTL);                         /* USCI A1 IrDA Transmit Control */
4674
SFR_8BIT(UCA1IRCTL_L);                        /* USCI A1 IrDA Transmit Control */
4675
SFR_8BIT(UCA1IRCTL_H);                        /* USCI A1 IrDA Transmit Control */
4676
#define UCA1IRTCTL             UCA1IRCTL_L    /* USCI A1 IrDA Transmit Control */
4677
#define UCA1IRRCTL             UCA1IRCTL_H    /* USCI A1 IrDA Receive Control */
4678
SFR_16BIT(UCA1ICTL);                          /* USCI A1 Interrupt Enable Register */
4679
SFR_8BIT(UCA1ICTL_L);                         /* USCI A1 Interrupt Enable Register */
4680
SFR_8BIT(UCA1ICTL_H);                         /* USCI A1 Interrupt Enable Register */
4681
#define UCA1IE                 UCA1ICTL_L     /* USCI A1 Interrupt Enable Register */
4682
#define UCA1IFG                UCA1ICTL_H     /* USCI A1 Interrupt Flags Register */
4683
SFR_16BIT(UCA1IV);                            /* USCI A1 Interrupt Vector Register */
4684
 
4685
 
4686
/************************************************************
4687
* USCI B1
4688
************************************************************/
4689
#define __MSP430_HAS_USCI_B1__                /* Definition to show that Module is available */
4690
#define __MSP430_BASEADDRESS_USCI_B1__ 0x0620
4691
 
4692
 
4693
SFR_16BIT(UCB1CTLW0);                         /* USCI B1 Control Word Register 0 */
4694
SFR_8BIT(UCB1CTLW0_L);                        /* USCI B1 Control Word Register 0 */
4695
SFR_8BIT(UCB1CTLW0_H);                        /* USCI B1 Control Word Register 0 */
4696
#define UCB1CTL1               UCB1CTLW0_L    /* USCI B1 Control Register 1 */
4697
#define UCB1CTL0               UCB1CTLW0_H    /* USCI B1 Control Register 0 */
4698
SFR_16BIT(UCB1BRW);                           /* USCI B1 Baud Word Rate 0 */
4699
SFR_8BIT(UCB1BRW_L);                          /* USCI B1 Baud Word Rate 0 */
4700
SFR_8BIT(UCB1BRW_H);                          /* USCI B1 Baud Word Rate 0 */
4701
#define UCB1BR0                UCB1BRW_L      /* USCI B1 Baud Rate 0 */
4702
#define UCB1BR1                UCB1BRW_H      /* USCI B1 Baud Rate 1 */
4703
SFR_8BIT(UCB1STAT);                           /* USCI B1 Status Register */
4704
SFR_8BIT(UCB1RXBUF);                          /* USCI B1 Receive Buffer */
4705
SFR_8BIT(UCB1TXBUF);                          /* USCI B1 Transmit Buffer */
4706
SFR_16BIT(UCB1I2COA);                         /* USCI B1 I2C Own Address */
4707
SFR_8BIT(UCB1I2COA_L);                        /* USCI B1 I2C Own Address */
4708
SFR_8BIT(UCB1I2COA_H);                        /* USCI B1 I2C Own Address */
4709
SFR_16BIT(UCB1I2CSA);                         /* USCI B1 I2C Slave Address */
4710
SFR_8BIT(UCB1I2CSA_L);                        /* USCI B1 I2C Slave Address */
4711
SFR_8BIT(UCB1I2CSA_H);                        /* USCI B1 I2C Slave Address */
4712
SFR_16BIT(UCB1ICTL);                          /* USCI B1 Interrupt Enable Register */
4713
SFR_8BIT(UCB1ICTL_L);                         /* USCI B1 Interrupt Enable Register */
4714
SFR_8BIT(UCB1ICTL_H);                         /* USCI B1 Interrupt Enable Register */
4715
#define UCB1IE                 UCB1ICTL_L     /* USCI B1 Interrupt Enable Register */
4716
#define UCB1IFG                UCB1ICTL_H     /* USCI B1 Interrupt Flags Register */
4717
SFR_16BIT(UCB1IV);                            /* USCI B1 Interrupt Vector Register */
4718
 
4719
/************************************************************
4720
* WATCHDOG TIMER A
4721
************************************************************/
4722
#define __MSP430_HAS_WDT_A__                  /* Definition to show that Module is available */
4723
#define __MSP430_BASEADDRESS_WDT_A__ 0x0150
4724
 
4725
SFR_16BIT(WDTCTL);                            /* Watchdog Timer Control */
4726
SFR_8BIT(WDTCTL_L);                           /* Watchdog Timer Control */
4727
SFR_8BIT(WDTCTL_H);                           /* Watchdog Timer Control */
4728
/* The bit names have been prefixed with "WDT" */
4729
/* WDTCTL Control Bits */
4730
#define WDTIS0                 (0x0001)       /* WDT - Timer Interval Select 0 */
4731
#define WDTIS1                 (0x0002)       /* WDT - Timer Interval Select 1 */
4732
#define WDTIS2                 (0x0004)       /* WDT - Timer Interval Select 2 */
4733
#define WDTCNTCL               (0x0008)       /* WDT - Timer Clear */
4734
#define WDTTMSEL               (0x0010)       /* WDT - Timer Mode Select */
4735
#define WDTSSEL0               (0x0020)       /* WDT - Timer Clock Source Select 0 */
4736
#define WDTSSEL1               (0x0040)       /* WDT - Timer Clock Source Select 1 */
4737
#define WDTHOLD                (0x0080)       /* WDT - Timer hold */
4738
 
4739
/* WDTCTL Control Bits */
4740
#define WDTIS0_L               (0x0001)       /* WDT - Timer Interval Select 0 */
4741
#define WDTIS1_L               (0x0002)       /* WDT - Timer Interval Select 1 */
4742
#define WDTIS2_L               (0x0004)       /* WDT - Timer Interval Select 2 */
4743
#define WDTCNTCL_L             (0x0008)       /* WDT - Timer Clear */
4744
#define WDTTMSEL_L             (0x0010)       /* WDT - Timer Mode Select */
4745
#define WDTSSEL0_L             (0x0020)       /* WDT - Timer Clock Source Select 0 */
4746
#define WDTSSEL1_L             (0x0040)       /* WDT - Timer Clock Source Select 1 */
4747
#define WDTHOLD_L              (0x0080)       /* WDT - Timer hold */
4748
 
4749
/* WDTCTL Control Bits */
4750
 
4751
#define WDTPW                  (0x5A00)
4752
 
4753
#define WDTIS_0                (0*0x0001u)    /* WDT - Timer Interval Select: /2G */
4754
#define WDTIS_1                (1*0x0001u)    /* WDT - Timer Interval Select: /128M */
4755
#define WDTIS_2                (2*0x0001u)    /* WDT - Timer Interval Select: /8192k */
4756
#define WDTIS_3                (3*0x0001u)    /* WDT - Timer Interval Select: /512k */
4757
#define WDTIS_4                (4*0x0001u)    /* WDT - Timer Interval Select: /32k */
4758
#define WDTIS_5                (5*0x0001u)    /* WDT - Timer Interval Select: /8192 */
4759
#define WDTIS_6                (6*0x0001u)    /* WDT - Timer Interval Select: /512 */
4760
#define WDTIS_7                (7*0x0001u)    /* WDT - Timer Interval Select: /64 */
4761
#define WDTIS__2G              (0*0x0001u)    /* WDT - Timer Interval Select: /2G */
4762
#define WDTIS__128M            (1*0x0001u)    /* WDT - Timer Interval Select: /128M */
4763
#define WDTIS__8192K           (2*0x0001u)    /* WDT - Timer Interval Select: /8192k */
4764
#define WDTIS__512K            (3*0x0001u)    /* WDT - Timer Interval Select: /512k */
4765
#define WDTIS__32K             (4*0x0001u)    /* WDT - Timer Interval Select: /32k */
4766
#define WDTIS__8192            (5*0x0001u)    /* WDT - Timer Interval Select: /8192 */
4767
#define WDTIS__512             (6*0x0001u)    /* WDT - Timer Interval Select: /512 */
4768
#define WDTIS__64              (7*0x0001u)    /* WDT - Timer Interval Select: /64 */
4769
 
4770
#define WDTSSEL_0              (0*0x0020u)    /* WDT - Timer Clock Source Select: SMCLK */
4771
#define WDTSSEL_1              (1*0x0020u)    /* WDT - Timer Clock Source Select: ACLK */
4772
#define WDTSSEL_2              (2*0x0020u)    /* WDT - Timer Clock Source Select: VLO_CLK */
4773
#define WDTSSEL_3              (3*0x0020u)    /* WDT - Timer Clock Source Select: reserved */
4774
#define WDTSSEL__SMCLK         (0*0x0020u)    /* WDT - Timer Clock Source Select: SMCLK */
4775
#define WDTSSEL__ACLK          (1*0x0020u)    /* WDT - Timer Clock Source Select: ACLK */
4776
#define WDTSSEL__VLO           (2*0x0020u)    /* WDT - Timer Clock Source Select: VLO_CLK */
4777
 
4778
/* WDT-interval times [1ms] coded with Bits 0-2 */
4779
/* WDT is clocked by fSMCLK (assumed 1MHz) */
4780
#define WDT_MDLY_32         (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS2)                         /* 32ms interval (default) */
4781
#define WDT_MDLY_8          (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS2+WDTIS0)                  /* 8ms     " */
4782
#define WDT_MDLY_0_5        (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS2+WDTIS1)                  /* 0.5ms   " */
4783
#define WDT_MDLY_0_064      (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS2+WDTIS1+WDTIS0)           /* 0.064ms " */
4784
/* WDT is clocked by fACLK (assumed 32KHz) */
4785
#define WDT_ADLY_1000       (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS2+WDTSSEL0)                /* 1000ms  " */
4786
#define WDT_ADLY_250        (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS2+WDTSSEL0+WDTIS0)         /* 250ms   " */
4787
#define WDT_ADLY_16         (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS2+WDTSSEL0+WDTIS1)         /* 16ms    " */
4788
#define WDT_ADLY_1_9        (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS2+WDTSSEL0+WDTIS1+WDTIS0)  /* 1.9ms   " */
4789
/* Watchdog mode -> reset after expired time */
4790
/* WDT is clocked by fSMCLK (assumed 1MHz) */
4791
#define WDT_MRST_32         (WDTPW+WDTCNTCL+WDTIS2)                                  /* 32ms interval (default) */
4792
#define WDT_MRST_8          (WDTPW+WDTCNTCL+WDTIS2+WDTIS0)                           /* 8ms     " */
4793
#define WDT_MRST_0_5        (WDTPW+WDTCNTCL+WDTIS2+WDTIS1)                           /* 0.5ms   " */
4794
#define WDT_MRST_0_064      (WDTPW+WDTCNTCL+WDTIS2+WDTIS1+WDTIS0)                    /* 0.064ms " */
4795
/* WDT is clocked by fACLK (assumed 32KHz) */
4796
#define WDT_ARST_1000       (WDTPW+WDTCNTCL+WDTSSEL0+WDTIS2)                         /* 1000ms  " */
4797
#define WDT_ARST_250        (WDTPW+WDTCNTCL+WDTSSEL0+WDTIS2+WDTIS0)                  /* 250ms   " */
4798
#define WDT_ARST_16         (WDTPW+WDTCNTCL+WDTSSEL0+WDTIS2+WDTIS1)                  /* 16ms    " */
4799
#define WDT_ARST_1_9        (WDTPW+WDTCNTCL+WDTSSEL0+WDTIS2+WDTIS1+WDTIS0)           /* 1.9ms   " */
4800
 
4801
 
4802
/************************************************************
4803
* TLV Descriptors
4804
************************************************************/
4805
#define __MSP430_HAS_TLV__                    /* Definition to show that Module is available */
4806
 
4807
#define TLV_START              (0x1A08)       /* Start Address of the TLV structure */
4808
#define TLV_END                (0x1AFF)       /* End Address of the TLV structure */
4809
 
4810
#define TLV_LDTAG              (0x01)         /*  Legacy descriptor (1xx, 2xx, 4xx families) */
4811
#define TLV_PDTAG              (0x02)         /*  Peripheral discovery descriptor */
4812
#define TLV_Reserved3          (0x03)         /*  Future usage */
4813
#define TLV_Reserved4          (0x04)         /*  Future usage */
4814
#define TLV_BLANK              (0x05)         /*  Blank descriptor */
4815
#define TLV_Reserved6          (0x06)         /*  Future usage */
4816
#define TLV_Reserved7          (0x07)         /*  Serial Number */
4817
#define TLV_DIERECORD          (0x08)         /*  Die Record  */
4818
#define TLV_ADCCAL             (0x11)         /*  ADC12 calibration */
4819
#define TLV_ADC12CAL           (0x11)         /*  ADC12 calibration */
4820
#define TLV_ADC10CAL           (0x13)         /*  ADC10 calibration */
4821
#define TLV_REFCAL             (0x12)         /*  REF calibration */
4822
#define TLV_TAGEXT             (0xFE)         /*  Tag extender */
4823
#define TLV_TAGEND             (0xFF)         //  Tag End of Table
4824
 
4825
/************************************************************
4826
* Interrupt Vectors (offset from 0xFF80)
4827
************************************************************/
4828
 
4829
#pragma diag_suppress 1107
4830
#define VECTOR_NAME(name)             name##_ptr
4831
#define EMIT_PRAGMA(x)                _Pragma(#x)
4832
#define CREATE_VECTOR(name)           void * const VECTOR_NAME(name) = (void *)(long)&name
4833
#define PLACE_VECTOR(vector,section)  EMIT_PRAGMA(DATA_SECTION(vector,section))
4834
#define PLACE_INTERRUPT(func)         EMIT_PRAGMA(CODE_SECTION(func,".text:_isr"))
4835
#define ISR_VECTOR(func,offset)       CREATE_VECTOR(func); \
4836
                                      PLACE_VECTOR(VECTOR_NAME(func), offset) \
4837
                                      PLACE_INTERRUPT(func)
4838
 
4839
 
4840
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4841
#define RTC_VECTOR              ".int41"                    /* 0xFFD2 RTC */
4842
#else
4843
#define RTC_VECTOR              (41 * 1u)                    /* 0xFFD2 RTC */
4844
/*#define RTC_ISR(func)           ISR_VECTOR(func, ".int41")  */ /* 0xFFD2 RTC */ /* CCE V2 Style */
4845
#endif
4846
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4847
#define PORT2_VECTOR            ".int42"                    /* 0xFFD4 Port 2 */
4848
#else
4849
#define PORT2_VECTOR            (42 * 1u)                    /* 0xFFD4 Port 2 */
4850
/*#define PORT2_ISR(func)         ISR_VECTOR(func, ".int42")  */ /* 0xFFD4 Port 2 */ /* CCE V2 Style */
4851
#endif
4852
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4853
#define TIMER2_A1_VECTOR        ".int43"                    /* 0xFFD6 Timer0_A5 CC1-4, TA */
4854
#else
4855
#define TIMER2_A1_VECTOR        (43 * 1u)                    /* 0xFFD6 Timer0_A5 CC1-4, TA */
4856
/*#define TIMER2_A1_ISR(func)     ISR_VECTOR(func, ".int43")  */ /* 0xFFD6 Timer0_A5 CC1-4, TA */ /* CCE V2 Style */
4857
#endif
4858
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4859
#define TIMER2_A0_VECTOR        ".int44"                    /* 0xFFD8 Timer0_A5 CC0 */
4860
#else
4861
#define TIMER2_A0_VECTOR        (44 * 1u)                    /* 0xFFD8 Timer0_A5 CC0 */
4862
/*#define TIMER2_A0_ISR(func)     ISR_VECTOR(func, ".int44")  */ /* 0xFFD8 Timer0_A5 CC0 */ /* CCE V2 Style */
4863
#endif
4864
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4865
#define USCI_B1_VECTOR          ".int45"                    /* 0xFFDA USCI B1 Receive/Transmit */
4866
#else
4867
#define USCI_B1_VECTOR          (45 * 1u)                    /* 0xFFDA USCI B1 Receive/Transmit */
4868
/*#define USCI_B1_ISR(func)       ISR_VECTOR(func, ".int45")  */ /* 0xFFDA USCI B1 Receive/Transmit */ /* CCE V2 Style */
4869
#endif
4870
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4871
#define USCI_A1_VECTOR          ".int46"                    /* 0xFFDC USCI A1 Receive/Transmit */
4872
#else
4873
#define USCI_A1_VECTOR          (46 * 1u)                    /* 0xFFDC USCI A1 Receive/Transmit */
4874
/*#define USCI_A1_ISR(func)       ISR_VECTOR(func, ".int46")  */ /* 0xFFDC USCI A1 Receive/Transmit */ /* CCE V2 Style */
4875
#endif
4876
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4877
#define PORT1_VECTOR            ".int47"                    /* 0xFFDE Port 1 */
4878
#else
4879
#define PORT1_VECTOR            (47 * 1u)                    /* 0xFFDE Port 1 */
4880
/*#define PORT1_ISR(func)         ISR_VECTOR(func, ".int47")  */ /* 0xFFDE Port 1 */ /* CCE V2 Style */
4881
#endif
4882
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4883
#define TIMER1_A1_VECTOR        ".int48"                    /* 0xFFE0 Timer1_A3 CC1-2, TA1 */
4884
#else
4885
#define TIMER1_A1_VECTOR        (48 * 1u)                    /* 0xFFE0 Timer1_A3 CC1-2, TA1 */
4886
/*#define TIMER1_A1_ISR(func)     ISR_VECTOR(func, ".int48")  */ /* 0xFFE0 Timer1_A3 CC1-2, TA1 */ /* CCE V2 Style */
4887
#endif
4888
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4889
#define TIMER1_A0_VECTOR        ".int49"                    /* 0xFFE2 Timer1_A3 CC0 */
4890
#else
4891
#define TIMER1_A0_VECTOR        (49 * 1u)                    /* 0xFFE2 Timer1_A3 CC0 */
4892
/*#define TIMER1_A0_ISR(func)     ISR_VECTOR(func, ".int49")  */ /* 0xFFE2 Timer1_A3 CC0 */ /* CCE V2 Style */
4893
#endif
4894
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4895
#define DMA_VECTOR              ".int50"                    /* 0xFFE4 DMA */
4896
#else
4897
#define DMA_VECTOR              (50 * 1u)                    /* 0xFFE4 DMA */
4898
/*#define DMA_ISR(func)           ISR_VECTOR(func, ".int50")  */ /* 0xFFE4 DMA */ /* CCE V2 Style */
4899
#endif
4900
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4901
#define USB_UBM_VECTOR          ".int51"                    /* 0xFFE6 USB Timer / cable event / USB reset */
4902
#else
4903
#define USB_UBM_VECTOR          (51 * 1u)                    /* 0xFFE6 USB Timer / cable event / USB reset */
4904
/*#define USB_UBM_ISR(func)       ISR_VECTOR(func, ".int51")  */ /* 0xFFE6 USB Timer / cable event / USB reset */ /* CCE V2 Style */
4905
#endif
4906
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4907
#define TIMER0_A1_VECTOR        ".int52"                    /* 0xFFE8 Timer0_A5 CC1-4, TA */
4908
#else
4909
#define TIMER0_A1_VECTOR        (52 * 1u)                    /* 0xFFE8 Timer0_A5 CC1-4, TA */
4910
/*#define TIMER0_A1_ISR(func)     ISR_VECTOR(func, ".int52")  */ /* 0xFFE8 Timer0_A5 CC1-4, TA */ /* CCE V2 Style */
4911
#endif
4912
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4913
#define TIMER0_A0_VECTOR        ".int53"                    /* 0xFFEA Timer0_A5 CC0 */
4914
#else
4915
#define TIMER0_A0_VECTOR        (53 * 1u)                    /* 0xFFEA Timer0_A5 CC0 */
4916
/*#define TIMER0_A0_ISR(func)     ISR_VECTOR(func, ".int53")  */ /* 0xFFEA Timer0_A5 CC0 */ /* CCE V2 Style */
4917
#endif
4918
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4919
#define ADC12_VECTOR            ".int54"                    /* 0xFFEC ADC */
4920
#else
4921
#define ADC12_VECTOR            (54 * 1u)                    /* 0xFFEC ADC */
4922
/*#define ADC12_ISR(func)         ISR_VECTOR(func, ".int54")  */ /* 0xFFEC ADC */ /* CCE V2 Style */
4923
#endif
4924
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4925
#define USCI_B0_VECTOR          ".int55"                    /* 0xFFEE USCI B0 Receive/Transmit */
4926
#else
4927
#define USCI_B0_VECTOR          (55 * 1u)                    /* 0xFFEE USCI B0 Receive/Transmit */
4928
/*#define USCI_B0_ISR(func)       ISR_VECTOR(func, ".int55")  */ /* 0xFFEE USCI B0 Receive/Transmit */ /* CCE V2 Style */
4929
#endif
4930
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4931
#define USCI_A0_VECTOR          ".int56"                    /* 0xFFF0 USCI A0 Receive/Transmit */
4932
#else
4933
#define USCI_A0_VECTOR          (56 * 1u)                    /* 0xFFF0 USCI A0 Receive/Transmit */
4934
/*#define USCI_A0_ISR(func)       ISR_VECTOR(func, ".int56")  */ /* 0xFFF0 USCI A0 Receive/Transmit */ /* CCE V2 Style */
4935
#endif
4936
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4937
#define WDT_VECTOR              ".int57"                    /* 0xFFF2 Watchdog Timer */
4938
#else
4939
#define WDT_VECTOR              (57 * 1u)                    /* 0xFFF2 Watchdog Timer */
4940
/*#define WDT_ISR(func)           ISR_VECTOR(func, ".int57")  */ /* 0xFFF2 Watchdog Timer */ /* CCE V2 Style */
4941
#endif
4942
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4943
#define TIMER0_B1_VECTOR        ".int58"                    /* 0xFFF4 Timer0_B7 CC1-6, TB */
4944
#else
4945
#define TIMER0_B1_VECTOR        (58 * 1u)                    /* 0xFFF4 Timer0_B7 CC1-6, TB */
4946
/*#define TIMER0_B1_ISR(func)     ISR_VECTOR(func, ".int58")  */ /* 0xFFF4 Timer0_B7 CC1-6, TB */ /* CCE V2 Style */
4947
#endif
4948
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4949
#define TIMER0_B0_VECTOR        ".int59"                    /* 0xFFF6 Timer0_B7 CC0 */
4950
#else
4951
#define TIMER0_B0_VECTOR        (59 * 1u)                    /* 0xFFF6 Timer0_B7 CC0 */
4952
/*#define TIMER0_B0_ISR(func)     ISR_VECTOR(func, ".int59")  */ /* 0xFFF6 Timer0_B7 CC0 */ /* CCE V2 Style */
4953
#endif
4954
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4955
#define COMP_B_VECTOR           ".int60"                    /* 0xFFF8 Comparator B */
4956
#else
4957
#define COMP_B_VECTOR           (60 * 1u)                    /* 0xFFF8 Comparator B */
4958
/*#define COMP_B_ISR(func)        ISR_VECTOR(func, ".int60")  */ /* 0xFFF8 Comparator B */ /* CCE V2 Style */
4959
#endif
4960
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4961
#define UNMI_VECTOR             ".int61"                    /* 0xFFFA User Non-maskable */
4962
#else
4963
#define UNMI_VECTOR             (61 * 1u)                    /* 0xFFFA User Non-maskable */
4964
/*#define UNMI_ISR(func)          ISR_VECTOR(func, ".int61")  */ /* 0xFFFA User Non-maskable */ /* CCE V2 Style */
4965
#endif
4966
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4967
#define SYSNMI_VECTOR           ".int62"                    /* 0xFFFC System Non-maskable */
4968
#else
4969
#define SYSNMI_VECTOR           (62 * 1u)                    /* 0xFFFC System Non-maskable */
4970
/*#define SYSNMI_ISR(func)        ISR_VECTOR(func, ".int62")  */ /* 0xFFFC System Non-maskable */ /* CCE V2 Style */
4971
#endif
4972
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
4973
#define RESET_VECTOR            ".reset"                    /* 0xFFFE Reset [Highest Priority] */
4974
#else
4975
#define RESET_VECTOR            (63 * 1u)                    /* 0xFFFE Reset [Highest Priority] */
4976
/*#define RESET_ISR(func)         ISR_VECTOR(func, ".int63")  */ /* 0xFFFE Reset [Highest Priority] */ /* CCE V2 Style */
4977
#endif
4978
 
4979
/************************************************************
4980
* End of Modules
4981
************************************************************/
4982
 
4983
#ifdef __cplusplus
4984
}
4985
#endif /* extern "C" */
4986
 
4987
#endif /* #ifndef __msp430x552x */
4988