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
* MSP430x15x devices.
14
*
15
* Texas Instruments, Version 2.7
16
*
17
* Rev. 2.0, Fixed definitions for DMA
18
* Rev. 2.1, Alignment of defintions in Users Guide and of version numbers
19
* Rev. 2.2, Fixed definitions for I2C
20
* Rev. 2.21,Fixed definitions for I2C for assembler
21
* Rev. 2.3, Fixed type in ADC12 bit definitions (replaced ADC10 with ADC12)
22
*           Added SVS
23
*           Added DMA request definitions
24
* Rev. 2.4, Removed unused def of TASSEL2 / TBSSEL2
25
* Rev. 2.5, Added VLD bits in SVS module
26
* Rev. 2.6, Fixed incorrect bits in I2C STT (wrong:SST) and I2C prefix was missing at some bits
27
* Rev. 2.7, added definitions for Interrupt Vectors xxIV
28
*
29
********************************************************************/
30
 
31
#ifndef __msp430x15x
32
#define __msp430x15x
33
 
34
#ifdef __cplusplus
35
extern "C" {
36
#endif
37
 
38
 
39
/*----------------------------------------------------------------------------*/
40
/* PERIPHERAL FILE MAP                                                        */
41
/*----------------------------------------------------------------------------*/
42
 
43
/* External references resolved by a device-specific linker command file */
44
#define SFR_8BIT(address)   extern volatile unsigned char address
45
#define SFR_16BIT(address)  extern volatile unsigned int address
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
* PERIPHERAL FILE MAP
116
************************************************************/
117
 
118
/************************************************************
119
* SPECIAL FUNCTION REGISTER ADDRESSES + CONTROL BITS
120
************************************************************/
121
 
122
SFR_8BIT(IE1);                                /* Interrupt Enable 1 */
123
#define U0IE                   IE1            /* UART0 Interrupt Enable Register */
124
#define WDTIE                  (0x01)
125
#define OFIE                   (0x02)
126
#define NMIIE                  (0x10)
127
#define ACCVIE                 (0x20)
128
#define URXIE0                 (0x40)
129
#define UTXIE0                 (0x80)
130
 
131
SFR_8BIT(IFG1);                               /* Interrupt Flag 1 */
132
#define U0IFG                  IFG1           /* UART0 Interrupt Flag Register */
133
#define WDTIFG                 (0x01)
134
#define OFIFG                  (0x02)
135
#define NMIIFG                 (0x10)
136
#define URXIFG0                (0x40)
137
#define UTXIFG0                (0x80)
138
 
139
SFR_8BIT(ME1);                                /* Module Enable 1 */
140
#define U0ME                   ME1            /* UART0 Module Enable Register */
141
#define URXE0                  (0x40)
142
#define UTXE0                  (0x80)
143
#define USPIE0                 (0x40)
144
 
145
/************************************************************
146
* WATCHDOG TIMER
147
************************************************************/
148
#define __MSP430_HAS_WDT__                    /* Definition to show that Module is available */
149
 
150
SFR_16BIT(WDTCTL);                            /* Watchdog Timer Control */
151
/* The bit names have been prefixed with "WDT" */
152
#define WDTIS0                 (0x0001)
153
#define WDTIS1                 (0x0002)
154
#define WDTSSEL                (0x0004)
155
#define WDTCNTCL               (0x0008)
156
#define WDTTMSEL               (0x0010)
157
#define WDTNMI                 (0x0020)
158
#define WDTNMIES               (0x0040)
159
#define WDTHOLD                (0x0080)
160
 
161
#define WDTPW                  (0x5A00)
162
 
163
/* WDT-interval times [1ms] coded with Bits 0-2 */
164
/* WDT is clocked by fSMCLK (assumed 1MHz) */
165
#define WDT_MDLY_32         (WDTPW+WDTTMSEL+WDTCNTCL)                         /* 32ms interval (default) */
166
#define WDT_MDLY_8          (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS0)                  /* 8ms     " */
167
#define WDT_MDLY_0_5        (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS1)                  /* 0.5ms   " */
168
#define WDT_MDLY_0_064      (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS1+WDTIS0)           /* 0.064ms " */
169
/* WDT is clocked by fACLK (assumed 32KHz) */
170
#define WDT_ADLY_1000       (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL)                 /* 1000ms  " */
171
#define WDT_ADLY_250        (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS0)          /* 250ms   " */
172
#define WDT_ADLY_16         (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS1)          /* 16ms    " */
173
#define WDT_ADLY_1_9        (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS1+WDTIS0)   /* 1.9ms   " */
174
/* Watchdog mode -> reset after expired time */
175
/* WDT is clocked by fSMCLK (assumed 1MHz) */
176
#define WDT_MRST_32         (WDTPW+WDTCNTCL)                                  /* 32ms interval (default) */
177
#define WDT_MRST_8          (WDTPW+WDTCNTCL+WDTIS0)                           /* 8ms     " */
178
#define WDT_MRST_0_5        (WDTPW+WDTCNTCL+WDTIS1)                           /* 0.5ms   " */
179
#define WDT_MRST_0_064      (WDTPW+WDTCNTCL+WDTIS1+WDTIS0)                    /* 0.064ms " */
180
/* WDT is clocked by fACLK (assumed 32KHz) */
181
#define WDT_ARST_1000       (WDTPW+WDTCNTCL+WDTSSEL)                          /* 1000ms  " */
182
#define WDT_ARST_250        (WDTPW+WDTCNTCL+WDTSSEL+WDTIS0)                   /* 250ms   " */
183
#define WDT_ARST_16         (WDTPW+WDTCNTCL+WDTSSEL+WDTIS1)                   /* 16ms    " */
184
#define WDT_ARST_1_9        (WDTPW+WDTCNTCL+WDTSSEL+WDTIS1+WDTIS0)            /* 1.9ms   " */
185
 
186
/* INTERRUPT CONTROL */
187
/* These two bits are defined in the Special Function Registers */
188
/* #define WDTIE               0x01 */
189
/* #define WDTIFG              0x01 */
190
 
191
/************************************************************
192
* DIGITAL I/O Port1/2
193
************************************************************/
194
#define __MSP430_HAS_PORT1__                  /* Definition to show that Module is available */
195
#define __MSP430_HAS_PORT2__                  /* Definition to show that Module is available */
196
 
197
SFR_8BIT(P1IN);                               /* Port 1 Input */
198
SFR_8BIT(P1OUT);                              /* Port 1 Output */
199
SFR_8BIT(P1DIR);                              /* Port 1 Direction */
200
SFR_8BIT(P1IFG);                              /* Port 1 Interrupt Flag */
201
SFR_8BIT(P1IES);                              /* Port 1 Interrupt Edge Select */
202
SFR_8BIT(P1IE);                               /* Port 1 Interrupt Enable */
203
SFR_8BIT(P1SEL);                              /* Port 1 Selection */
204
 
205
SFR_8BIT(P2IN);                               /* Port 2 Input */
206
SFR_8BIT(P2OUT);                              /* Port 2 Output */
207
SFR_8BIT(P2DIR);                              /* Port 2 Direction */
208
SFR_8BIT(P2IFG);                              /* Port 2 Interrupt Flag */
209
SFR_8BIT(P2IES);                              /* Port 2 Interrupt Edge Select */
210
SFR_8BIT(P2IE);                               /* Port 2 Interrupt Enable */
211
SFR_8BIT(P2SEL);                              /* Port 2 Selection */
212
 
213
/************************************************************
214
* DIGITAL I/O Port3/4
215
************************************************************/
216
#define __MSP430_HAS_PORT3__                  /* Definition to show that Module is available */
217
#define __MSP430_HAS_PORT4__                  /* Definition to show that Module is available */
218
 
219
SFR_8BIT(P3IN);                               /* Port 3 Input */
220
SFR_8BIT(P3OUT);                              /* Port 3 Output */
221
SFR_8BIT(P3DIR);                              /* Port 3 Direction */
222
SFR_8BIT(P3SEL);                              /* Port 3 Selection */
223
 
224
SFR_8BIT(P4IN);                               /* Port 4 Input */
225
SFR_8BIT(P4OUT);                              /* Port 4 Output */
226
SFR_8BIT(P4DIR);                              /* Port 4 Direction */
227
SFR_8BIT(P4SEL);                              /* Port 4 Selection */
228
 
229
/************************************************************
230
* DIGITAL I/O Port5/6
231
************************************************************/
232
#define __MSP430_HAS_PORT5__                  /* Definition to show that Module is available */
233
#define __MSP430_HAS_PORT6__                  /* Definition to show that Module is available */
234
 
235
SFR_8BIT(P5IN);                               /* Port 5 Input */
236
SFR_8BIT(P5OUT);                              /* Port 5 Output */
237
SFR_8BIT(P5DIR);                              /* Port 5 Direction */
238
SFR_8BIT(P5SEL);                              /* Port 5 Selection */
239
 
240
SFR_8BIT(P6IN);                               /* Port 6 Input */
241
SFR_8BIT(P6OUT);                              /* Port 6 Output */
242
SFR_8BIT(P6DIR);                              /* Port 6 Direction */
243
SFR_8BIT(P6SEL);                              /* Port 6 Selection */
244
 
245
/************************************************************
246
* USART
247
************************************************************/
248
 
249
/* UxCTL */
250
#define PENA                   (0x80)         /* Parity enable */
251
#define PEV                    (0x40)         /* Parity 0:odd / 1:even */
252
#define SPB                    (0x20)         /* Stop Bits 0:one / 1: two */
253
#define CHAR                   (0x10)         /* Data 0:7-bits / 1:8-bits */
254
#define LISTEN                 (0x08)         /* Listen mode */
255
#define SYNC                   (0x04)         /* UART / SPI mode */
256
#define MM                     (0x02)         /* Master Mode off/on */
257
#define SWRST                  (0x01)         /* USART Software Reset */
258
 
259
/* UxTCTL */
260
#define CKPH                   (0x80)         /* SPI: Clock Phase */
261
#define CKPL                   (0x40)         /* Clock Polarity */
262
#define SSEL1                  (0x20)         /* Clock Source Select 1 */
263
#define SSEL0                  (0x10)         /* Clock Source Select 0 */
264
#define URXSE                  (0x08)         /* Receive Start edge select */
265
#define TXWAKE                 (0x04)         /* TX Wake up mode */
266
#define STC                    (0x02)         /* SPI: STC enable 0:on / 1:off */
267
#define TXEPT                  (0x01)         /* TX Buffer empty */
268
 
269
/* UxRCTL */
270
#define FE                     (0x80)         /* Frame Error */
271
#define PE                     (0x40)         /* Parity Error */
272
#define OE                     (0x20)         /* Overrun Error */
273
#define BRK                    (0x10)         /* Break detected */
274
#define URXEIE                 (0x08)         /* RX Error interrupt enable */
275
#define URXWIE                 (0x04)         /* RX Wake up interrupt enable */
276
#define RXWAKE                 (0x02)         /* RX Wake up detect */
277
#define RXERR                  (0x01)         /* RX Error Error */
278
 
279
/************************************************************
280
* USART 0
281
************************************************************/
282
#define __MSP430_HAS_UART0__                  /* Definition to show that Module is available */
283
 
284
SFR_8BIT(U0CTL);                              /* USART 0 Control */
285
SFR_8BIT(U0TCTL);                             /* USART 0 Transmit Control */
286
SFR_8BIT(U0RCTL);                             /* USART 0 Receive Control */
287
SFR_8BIT(U0MCTL);                             /* USART 0 Modulation Control */
288
SFR_8BIT(U0BR0);                              /* USART 0 Baud Rate 0 */
289
SFR_8BIT(U0BR1);                              /* USART 0 Baud Rate 1 */
290
SFR_8BIT(U0RXBUF);                            /* USART 0 Receive Buffer */
291
SFR_8BIT(U0TXBUF);                            /* USART 0 Transmit Buffer */
292
 
293
/* Alternate register names */
294
 
295
#define UCTL0                  U0CTL          /* USART 0 Control */
296
#define UTCTL0                 U0TCTL         /* USART 0 Transmit Control */
297
#define URCTL0                 U0RCTL         /* USART 0 Receive Control */
298
#define UMCTL0                 U0MCTL         /* USART 0 Modulation Control */
299
#define UBR00                  U0BR0          /* USART 0 Baud Rate 0 */
300
#define UBR10                  U0BR1          /* USART 0 Baud Rate 1 */
301
#define RXBUF0                 U0RXBUF        /* USART 0 Receive Buffer */
302
#define TXBUF0                 U0TXBUF        /* USART 0 Transmit Buffer */
303
#define UCTL0_                 U0CTL_         /* USART 0 Control */
304
#define UTCTL0_                U0TCTL_        /* USART 0 Transmit Control */
305
#define URCTL0_                U0RCTL_        /* USART 0 Receive Control */
306
#define UMCTL0_                U0MCTL_        /* USART 0 Modulation Control */
307
#define UBR00_                 U0BR0_         /* USART 0 Baud Rate 0 */
308
#define UBR10_                 U0BR1_         /* USART 0 Baud Rate 1 */
309
#define RXBUF0_                U0RXBUF_       /* USART 0 Receive Buffer */
310
#define TXBUF0_                U0TXBUF_       /* USART 0 Transmit Buffer */
311
#define UCTL_0                 U0CTL          /* USART 0 Control */
312
#define UTCTL_0                U0TCTL         /* USART 0 Transmit Control */
313
#define URCTL_0                U0RCTL         /* USART 0 Receive Control */
314
#define UMCTL_0                U0MCTL         /* USART 0 Modulation Control */
315
#define UBR0_0                 U0BR0          /* USART 0 Baud Rate 0 */
316
#define UBR1_0                 U0BR1          /* USART 0 Baud Rate 1 */
317
#define RXBUF_0                U0RXBUF        /* USART 0 Receive Buffer */
318
#define TXBUF_0                U0TXBUF        /* USART 0 Transmit Buffer */
319
#define UCTL_0_                U0CTL_         /* USART 0 Control */
320
#define UTCTL_0_               U0TCTL_        /* USART 0 Transmit Control */
321
#define URCTL_0_               U0RCTL_        /* USART 0 Receive Control */
322
#define UMCTL_0_               U0MCTL_        /* USART 0 Modulation Control */
323
#define UBR0_0_                U0BR0_         /* USART 0 Baud Rate 0 */
324
#define UBR1_0_                U0BR1_         /* USART 0 Baud Rate 1 */
325
#define RXBUF_0_               U0RXBUF_       /* USART 0 Receive Buffer */
326
#define TXBUF_0_               U0TXBUF_       /* USART 0 Transmit Buffer */
327
 
328
/************************************************************
329
* USART0  I2C
330
************************************************************/
331
#define __MSP430_HAS_I2C__                    /* Definition to show that Module is available */
332
 
333
SFR_8BIT(I2CIE);                              /* I2C Interrupt Enable */
334
#define ALIE                   (0x01)         /* Arbitration lost */
335
#define NACKIE                 (0x02)         /* No acknowledge */
336
#define OAIE                   (0x04)         /* Own address */
337
#define ARDYIE                 (0x08)         /* Access ready (opeation complete) */
338
#define RXRDYIE                (0x10)         /* Receive ready (data received) */
339
#define TXRDYIE                (0x20)         /* Transmit ready (transmit register empty) */
340
#define GCIE                   (0x40)         /* General call */
341
#define STTIE                  (0x80)         /* Start condition */
342
 
343
SFR_8BIT(I2CIFG);                             /* I2C Interrupt Flag */
344
#define ALIFG                  (0x01)         /* Arbitration lost */
345
#define NACKIFG                (0x02)         /* No acknowledge */
346
#define OAIFG                  (0x04)         /* Own address */
347
#define ARDYIFG                (0x08)         /* Access ready (opeation complete) */
348
#define RXRDYIFG               (0x10)         /* Receive ready (data received) */
349
#define TXRDYIFG               (0x20)         /* Transmit ready (transmit register empty) */
350
#define GCIFG                  (0x40)         /* General call */
351
#define STTIFG                 (0x80)         /* Start condition */
352
 
353
SFR_8BIT(I2CNDAT);                            /* I2C Data Count */
354
 
355
/* USART 0 Control */
356
#define I2CEN                  (0x01)         /* I2C enable */
357
#define MST                    (0x02)         /* I2C master */
358
#define XA                     (0x10)         /* I2C extended addressing */
359
#define I2C                    (0x20)         /* USART I2C */
360
#define TXDMAEN                (0x40)         /* Transmit DMA enable */
361
#define RXDMAEN                (0x80)         /* Receive DMA enable */
362
 
363
SFR_8BIT(I2CTCTL);                            /* I2C Transfer Control */
364
#define I2CSTT                 (0x01)         /* Start bit */
365
#define I2CSTP                 (0x02)         /* Stop bit */
366
#define I2CSTB                 (0x04)         /* Start byte mode */
367
#define I2CTRX                 (0x08)         /* Transmit */
368
#define I2CSSEL0               (0x10)         /* Clock select bit 0 */
369
#define I2CSSEL1               (0x20)         /* Clock select bit 1 */
370
#define I2CRM                  (0x40)         /* Repeat mode */
371
#define I2CWORD                (0x80)         /* Word data mode */
372
 
373
#define I2CSSEL_0              (0*0x10u)      /* I2C clock select 0: UCLK */
374
#define I2CSSEL_1              (1*0x10u)      /* I2C clock select 1: ACLK */
375
#define I2CSSEL_2              (2*0x10u)      /* I2C clock select 2: SMCLK */
376
#define I2CSSEL_3              (3*0x10u)      /* I2C clock select 3: SMCLK */
377
 
378
#define I2CMM_0                (0x00)         /* Master mode 0 */
379
#define I2CMM_1                (I2CSTT)       /* Master mode 1 */
380
#define I2CMM_2             (I2CSTP+I2CSTT) /* Master mode 2 */
381
#define I2CMM_3                (I2CRM+I2CSTT) /* Master mode 3 */
382
#define I2CMM_4                (I2CSTP)       /* Master mode 4 */
383
 
384
SFR_8BIT(I2CDCTL);                            /* I2C Data Control */
385
#define I2CBB                  (0x01)         /* Bus busy */
386
#define I2CRXOVR               (0x02)         /* Receiver overrun */
387
#define I2CTXUDF               (0x04)         /* Transmit underflow */
388
#define I2CSBD                 (0x08)         /* Received byte */
389
#define I2CSCLLOW              (0x10)         /* SCL being held low */
390
#define I2CBUSY                (0x20)         /* I2C Busy Flag */
391
 
392
SFR_8BIT(I2CPSC);                             /* I2C Pre-scaler */
393
SFR_8BIT(I2CSCLH);                            /* I2C SCL High */
394
SFR_8BIT(I2CSCLL);                            /* I2C SCL Low */
395
SFR_8BIT(I2CDRB);                             /* I2C Data for Byte access */
396
SFR_16BIT(I2CDRW);                            /* I2C Data for Word access */
397
 
398
SFR_16BIT(I2COA);                             /* I2C Own Address */
399
SFR_16BIT(I2CSA);                             /* I2C Slave Address */
400
 
401
SFR_16BIT(I2CIV);                             /* I2C Interrupt Vector */
402
#define I2CIV_NONE             (0x0000)       /* I2C interrupt vector: No interrupt pending */
403
#define I2CIV_AL               (0x0002)       /* I2C interrupt vector: Arbitration lost (ALIFG) */
404
#define I2CIV_NACK             (0x0004)       /* I2C interrupt vector: No acknowledge (NACKIFG) */
405
#define I2CIV_OA               (0x0006)       /* I2C interrupt vector: Own address (OAIFG) */
406
#define I2CIV_ARDY             (0x0008)       /* I2C interrupt vector: Access ready (ARDYIFG) */
407
#define I2CIV_RXRDY            (0x000A)       /* I2C interrupt vector: Receive ready (RXRDYIFG) */
408
#define I2CIV_TXRDY            (0x000C)       /* I2C interrupt vector: Transmit ready (TXRDYIFG) */
409
#define I2CIV_GC               (0x000E)       /* I2C interrupt vector: General call (GCIFG) */
410
#define I2CIV_STT              (0x0010)       /* I2C interrupt vector: Start condition (STTIFG) */
411
 
412
/************************************************************
413
* Timer A3
414
************************************************************/
415
#define __MSP430_HAS_TA3__                    /* Definition to show that Module is available */
416
 
417
SFR_16BIT(TAIV);                              /* Timer A Interrupt Vector Word */
418
SFR_16BIT(TACTL);                             /* Timer A Control */
419
SFR_16BIT(TACCTL0);                           /* Timer A Capture/Compare Control 0 */
420
SFR_16BIT(TACCTL1);                           /* Timer A Capture/Compare Control 1 */
421
SFR_16BIT(TACCTL2);                           /* Timer A Capture/Compare Control 2 */
422
SFR_16BIT(TAR);                               /* Timer A Counter Register */
423
SFR_16BIT(TACCR0);                            /* Timer A Capture/Compare 0 */
424
SFR_16BIT(TACCR1);                            /* Timer A Capture/Compare 1 */
425
SFR_16BIT(TACCR2);                            /* Timer A Capture/Compare 2 */
426
 
427
/* Alternate register names */
428
#define CCTL0                  TACCTL0        /* Timer A Capture/Compare Control 0 */
429
#define CCTL1                  TACCTL1        /* Timer A Capture/Compare Control 1 */
430
#define CCTL2                  TACCTL2        /* Timer A Capture/Compare Control 2 */
431
#define CCR0                   TACCR0         /* Timer A Capture/Compare 0 */
432
#define CCR1                   TACCR1         /* Timer A Capture/Compare 1 */
433
#define CCR2                   TACCR2         /* Timer A Capture/Compare 2 */
434
#define CCTL0_                 TACCTL0_       /* Timer A Capture/Compare Control 0 */
435
#define CCTL1_                 TACCTL1_       /* Timer A Capture/Compare Control 1 */
436
#define CCTL2_                 TACCTL2_       /* Timer A Capture/Compare Control 2 */
437
#define CCR0_                  TACCR0_        /* Timer A Capture/Compare 0 */
438
#define CCR1_                  TACCR1_        /* Timer A Capture/Compare 1 */
439
#define CCR2_                  TACCR2_        /* Timer A Capture/Compare 2 */
440
/* Alternate register names - 5xx style */
441
#define TA0IV                  TAIV           /* Timer A Interrupt Vector Word */
442
#define TA0CTL                 TACTL          /* Timer A Control */
443
#define TA0CCTL0               TACCTL0        /* Timer A Capture/Compare Control 0 */
444
#define TA0CCTL1               TACCTL1        /* Timer A Capture/Compare Control 1 */
445
#define TA0CCTL2               TACCTL2        /* Timer A Capture/Compare Control 2 */
446
#define TA0R                   TAR            /* Timer A Counter Register */
447
#define TA0CCR0                TACCR0         /* Timer A Capture/Compare 0 */
448
#define TA0CCR1                TACCR1         /* Timer A Capture/Compare 1 */
449
#define TA0CCR2                TACCR2         /* Timer A Capture/Compare 2 */
450
#define TA0IV_                 TAIV_          /* Timer A Interrupt Vector Word */
451
#define TA0CTL_                TACTL_         /* Timer A Control */
452
#define TA0CCTL0_              TACCTL0_       /* Timer A Capture/Compare Control 0 */
453
#define TA0CCTL1_              TACCTL1_       /* Timer A Capture/Compare Control 1 */
454
#define TA0CCTL2_              TACCTL2_       /* Timer A Capture/Compare Control 2 */
455
#define TA0R_                  TAR_           /* Timer A Counter Register */
456
#define TA0CCR0_               TACCR0_        /* Timer A Capture/Compare 0 */
457
#define TA0CCR1_               TACCR1_        /* Timer A Capture/Compare 1 */
458
#define TA0CCR2_               TACCR2_        /* Timer A Capture/Compare 2 */
459
 
460
#define TASSEL1                (0x0200)       /* Timer A clock source select 0 */
461
#define TASSEL0                (0x0100)       /* Timer A clock source select 1 */
462
#define ID1                    (0x0080)       /* Timer A clock input divider 1 */
463
#define ID0                    (0x0040)       /* Timer A clock input divider 0 */
464
#define MC1                    (0x0020)       /* Timer A mode control 1 */
465
#define MC0                    (0x0010)       /* Timer A mode control 0 */
466
#define TACLR                  (0x0004)       /* Timer A counter clear */
467
#define TAIE                   (0x0002)       /* Timer A counter interrupt enable */
468
#define TAIFG                  (0x0001)       /* Timer A counter interrupt flag */
469
 
470
#define MC_0                   (0*0x10u)      /* Timer A mode control: 0 - Stop */
471
#define MC_1                   (1*0x10u)      /* Timer A mode control: 1 - Up to CCR0 */
472
#define MC_2                   (2*0x10u)      /* Timer A mode control: 2 - Continous up */
473
#define MC_3                   (3*0x10u)      /* Timer A mode control: 3 - Up/Down */
474
#define ID_0                   (0*0x40u)      /* Timer A input divider: 0 - /1 */
475
#define ID_1                   (1*0x40u)      /* Timer A input divider: 1 - /2 */
476
#define ID_2                   (2*0x40u)      /* Timer A input divider: 2 - /4 */
477
#define ID_3                   (3*0x40u)      /* Timer A input divider: 3 - /8 */
478
#define TASSEL_0               (0*0x100u)     /* Timer A clock source select: 0 - TACLK */
479
#define TASSEL_1               (1*0x100u)     /* Timer A clock source select: 1 - ACLK  */
480
#define TASSEL_2               (2*0x100u)     /* Timer A clock source select: 2 - SMCLK */
481
#define TASSEL_3               (3*0x100u)     /* Timer A clock source select: 3 - INCLK */
482
 
483
#define CM1                    (0x8000)       /* Capture mode 1 */
484
#define CM0                    (0x4000)       /* Capture mode 0 */
485
#define CCIS1                  (0x2000)       /* Capture input select 1 */
486
#define CCIS0                  (0x1000)       /* Capture input select 0 */
487
#define SCS                    (0x0800)       /* Capture sychronize */
488
#define SCCI                   (0x0400)       /* Latched capture signal (read) */
489
#define CAP                    (0x0100)       /* Capture mode: 1 /Compare mode : 0 */
490
#define OUTMOD2                (0x0080)       /* Output mode 2 */
491
#define OUTMOD1                (0x0040)       /* Output mode 1 */
492
#define OUTMOD0                (0x0020)       /* Output mode 0 */
493
#define CCIE                   (0x0010)       /* Capture/compare interrupt enable */
494
#define CCI                    (0x0008)       /* Capture input signal (read) */
495
#define OUT                    (0x0004)       /* PWM Output signal if output mode 0 */
496
#define COV                    (0x0002)       /* Capture/compare overflow flag */
497
#define CCIFG                  (0x0001)       /* Capture/compare interrupt flag */
498
 
499
#define OUTMOD_0               (0*0x20u)      /* PWM output mode: 0 - output only */
500
#define OUTMOD_1               (1*0x20u)      /* PWM output mode: 1 - set */
501
#define OUTMOD_2               (2*0x20u)      /* PWM output mode: 2 - PWM toggle/reset */
502
#define OUTMOD_3               (3*0x20u)      /* PWM output mode: 3 - PWM set/reset */
503
#define OUTMOD_4               (4*0x20u)      /* PWM output mode: 4 - toggle */
504
#define OUTMOD_5               (5*0x20u)      /* PWM output mode: 5 - Reset */
505
#define OUTMOD_6               (6*0x20u)      /* PWM output mode: 6 - PWM toggle/set */
506
#define OUTMOD_7               (7*0x20u)      /* PWM output mode: 7 - PWM reset/set */
507
#define CCIS_0                 (0*0x1000u)    /* Capture input select: 0 - CCIxA */
508
#define CCIS_1                 (1*0x1000u)    /* Capture input select: 1 - CCIxB */
509
#define CCIS_2                 (2*0x1000u)    /* Capture input select: 2 - GND */
510
#define CCIS_3                 (3*0x1000u)    /* Capture input select: 3 - Vcc */
511
#define CM_0                   (0*0x4000u)    /* Capture mode: 0 - disabled */
512
#define CM_1                   (1*0x4000u)    /* Capture mode: 1 - pos. edge */
513
#define CM_2                   (2*0x4000u)    /* Capture mode: 1 - neg. edge */
514
#define CM_3                   (3*0x4000u)    /* Capture mode: 1 - both edges */
515
 
516
/* TA3IV Definitions */
517
#define TAIV_NONE              (0x0000)       /* No Interrupt pending */
518
#define TAIV_TACCR1            (0x0002)       /* TACCR1_CCIFG */
519
#define TAIV_TACCR2            (0x0004)       /* TACCR2_CCIFG */
520
#define TAIV_6                 (0x0006)       /* Reserved */
521
#define TAIV_8                 (0x0008)       /* Reserved */
522
#define TAIV_TAIFG             (0x000A)       /* TAIFG */
523
 
524
/************************************************************
525
* Timer B3
526
************************************************************/
527
#define __MSP430_HAS_TB3__                    /* Definition to show that Module is available */
528
 
529
SFR_16BIT(TBIV);                              /* Timer B Interrupt Vector Word */
530
SFR_16BIT(TBCTL);                             /* Timer B Control */
531
SFR_16BIT(TBCCTL0);                           /* Timer B Capture/Compare Control 0 */
532
SFR_16BIT(TBCCTL1);                           /* Timer B Capture/Compare Control 1 */
533
SFR_16BIT(TBCCTL2);                           /* Timer B Capture/Compare Control 2 */
534
SFR_16BIT(TBR);                               /* Timer B Counter Register */
535
SFR_16BIT(TBCCR0);                            /* Timer B Capture/Compare 0 */
536
SFR_16BIT(TBCCR1);                            /* Timer B Capture/Compare 1 */
537
SFR_16BIT(TBCCR2);                            /* Timer B Capture/Compare 2 */
538
 
539
/* Alternate register names - 5xx style */
540
#define TB0IV                  TBIV           /* Timer B Interrupt Vector Word */
541
#define TB0CTL                 TBCTL          /* Timer B Control */
542
#define TB0CCTL0               TBCCTL0        /* Timer B Capture/Compare Control 0 */
543
#define TB0CCTL1               TBCCTL1        /* Timer B Capture/Compare Control 1 */
544
#define TB0CCTL2               TBCCTL2        /* Timer B Capture/Compare Control 2 */
545
#define TB0R                   TBR            /* Timer B Counter Register */
546
#define TB0CCR0                TBCCR0         /* Timer B Capture/Compare 0 */
547
#define TB0CCR1                TBCCR1         /* Timer B Capture/Compare 1 */
548
#define TB0CCR2                TBCCR2         /* Timer B Capture/Compare 2 */
549
#define TB0IV_                 TBIV_          /* Timer B Interrupt Vector Word */
550
#define TB0CTL_                TBCTL_         /* Timer B Control */
551
#define TB0CCTL0_              TBCCTL0_       /* Timer B Capture/Compare Control 0 */
552
#define TB0CCTL1_              TBCCTL1_       /* Timer B Capture/Compare Control 1 */
553
#define TB0CCTL2_              TBCCTL2_       /* Timer B Capture/Compare Control 2 */
554
#define TB0R_                  TBR_           /* Timer B Counter Register */
555
#define TB0CCR0_               TBCCR0_        /* Timer B Capture/Compare 0 */
556
#define TB0CCR1_               TBCCR1_        /* Timer B Capture/Compare 1 */
557
#define TB0CCR2_               TBCCR2_        /* Timer B Capture/Compare 2 */
558
 
559
#define TBCLGRP1               (0x4000)       /* Timer B Compare latch load group 1 */
560
#define TBCLGRP0               (0x2000)       /* Timer B Compare latch load group 0 */
561
#define CNTL1                  (0x1000)       /* Counter lenght 1 */
562
#define CNTL0                  (0x0800)       /* Counter lenght 0 */
563
#define TBSSEL1                (0x0200)       /* Clock source 1 */
564
#define TBSSEL0                (0x0100)       /* Clock source 0 */
565
#define TBCLR                  (0x0004)       /* Timer B counter clear */
566
#define TBIE                   (0x0002)       /* Timer B interrupt enable */
567
#define TBIFG                  (0x0001)       /* Timer B interrupt flag */
568
 
569
#define SHR1                   (0x4000)       /* Timer B Compare latch load group 1 */
570
#define SHR0                   (0x2000)       /* Timer B Compare latch load group 0 */
571
 
572
#define TBSSEL_0               (0*0x0100u)    /* Clock Source: TBCLK */
573
#define TBSSEL_1               (1*0x0100u)    /* Clock Source: ACLK  */
574
#define TBSSEL_2               (2*0x0100u)    /* Clock Source: SMCLK */
575
#define TBSSEL_3               (3*0x0100u)    /* Clock Source: INCLK */
576
#define CNTL_0                 (0*0x0800u)    /* Counter lenght: 16 bit */
577
#define CNTL_1                 (1*0x0800u)    /* Counter lenght: 12 bit */
578
#define CNTL_2                 (2*0x0800u)    /* Counter lenght: 10 bit */
579
#define CNTL_3                 (3*0x0800u)    /* Counter lenght:  8 bit */
580
#define SHR_0                  (0*0x2000u)    /* Timer B Group: 0 - individually */
581
#define SHR_1                  (1*0x2000u)    /* Timer B Group: 1 - 3 groups (1-2, 3-4, 5-6) */
582
#define SHR_2                  (2*0x2000u)    /* Timer B Group: 2 - 2 groups (1-3, 4-6)*/
583
#define SHR_3                  (3*0x2000u)    /* Timer B Group: 3 - 1 group (all) */
584
#define TBCLGRP_0              (0*0x2000u)    /* Timer B Group: 0 - individually */
585
#define TBCLGRP_1              (1*0x2000u)    /* Timer B Group: 1 - 3 groups (1-2, 3-4, 5-6) */
586
#define TBCLGRP_2              (2*0x2000u)    /* Timer B Group: 2 - 2 groups (1-3, 4-6)*/
587
#define TBCLGRP_3              (3*0x2000u)    /* Timer B Group: 3 - 1 group (all) */
588
 
589
/* Additional Timer B Control Register bits are defined in Timer A */
590
 
591
#define CLLD1                  (0x0400)       /* Compare latch load source 1 */
592
#define CLLD0                  (0x0200)       /* Compare latch load source 0 */
593
 
594
#define SLSHR1                 (0x0400)       /* Compare latch load source 1 */
595
#define SLSHR0                 (0x0200)       /* Compare latch load source 0 */
596
 
597
#define SLSHR_0                (0*0x0200u)    /* Compare latch load sourec : 0 - immediate */
598
#define SLSHR_1                (1*0x0200u)    /* Compare latch load sourec : 1 - TBR counts to 0 */
599
#define SLSHR_2                (2*0x0200u)    /* Compare latch load sourec : 2 - up/down */
600
#define SLSHR_3                (3*0x0200u)    /* Compare latch load sourec : 3 - TBR counts to TBCTL0 */
601
 
602
#define CLLD_0                 (0*0x0200u)    /* Compare latch load sourec : 0 - immediate */
603
#define CLLD_1                 (1*0x0200u)    /* Compare latch load sourec : 1 - TBR counts to 0 */
604
#define CLLD_2                 (2*0x0200u)    /* Compare latch load sourec : 2 - up/down */
605
#define CLLD_3                 (3*0x0200u)    /* Compare latch load sourec : 3 - TBR counts to TBCTL0 */
606
 
607
/* TB3IV Definitions */
608
#define TBIV_NONE              (0x0000)       /* No Interrupt pending */
609
#define TBIV_TBCCR1            (0x0002)       /* TBCCR1_CCIFG */
610
#define TBIV_TBCCR2            (0x0004)       /* TBCCR2_CCIFG */
611
#define TBIV_3                 (0x0006)       /* Reserved */
612
#define TBIV_4                 (0x0008)       /* Reserved */
613
#define TBIV_5                 (0x000A)       /* Reserved */
614
#define TBIV_6                 (0x000C)       /* Reserved */
615
#define TBIV_TBIFG             (0x000E)       /* TBIFG */
616
 
617
/************************************************************
618
* Basic Clock Module
619
************************************************************/
620
#define __MSP430_HAS_BASIC_CLOCK__                /* Definition to show that Module is available */
621
 
622
SFR_8BIT(DCOCTL);                             /* DCO Clock Frequency Control */
623
SFR_8BIT(BCSCTL1);                            /* Basic Clock System Control 1 */
624
SFR_8BIT(BCSCTL2);                            /* Basic Clock System Control 2 */
625
 
626
#define MOD0                   (0x01)         /* Modulation Bit 0 */
627
#define MOD1                   (0x02)         /* Modulation Bit 1 */
628
#define MOD2                   (0x04)         /* Modulation Bit 2 */
629
#define MOD3                   (0x08)         /* Modulation Bit 3 */
630
#define MOD4                   (0x10)         /* Modulation Bit 4 */
631
#define DCO0                   (0x20)         /* DCO Select Bit 0 */
632
#define DCO1                   (0x40)         /* DCO Select Bit 1 */
633
#define DCO2                   (0x80)         /* DCO Select Bit 2 */
634
 
635
#define RSEL0                  (0x01)         /* Range Select Bit 0 */
636
#define RSEL1                  (0x02)         /* Range Select Bit 1 */
637
#define RSEL2                  (0x04)         /* Range Select Bit 2 */
638
#define XT5V                   (0x08)         /* XT5V should always be reset */
639
#define DIVA0                  (0x10)         /* ACLK Divider 0 */
640
#define DIVA1                  (0x20)         /* ACLK Divider 1 */
641
#define XTS                    (0x40)         /* LFXTCLK 0:Low Freq. / 1: High Freq. */
642
#define XT2OFF                 (0x80)         /* Enable XT2CLK */
643
 
644
#define DIVA_0                 (0x00)         /* ACLK Divider 0: /1 */
645
#define DIVA_1                 (0x10)         /* ACLK Divider 1: /2 */
646
#define DIVA_2                 (0x20)         /* ACLK Divider 2: /4 */
647
#define DIVA_3                 (0x30)         /* ACLK Divider 3: /8 */
648
 
649
#define DCOR                   (0x01)         /* Enable External Resistor : 1 */
650
#define DIVS0                  (0x02)         /* SMCLK Divider 0 */
651
#define DIVS1                  (0x04)         /* SMCLK Divider 1 */
652
#define SELS                   (0x08)         /* SMCLK Source Select 0:DCOCLK / 1:XT2CLK/LFXTCLK */
653
#define DIVM0                  (0x10)         /* MCLK Divider 0 */
654
#define DIVM1                  (0x20)         /* MCLK Divider 1 */
655
#define SELM0                  (0x40)         /* MCLK Source Select 0 */
656
#define SELM1                  (0x80)         /* MCLK Source Select 1 */
657
 
658
#define DIVS_0                 (0x00)         /* SMCLK Divider 0: /1 */
659
#define DIVS_1                 (0x02)         /* SMCLK Divider 1: /2 */
660
#define DIVS_2                 (0x04)         /* SMCLK Divider 2: /4 */
661
#define DIVS_3                 (0x06)         /* SMCLK Divider 3: /8 */
662
 
663
#define DIVM_0                 (0x00)         /* MCLK Divider 0: /1 */
664
#define DIVM_1                 (0x10)         /* MCLK Divider 1: /2 */
665
#define DIVM_2                 (0x20)         /* MCLK Divider 2: /4 */
666
#define DIVM_3                 (0x30)         /* MCLK Divider 3: /8 */
667
 
668
#define SELM_0                 (0x00)         /* MCLK Source Select 0: DCOCLK */
669
#define SELM_1                 (0x40)         /* MCLK Source Select 1: DCOCLK */
670
#define SELM_2                 (0x80)         /* MCLK Source Select 2: XT2CLK/LFXTCLK */
671
#define SELM_3                 (0xC0)         /* MCLK Source Select 3: LFXTCLK */
672
 
673
/************************************************************
674
* Brown-Out, Supply Voltage Supervision (SVS)
675
************************************************************/
676
#define __MSP430_HAS_SVS__                    /* Definition to show that Module is available */
677
 
678
SFR_8BIT(SVSCTL);                             /* SVS Control */
679
#define SVSFG                  (0x01)         /* SVS Flag */
680
#define SVSOP                  (0x02)         /* SVS output (read only) */
681
#define SVSON                  (0x04)         /* Switches the SVS on/off */
682
#define PORON                  (0x08)         /* Enable POR Generation if Low Voltage */
683
#define VLD0                   (0x10)
684
#define VLD1                   (0x20)
685
#define VLD2                   (0x40)
686
#define VLD3                   (0x80)
687
 
688
#define VLDON                  (0x10)
689
#define VLDOFF                 (0x00)
690
#define VLD_1_8V               (0x10)
691
 
692
/*************************************************************
693
* Flash Memory
694
*************************************************************/
695
#define __MSP430_HAS_FLASH__                  /* Definition to show that Module is available */
696
 
697
SFR_16BIT(FCTL1);                             /* FLASH Control 1 */
698
SFR_16BIT(FCTL2);                             /* FLASH Control 2 */
699
SFR_16BIT(FCTL3);                             /* FLASH Control 3 */
700
 
701
#define FRKEY                  (0x9600)       /* Flash key returned by read */
702
#define FWKEY                  (0xA500)       /* Flash key for write */
703
#define FXKEY                  (0x3300)       /* for use with XOR instruction */
704
 
705
#define ERASE                  (0x0002)       /* Enable bit for Flash segment erase */
706
#define MERAS                  (0x0004)       /* Enable bit for Flash mass erase */
707
#define WRT                    (0x0040)       /* Enable bit for Flash write */
708
#define BLKWRT                 (0x0080)       /* Enable bit for Flash segment write */
709
#define SEGWRT                 (0x0080)       /* old definition */ /* Enable bit for Flash segment write */
710
 
711
#define FN0                    (0x0001)       /* Divide Flash clock by 1 to 64 using FN0 to FN5 according to: */
712
#define FN1                    (0x0002)       /*  32*FN5 + 16*FN4 + 8*FN3 + 4*FN2 + 2*FN1 + FN0 + 1 */
713
#ifndef FN2
714
#define FN2                    (0x0004)
715
#endif
716
#ifndef FN3
717
#define FN3                    (0x0008)
718
#endif
719
#ifndef FN4
720
#define FN4                    (0x0010)
721
#endif
722
#define FN5                    (0x0020)
723
#define FSSEL0                 (0x0040)       /* Flash clock select 0 */        /* to distinguish from USART SSELx */
724
#define FSSEL1                 (0x0080)       /* Flash clock select 1 */
725
 
726
#define FSSEL_0                (0x0000)       /* Flash clock select: 0 - ACLK */
727
#define FSSEL_1                (0x0040)       /* Flash clock select: 1 - MCLK */
728
#define FSSEL_2                (0x0080)       /* Flash clock select: 2 - SMCLK */
729
#define FSSEL_3                (0x00C0)       /* Flash clock select: 3 - SMCLK */
730
 
731
#define BUSY                   (0x0001)       /* Flash busy: 1 */
732
#define KEYV                   (0x0002)       /* Flash Key violation flag */
733
#define ACCVIFG                (0x0004)       /* Flash Access violation flag */
734
#define WAIT                   (0x0008)       /* Wait flag for segment write */
735
#define LOCK                   (0x0010)       /* Lock bit: 1 - Flash is locked (read only) */
736
#define EMEX                   (0x0020)       /* Flash Emergency Exit */
737
 
738
/************************************************************
739
* Comparator A
740
************************************************************/
741
#define __MSP430_HAS_COMPA__                  /* Definition to show that Module is available */
742
 
743
SFR_8BIT(CACTL1);                             /* Comparator A Control 1 */
744
SFR_8BIT(CACTL2);                             /* Comparator A Control 2 */
745
SFR_8BIT(CAPD);                               /* Comparator A Port Disable */
746
 
747
#define CAIFG                  (0x01)         /* Comp. A Interrupt Flag */
748
#define CAIE                   (0x02)         /* Comp. A Interrupt Enable */
749
#define CAIES                  (0x04)         /* Comp. A Int. Edge Select: 0:rising / 1:falling */
750
#define CAON                   (0x08)         /* Comp. A enable */
751
#define CAREF0                 (0x10)         /* Comp. A Internal Reference Select 0 */
752
#define CAREF1                 (0x20)         /* Comp. A Internal Reference Select 1 */
753
#define CARSEL                 (0x40)         /* Comp. A Internal Reference Enable */
754
#define CAEX                   (0x80)         /* Comp. A Exchange Inputs */
755
 
756
#define CAREF_0                (0x00)         /* Comp. A Int. Ref. Select 0 : Off */
757
#define CAREF_1                (0x10)         /* Comp. A Int. Ref. Select 1 : 0.25*Vcc */
758
#define CAREF_2                (0x20)         /* Comp. A Int. Ref. Select 2 : 0.5*Vcc */
759
#define CAREF_3                (0x30)         /* Comp. A Int. Ref. Select 3 : Vt*/
760
 
761
#define CAOUT                  (0x01)         /* Comp. A Output */
762
#define CAF                    (0x02)         /* Comp. A Enable Output Filter */
763
#define P2CA0                  (0x04)         /* Comp. A Connect External Signal to CA0 : 1 */
764
#define P2CA1                  (0x08)         /* Comp. A Connect External Signal to CA1 : 1 */
765
#define CACTL24                (0x10)
766
#define CACTL25                (0x20)
767
#define CACTL26                (0x40)
768
#define CACTL27                (0x80)
769
 
770
#define CAPD0                  (0x01)         /* Comp. A Disable Input Buffer of Port Register .0 */
771
#define CAPD1                  (0x02)         /* Comp. A Disable Input Buffer of Port Register .1 */
772
#define CAPD2                  (0x04)         /* Comp. A Disable Input Buffer of Port Register .2 */
773
#define CAPD3                  (0x08)         /* Comp. A Disable Input Buffer of Port Register .3 */
774
#define CAPD4                  (0x10)         /* Comp. A Disable Input Buffer of Port Register .4 */
775
#define CAPD5                  (0x20)         /* Comp. A Disable Input Buffer of Port Register .5 */
776
#define CAPD6                  (0x40)         /* Comp. A Disable Input Buffer of Port Register .6 */
777
#define CAPD7                  (0x80)         /* Comp. A Disable Input Buffer of Port Register .7 */
778
 
779
/************************************************************
780
* ADC12
781
************************************************************/
782
#define __MSP430_HAS_ADC12__                  /* Definition to show that Module is available */
783
 
784
SFR_16BIT(ADC12CTL0);                         /* ADC12 Control 0 */
785
SFR_16BIT(ADC12CTL1);                         /* ADC12 Control 1 */
786
SFR_16BIT(ADC12IFG);                          /* ADC12 Interrupt Flag */
787
SFR_16BIT(ADC12IE);                           /* ADC12 Interrupt Enable */
788
SFR_16BIT(ADC12IV);                           /* ADC12 Interrupt Vector Word */
789
 
790
#define ADC12MEM_              (0x0140)       /* ADC12 Conversion Memory */
791
#ifdef __ASM_HEADER__
792
#define ADC12MEM               (ADC12MEM_)    /* ADC12 Conversion Memory (for assembler) */
793
#else
794
#define ADC12MEM               ((int*)        ADC12MEM_) /* ADC12 Conversion Memory (for C) */
795
#endif
796
SFR_16BIT(ADC12MEM0);                         /* ADC12 Conversion Memory 0 */
797
SFR_16BIT(ADC12MEM1);                         /* ADC12 Conversion Memory 1 */
798
SFR_16BIT(ADC12MEM2);                         /* ADC12 Conversion Memory 2 */
799
SFR_16BIT(ADC12MEM3);                         /* ADC12 Conversion Memory 3 */
800
SFR_16BIT(ADC12MEM4);                         /* ADC12 Conversion Memory 4 */
801
SFR_16BIT(ADC12MEM5);                         /* ADC12 Conversion Memory 5 */
802
SFR_16BIT(ADC12MEM6);                         /* ADC12 Conversion Memory 6 */
803
SFR_16BIT(ADC12MEM7);                         /* ADC12 Conversion Memory 7 */
804
SFR_16BIT(ADC12MEM8);                         /* ADC12 Conversion Memory 8 */
805
SFR_16BIT(ADC12MEM9);                         /* ADC12 Conversion Memory 9 */
806
SFR_16BIT(ADC12MEM10);                        /* ADC12 Conversion Memory 10 */
807
SFR_16BIT(ADC12MEM11);                        /* ADC12 Conversion Memory 11 */
808
SFR_16BIT(ADC12MEM12);                        /* ADC12 Conversion Memory 12 */
809
SFR_16BIT(ADC12MEM13);                        /* ADC12 Conversion Memory 13 */
810
SFR_16BIT(ADC12MEM14);                        /* ADC12 Conversion Memory 14 */
811
SFR_16BIT(ADC12MEM15);                        /* ADC12 Conversion Memory 15 */
812
 
813
#define ADC12MCTL_             (0x0080)       /* ADC12 Memory Control */
814
#ifdef __ASM_HEADER__
815
#define ADC12MCTL              (ADC12MCTL_)   /* ADC12 Memory Control (for assembler) */
816
#else
817
#define ADC12MCTL              ((char*)       ADC12MCTL_) /* ADC12 Memory Control (for C) */
818
#endif
819
SFR_8BIT(ADC12MCTL0);                         /* ADC12 Memory Control 0 */
820
SFR_8BIT(ADC12MCTL1);                         /* ADC12 Memory Control 1 */
821
SFR_8BIT(ADC12MCTL2);                         /* ADC12 Memory Control 2 */
822
SFR_8BIT(ADC12MCTL3);                         /* ADC12 Memory Control 3 */
823
SFR_8BIT(ADC12MCTL4);                         /* ADC12 Memory Control 4 */
824
SFR_8BIT(ADC12MCTL5);                         /* ADC12 Memory Control 5 */
825
SFR_8BIT(ADC12MCTL6);                         /* ADC12 Memory Control 6 */
826
SFR_8BIT(ADC12MCTL7);                         /* ADC12 Memory Control 7 */
827
SFR_8BIT(ADC12MCTL8);                         /* ADC12 Memory Control 8 */
828
SFR_8BIT(ADC12MCTL9);                         /* ADC12 Memory Control 9 */
829
SFR_8BIT(ADC12MCTL10);                        /* ADC12 Memory Control 10 */
830
SFR_8BIT(ADC12MCTL11);                        /* ADC12 Memory Control 11 */
831
SFR_8BIT(ADC12MCTL12);                        /* ADC12 Memory Control 12 */
832
SFR_8BIT(ADC12MCTL13);                        /* ADC12 Memory Control 13 */
833
SFR_8BIT(ADC12MCTL14);                        /* ADC12 Memory Control 14 */
834
SFR_8BIT(ADC12MCTL15);                        /* ADC12 Memory Control 15 */
835
 
836
/* ADC12CTL0 */
837
#define ADC12SC                (0x001)        /* ADC12 Start Conversion */
838
#define ENC                    (0x002)        /* ADC12 Enable Conversion */
839
#define ADC12TOVIE             (0x004)        /* ADC12 Timer Overflow interrupt enable */
840
#define ADC12OVIE              (0x008)        /* ADC12 Overflow interrupt enable */
841
#define ADC12ON                (0x010)        /* ADC12 On/enable */
842
#define REFON                  (0x020)        /* ADC12 Reference on */
843
#define REF2_5V                (0x040)        /* ADC12 Ref 0:1.5V / 1:2.5V */
844
#define MSC                    (0x080)        /* ADC12 Multiple SampleConversion */
845
#define SHT00                  (0x0100)       /* ADC12 Sample Hold 0 Select 0 */
846
#define SHT01                  (0x0200)       /* ADC12 Sample Hold 0 Select 1 */
847
#define SHT02                  (0x0400)       /* ADC12 Sample Hold 0 Select 2 */
848
#define SHT03                  (0x0800)       /* ADC12 Sample Hold 0 Select 3 */
849
#define SHT10                  (0x1000)       /* ADC12 Sample Hold 0 Select 0 */
850
#define SHT11                  (0x2000)       /* ADC12 Sample Hold 1 Select 1 */
851
#define SHT12                  (0x4000)       /* ADC12 Sample Hold 2 Select 2 */
852
#define SHT13                  (0x8000)       /* ADC12 Sample Hold 3 Select 3 */
853
#define MSH                    (0x080)
854
 
855
#define SHT0_0                 (0*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 0 */
856
#define SHT0_1                 (1*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 1 */
857
#define SHT0_2                 (2*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 2 */
858
#define SHT0_3                 (3*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 3 */
859
#define SHT0_4                 (4*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 4 */
860
#define SHT0_5                 (5*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 5 */
861
#define SHT0_6                 (6*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 6 */
862
#define SHT0_7                 (7*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 7 */
863
#define SHT0_8                 (8*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 8 */
864
#define SHT0_9                 (9*0x100u)     /* ADC12 Sample Hold 0 Select Bit: 9 */
865
#define SHT0_10                (10*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 10 */
866
#define SHT0_11                (11*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 11 */
867
#define SHT0_12                (12*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 12 */
868
#define SHT0_13                (13*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 13 */
869
#define SHT0_14                (14*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 14 */
870
#define SHT0_15                (15*0x100u)    /* ADC12 Sample Hold 0 Select Bit: 15 */
871
 
872
#define SHT1_0                 (0*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 0 */
873
#define SHT1_1                 (1*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 1 */
874
#define SHT1_2                 (2*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 2 */
875
#define SHT1_3                 (3*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 3 */
876
#define SHT1_4                 (4*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 4 */
877
#define SHT1_5                 (5*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 5 */
878
#define SHT1_6                 (6*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 6 */
879
#define SHT1_7                 (7*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 7 */
880
#define SHT1_8                 (8*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 8 */
881
#define SHT1_9                 (9*0x1000u)    /* ADC12 Sample Hold 1 Select Bit: 9 */
882
#define SHT1_10                (10*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 10 */
883
#define SHT1_11                (11*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 11 */
884
#define SHT1_12                (12*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 12 */
885
#define SHT1_13                (13*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 13 */
886
#define SHT1_14                (14*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 14 */
887
#define SHT1_15                (15*0x1000u)   /* ADC12 Sample Hold 1 Select Bit: 15 */
888
 
889
/* ADC12CTL1 */
890
#define ADC12BUSY              (0x0001)       /* ADC12 Busy */
891
#define CONSEQ0                (0x0002)       /* ADC12 Conversion Sequence Select 0 */
892
#define CONSEQ1                (0x0004)       /* ADC12 Conversion Sequence Select 1 */
893
#define ADC12SSEL0             (0x0008)       /* ADC12 Clock Source Select 0 */
894
#define ADC12SSEL1             (0x0010)       /* ADC12 Clock Source Select 1 */
895
#define ADC12DIV0              (0x0020)       /* ADC12 Clock Divider Select 0 */
896
#define ADC12DIV1              (0x0040)       /* ADC12 Clock Divider Select 1 */
897
#define ADC12DIV2              (0x0080)       /* ADC12 Clock Divider Select 2 */
898
#define ISSH                   (0x0100)       /* ADC12 Invert Sample Hold Signal */
899
#define SHP                    (0x0200)       /* ADC12 Sample/Hold Pulse Mode */
900
#define SHS0                   (0x0400)       /* ADC12 Sample/Hold Source 0 */
901
#define SHS1                   (0x0800)       /* ADC12 Sample/Hold Source 1 */
902
#define CSTARTADD0             (0x1000)       /* ADC12 Conversion Start Address 0 */
903
#define CSTARTADD1             (0x2000)       /* ADC12 Conversion Start Address 1 */
904
#define CSTARTADD2             (0x4000)       /* ADC12 Conversion Start Address 2 */
905
#define CSTARTADD3             (0x8000)       /* ADC12 Conversion Start Address 3 */
906
 
907
#define CONSEQ_0               (0*2u)         /* ADC12 Conversion Sequence Select: 0 */
908
#define CONSEQ_1               (1*2u)         /* ADC12 Conversion Sequence Select: 1 */
909
#define CONSEQ_2               (2*2u)         /* ADC12 Conversion Sequence Select: 2 */
910
#define CONSEQ_3               (3*2u)         /* ADC12 Conversion Sequence Select: 3 */
911
#define ADC12SSEL_0            (0*8u)         /* ADC12 Clock Source Select: 0 */
912
#define ADC12SSEL_1            (1*8u)         /* ADC12 Clock Source Select: 1 */
913
#define ADC12SSEL_2            (2*8u)         /* ADC12 Clock Source Select: 2 */
914
#define ADC12SSEL_3            (3*8u)         /* ADC12 Clock Source Select: 3 */
915
#define ADC12DIV_0             (0*0x20u)      /* ADC12 Clock Divider Select: 0 */
916
#define ADC12DIV_1             (1*0x20u)      /* ADC12 Clock Divider Select: 1 */
917
#define ADC12DIV_2             (2*0x20u)      /* ADC12 Clock Divider Select: 2 */
918
#define ADC12DIV_3             (3*0x20u)      /* ADC12 Clock Divider Select: 3 */
919
#define ADC12DIV_4             (4*0x20u)      /* ADC12 Clock Divider Select: 4 */
920
#define ADC12DIV_5             (5*0x20u)      /* ADC12 Clock Divider Select: 5 */
921
#define ADC12DIV_6             (6*0x20u)      /* ADC12 Clock Divider Select: 6 */
922
#define ADC12DIV_7             (7*0x20u)      /* ADC12 Clock Divider Select: 7 */
923
#define SHS_0                  (0*0x400u)     /* ADC12 Sample/Hold Source: 0 */
924
#define SHS_1                  (1*0x400u)     /* ADC12 Sample/Hold Source: 1 */
925
#define SHS_2                  (2*0x400u)     /* ADC12 Sample/Hold Source: 2 */
926
#define SHS_3                  (3*0x400u)     /* ADC12 Sample/Hold Source: 3 */
927
#define CSTARTADD_0            (0*0x1000u)    /* ADC12 Conversion Start Address: 0 */
928
#define CSTARTADD_1            (1*0x1000u)    /* ADC12 Conversion Start Address: 1 */
929
#define CSTARTADD_2            (2*0x1000u)    /* ADC12 Conversion Start Address: 2 */
930
#define CSTARTADD_3            (3*0x1000u)    /* ADC12 Conversion Start Address: 3 */
931
#define CSTARTADD_4            (4*0x1000u)    /* ADC12 Conversion Start Address: 4 */
932
#define CSTARTADD_5            (5*0x1000u)    /* ADC12 Conversion Start Address: 5 */
933
#define CSTARTADD_6            (6*0x1000u)    /* ADC12 Conversion Start Address: 6 */
934
#define CSTARTADD_7            (7*0x1000u)    /* ADC12 Conversion Start Address: 7 */
935
#define CSTARTADD_8            (8*0x1000u)    /* ADC12 Conversion Start Address: 8 */
936
#define CSTARTADD_9            (9*0x1000u)    /* ADC12 Conversion Start Address: 9 */
937
#define CSTARTADD_10           (10*0x1000u)   /* ADC12 Conversion Start Address: 10 */
938
#define CSTARTADD_11           (11*0x1000u)   /* ADC12 Conversion Start Address: 11 */
939
#define CSTARTADD_12           (12*0x1000u)   /* ADC12 Conversion Start Address: 12 */
940
#define CSTARTADD_13           (13*0x1000u)   /* ADC12 Conversion Start Address: 13 */
941
#define CSTARTADD_14           (14*0x1000u)   /* ADC12 Conversion Start Address: 14 */
942
#define CSTARTADD_15           (15*0x1000u)   /* ADC12 Conversion Start Address: 15 */
943
 
944
/* ADC12MCTLx */
945
#define INCH0                  (0x0001)       /* ADC12 Input Channel Select Bit 0 */
946
#define INCH1                  (0x0002)       /* ADC12 Input Channel Select Bit 1 */
947
#define INCH2                  (0x0004)       /* ADC12 Input Channel Select Bit 2 */
948
#define INCH3                  (0x0008)       /* ADC12 Input Channel Select Bit 3 */
949
#define SREF0                  (0x0010)       /* ADC12 Select Reference Bit 0 */
950
#define SREF1                  (0x0020)       /* ADC12 Select Reference Bit 1 */
951
#define SREF2                  (0x0040)       /* ADC12 Select Reference Bit 2 */
952
#define EOS                    (0x0080)       /* ADC12 End of Sequence */
953
 
954
#define INCH_0                 (0)            /* ADC12 Input Channel 0 */
955
#define INCH_1                 (1)            /* ADC12 Input Channel 1 */
956
#define INCH_2                 (2)            /* ADC12 Input Channel 2 */
957
#define INCH_3                 (3)            /* ADC12 Input Channel 3 */
958
#define INCH_4                 (4)            /* ADC12 Input Channel 4 */
959
#define INCH_5                 (5)            /* ADC12 Input Channel 5 */
960
#define INCH_6                 (6)            /* ADC12 Input Channel 6 */
961
#define INCH_7                 (7)            /* ADC12 Input Channel 7 */
962
#define INCH_8                 (8)            /* ADC12 Input Channel 8 */
963
#define INCH_9                 (9)            /* ADC12 Input Channel 9 */
964
#define INCH_10                (10)           /* ADC12 Input Channel 10 */
965
#define INCH_11                (11)           /* ADC12 Input Channel 11 */
966
#define INCH_12                (12)           /* ADC12 Input Channel 12 */
967
#define INCH_13                (13)           /* ADC12 Input Channel 13 */
968
#define INCH_14                (14)           /* ADC12 Input Channel 14 */
969
#define INCH_15                (15)           /* ADC12 Input Channel 15 */
970
 
971
#define SREF_0                 (0*0x10u)      /* ADC12 Select Reference 0 */
972
#define SREF_1                 (1*0x10u)      /* ADC12 Select Reference 1 */
973
#define SREF_2                 (2*0x10u)      /* ADC12 Select Reference 2 */
974
#define SREF_3                 (3*0x10u)      /* ADC12 Select Reference 3 */
975
#define SREF_4                 (4*0x10u)      /* ADC12 Select Reference 4 */
976
#define SREF_5                 (5*0x10u)      /* ADC12 Select Reference 5 */
977
#define SREF_6                 (6*0x10u)      /* ADC12 Select Reference 6 */
978
#define SREF_7                 (7*0x10u)      /* ADC12 Select Reference 7 */
979
 
980
/* ADC12IV Definitions */
981
#define ADC12IV_NONE           (0x0000)       /* No Interrupt pending */
982
#define ADC12IV_ADC12OVIFG     (0x0002)       /* ADC12OVIFG */
983
#define ADC12IV_ADC12TOVIFG    (0x0004)       /* ADC12TOVIFG */
984
#define ADC12IV_ADC12IFG0      (0x0006)       /* ADC12IFG0 */
985
#define ADC12IV_ADC12IFG1      (0x0008)       /* ADC12IFG1 */
986
#define ADC12IV_ADC12IFG2      (0x000A)       /* ADC12IFG2 */
987
#define ADC12IV_ADC12IFG3      (0x000C)       /* ADC12IFG3 */
988
#define ADC12IV_ADC12IFG4      (0x000E)       /* ADC12IFG4 */
989
#define ADC12IV_ADC12IFG5      (0x0010)       /* ADC12IFG5 */
990
#define ADC12IV_ADC12IFG6      (0x0012)       /* ADC12IFG6 */
991
#define ADC12IV_ADC12IFG7      (0x0014)       /* ADC12IFG7 */
992
#define ADC12IV_ADC12IFG8      (0x0016)       /* ADC12IFG8 */
993
#define ADC12IV_ADC12IFG9      (0x0018)       /* ADC12IFG9 */
994
#define ADC12IV_ADC12IFG10     (0x001A)       /* ADC12IFG10 */
995
#define ADC12IV_ADC12IFG11     (0x001C)       /* ADC12IFG11 */
996
#define ADC12IV_ADC12IFG12     (0x001E)       /* ADC12IFG12 */
997
#define ADC12IV_ADC12IFG13     (0x0020)       /* ADC12IFG13 */
998
#define ADC12IV_ADC12IFG14     (0x0022)       /* ADC12IFG14 */
999
#define ADC12IV_ADC12IFG15     (0x0024)       /* ADC12IFG15 */
1000
 
1001
/************************************************************
1002
* DAC12
1003
************************************************************/
1004
#define __MSP430_HAS_DAC12_2__                /* Definition to show that Module is available */
1005
 
1006
SFR_16BIT(DAC12_0CTL);                        /* DAC12_0 Control */
1007
SFR_16BIT(DAC12_1CTL);                        /* DAC12_1 Control */
1008
 
1009
#define DAC12GRP               (0x0001)       /* DAC12 group */
1010
#define DAC12ENC               (0x0002)       /* DAC12 enable conversion */
1011
#define DAC12IFG               (0x0004)       /* DAC12 interrupt flag */
1012
#define DAC12IE                (0x0008)       /* DAC12 interrupt enable */
1013
#define DAC12DF                (0x0010)       /* DAC12 data format */
1014
#define DAC12AMP0              (0x0020)       /* DAC12 amplifier bit 0 */
1015
#define DAC12AMP1              (0x0040)       /* DAC12 amplifier bit 1 */
1016
#define DAC12AMP2              (0x0080)       /* DAC12 amplifier bit 2 */
1017
#define DAC12IR                (0x0100)       /* DAC12 input reference and output range */
1018
#define DAC12CALON             (0x0200)       /* DAC12 calibration */
1019
#define DAC12LSEL0             (0x0400)       /* DAC12 load select bit 0 */
1020
#define DAC12LSEL1             (0x0800)       /* DAC12 load select bit 1 */
1021
#define DAC12RES               (0x1000)       /* DAC12 resolution */
1022
#define DAC12SREF0             (0x2000)       /* DAC12 reference bit 0 */
1023
#define DAC12SREF1             (0x4000)       /* DAC12 reference bit 1 */
1024
 
1025
#define DAC12AMP_0             (0*0x0020u)    /* DAC12 amplifier 0: off,    3-state */
1026
#define DAC12AMP_1             (1*0x0020u)    /* DAC12 amplifier 1: off,    off */
1027
#define DAC12AMP_2             (2*0x0020u)    /* DAC12 amplifier 2: low,    low */
1028
#define DAC12AMP_3             (3*0x0020u)    /* DAC12 amplifier 3: low,    medium */
1029
#define DAC12AMP_4             (4*0x0020u)    /* DAC12 amplifier 4: low,    high */
1030
#define DAC12AMP_5             (5*0x0020u)    /* DAC12 amplifier 5: medium, medium */
1031
#define DAC12AMP_6             (6*0x0020u)    /* DAC12 amplifier 6: medium, high */
1032
#define DAC12AMP_7             (7*0x0020u)    /* DAC12 amplifier 7: high,   high */
1033
 
1034
#define DAC12LSEL_0            (0*0x0400u)    /* DAC12 load select 0: direct */
1035
#define DAC12LSEL_1            (1*0x0400u)    /* DAC12 load select 1: latched with DAT */
1036
#define DAC12LSEL_2            (2*0x0400u)    /* DAC12 load select 2: latched with pos. Timer_A3.OUT1 */
1037
#define DAC12LSEL_3            (3*0x0400u)    /* DAC12 load select 3: latched with pos. Timer_B7.OUT1 */
1038
 
1039
#define DAC12SREF_0            (0*0x2000u)    /* DAC12 reference 0: Vref+ */
1040
#define DAC12SREF_1            (1*0x2000u)    /* DAC12 reference 1: Vref+ */
1041
#define DAC12SREF_2            (2*0x2000u)    /* DAC12 reference 2: Veref+ */
1042
#define DAC12SREF_3            (3*0x2000u)    /* DAC12 reference 3: Veref+ */
1043
 
1044
SFR_16BIT(DAC12_0DAT);                        /* DAC12_0 Data */
1045
SFR_16BIT(DAC12_1DAT);                        /* DAC12_1 Data */
1046
/************************************************************
1047
* DMA
1048
************************************************************/
1049
#define __MSP430_HAS_DMA_3__                  /* Definition to show that Module is available */
1050
 
1051
SFR_16BIT(DMACTL0);                           /* DMA Module Control 0 */
1052
#define DMA0TSEL0              (0x0001)       /* DMA channel 0 transfer select bit 0 */
1053
#define DMA0TSEL1              (0x0002)       /* DMA channel 0 transfer select bit 1 */
1054
#define DMA0TSEL2              (0x0004)       /* DMA channel 0 transfer select bit 2 */
1055
#define DMA0TSEL3              (0x0008)       /* DMA channel 0 transfer select bit 3 */
1056
#define DMA1TSEL0              (0x0010)       /* DMA channel 1 transfer select bit 0 */
1057
#define DMA1TSEL1              (0x0020)       /* DMA channel 1 transfer select bit 1 */
1058
#define DMA1TSEL2              (0x0040)       /* DMA channel 1 transfer select bit 2 */
1059
#define DMA1TSEL3              (0x0080)       /* DMA channel 1 transfer select bit 3 */
1060
#define DMA2TSEL0              (0x0100)       /* DMA channel 2 transfer select bit 0 */
1061
#define DMA2TSEL1              (0x0200)       /* DMA channel 2 transfer select bit 1 */
1062
#define DMA2TSEL2              (0x0400)       /* DMA channel 2 transfer select bit 2 */
1063
#define DMA2TSEL3              (0x0800)       /* DMA channel 2 transfer select bit 3 */
1064
 
1065
#define DMA0TSEL_0             (0*0x0001u)    /* DMA channel 0 transfer select 0:  DMA_REQ (sw)*/
1066
#define DMA0TSEL_1             (1*0x0001u)    /* DMA channel 0 transfer select 1:  Timer_A (TACCR2.IFG) */
1067
#define DMA0TSEL_2             (2*0x0001u)    /* DMA channel 0 transfer select 2:  Timer_B (TBCCR2.IFG) */
1068
#define DMA0TSEL_3             (3*0x0001u)    /* DMA channel 0 transfer select 3:  UART0/I2C receive */
1069
#define DMA0TSEL_4             (4*0x0001u)    /* DMA channel 0 transfer select 4:  UART0/I2C transmit */
1070
#define DMA0TSEL_5             (5*0x0001u)    /* DMA channel 0 transfer select 5:  DAC12_0CTL.DAC12IFG */
1071
#define DMA0TSEL_6             (6*0x0001u)    /* DMA channel 0 transfer select 6:  ADC12 (ADC12IFG) */
1072
#define DMA0TSEL_7             (7*0x0001u)    /* DMA channel 0 transfer select 7:  Timer_A (TACCR0.IFG) */
1073
#define DMA0TSEL_8             (8*0x0001u)    /* DMA channel 0 transfer select 8:  Timer_B (TBCCR0.IFG) */
1074
#define DMA0TSEL_9             (9*0x0001u)    /* DMA channel 0 transfer select 9:  UART1 receive */
1075
#define DMA0TSEL_10            (10*0x0001u)   /* DMA channel 0 transfer select 10: UART1 transmit */
1076
#define DMA0TSEL_11            (11*0x0001u)   /* DMA channel 0 transfer select 11: Multiplier ready */
1077
#define DMA0TSEL_14            (14*0x0001u)   /* DMA channel 0 transfer select 14: previous DMA channel DMA2IFG */
1078
#define DMA0TSEL_15            (15*0x0001u)   /* DMA channel 0 transfer select 15: ext. Trigger (DMAE0) */
1079
 
1080
#define DMA1TSEL_0             (0*0x0010u)    /* DMA channel 1 transfer select 0:  DMA_REQ */
1081
#define DMA1TSEL_1             (1*0x0010u)    /* DMA channel 1 transfer select 1:  Timer_A CCRIFG.2 */
1082
#define DMA1TSEL_2             (2*0x0010u)    /* DMA channel 1 transfer select 2:  Timer_B CCRIFG.2 */
1083
#define DMA1TSEL_3             (3*0x0010u)    /* DMA channel 1 transfer select 3:  UART0/I2C receive */
1084
#define DMA1TSEL_4             (4*0x0010u)    /* DMA channel 1 transfer select 4:  UART0/I2C transmit */
1085
#define DMA1TSEL_5             (5*0x0010u)    /* DMA channel 1 transfer select 5:  DAC12.0IFG */
1086
#define DMA1TSEL_6             (6*0x0010u)    /* DMA channel 1 transfer select 6:  ADC12 (ADC12IFG) */
1087
#define DMA1TSEL_7             (7*0x0010u)    /* DMA channel 1 transfer select 7:  Timer_A (TACCR0.IFG) */
1088
#define DMA1TSEL_8             (8*0x0010u)    /* DMA channel 1 transfer select 8:  Timer_B (TBCCR0.IFG) */
1089
#define DMA1TSEL_9             (9*0x0010u)    /* DMA channel 1 transfer select 9:  UART1 receive */
1090
#define DMA1TSEL_10            (10*0x0010u)   /* DMA channel 1 transfer select 10: UART1 transmit */
1091
#define DMA1TSEL_11            (11*0x0010u)   /* DMA channel 1 transfer select 11: Multiplier ready */
1092
#define DMA1TSEL_14            (14*0x0010u)   /* DMA channel 1 transfer select 14: previous DMA channel DMA0IFG */
1093
#define DMA1TSEL_15            (15*0x0010u)   /* DMA channel 1 transfer select 15: ext. Trigger (DMAE0) */
1094
 
1095
#define DMA2TSEL_0             (0*0x0100u)    /* DMA channel 2 transfer select 0:  DMA_REQ */
1096
#define DMA2TSEL_1             (1*0x0100u)    /* DMA channel 2 transfer select 1:  Timer_A CCRIFG.2 */
1097
#define DMA2TSEL_2             (2*0x0100u)    /* DMA channel 2 transfer select 2:  Timer_B CCRIFG.2 */
1098
#define DMA2TSEL_3             (3*0x0100u)    /* DMA channel 2 transfer select 3:  UART0/I2C receive */
1099
#define DMA2TSEL_4             (4*0x0100u)    /* DMA channel 2 transfer select 4:  UART0/I2C transmit */
1100
#define DMA2TSEL_5             (5*0x0100u)    /* DMA channel 2 transfer select 5:  DAC12.0IFG */
1101
#define DMA2TSEL_6             (6*0x0100u)    /* DMA channel 2 transfer select 6:  ADC12 (ADC12IFG) */
1102
#define DMA2TSEL_7             (7*0x0100u)    /* DMA channel 2 transfer select 7:  Timer_A (TACCR0.IFG) */
1103
#define DMA2TSEL_8             (8*0x0100u)    /* DMA channel 2 transfer select 8:  Timer_B (TBCCR0.IFG) */
1104
#define DMA2TSEL_9             (9*0x0100u)    /* DMA channel 2 transfer select 9:  UART1 receive */
1105
#define DMA2TSEL_10            (10*0x0100u)   /* DMA channel 2 transfer select 10: UART1 transmit */
1106
#define DMA2TSEL_11            (11*0x0100u)   /* DMA channel 2 transfer select 11: Multiplier ready */
1107
#define DMA2TSEL_14            (14*0x0100u)   /* DMA channel 2 transfer select 14: previous DMA channel DMA1IFG */
1108
#define DMA2TSEL_15            (15*0x0100u)   /* DMA channel 2 transfer select 15: ext. Trigger (DMAE0) */
1109
 
1110
SFR_16BIT(DMACTL1);                           /* DMA Module Control 1 */
1111
#define ENNMI                  (0x0001)       /* Enable NMI interruption of DMA */
1112
#define ROUNDROBIN             (0x0002)       /* Round-Robin DMA channel priorities */
1113
#define DMAONFETCH             (0x0004)       /* DMA transfer on instruction fetch */
1114
 
1115
SFR_16BIT(DMA0CTL);                           /* DMA Channel 0 Control */
1116
SFR_16BIT(DMA1CTL);                           /* DMA Channel 1 Control */
1117
SFR_16BIT(DMA2CTL);                           /* DMA Channel 2 Control */
1118
 
1119
#define DMAREQ                 (0x0001)       /* Initiate DMA transfer with DMATSEL */
1120
#define DMAABORT               (0x0002)       /* DMA transfer aborted by NMI */
1121
#define DMAIE                  (0x0004)       /* DMA interrupt enable */
1122
#define DMAIFG                 (0x0008)       /* DMA interrupt flag */
1123
#define DMAEN                  (0x0010)       /* DMA enable */
1124
#define DMALEVEL               (0x0020)       /* DMA level sensitive trigger select */
1125
#define DMASRCBYTE             (0x0040)       /* DMA source byte */
1126
#define DMADSTBYTE             (0x0080)       /* DMA destination byte */
1127
#define DMASRCINCR0            (0x0100)       /* DMA source increment bit 0 */
1128
#define DMASRCINCR1            (0x0200)       /* DMA source increment bit 1 */
1129
#define DMADSTINCR0            (0x0400)       /* DMA destination increment bit 0 */
1130
#define DMADSTINCR1            (0x0800)       /* DMA destination increment bit 1 */
1131
#define DMADT0                 (0x1000)       /* DMA transfer mode bit 0 */
1132
#define DMADT1                 (0x2000)       /* DMA transfer mode bit 1 */
1133
#define DMADT2                 (0x4000)       /* DMA transfer mode bit 2 */
1134
 
1135
#define DMASWDW                (0*0x0040u)    /* DMA transfer: source word to destination word */
1136
#define DMASBDW                (1*0x0040u)    /* DMA transfer: source byte to destination word */
1137
#define DMASWDB                (2*0x0040u)    /* DMA transfer: source word to destination byte */
1138
#define DMASBDB                (3*0x0040u)    /* DMA transfer: source byte to destination byte */
1139
 
1140
#define DMASRCINCR_0           (0*0x0100u)    /* DMA source increment 0: source address unchanged */
1141
#define DMASRCINCR_1           (1*0x0100u)    /* DMA source increment 1: source address unchanged */
1142
#define DMASRCINCR_2           (2*0x0100u)    /* DMA source increment 2: source address decremented */
1143
#define DMASRCINCR_3           (3*0x0100u)    /* DMA source increment 3: source address incremented */
1144
 
1145
#define DMADSTINCR_0           (0*0x0400u)    /* DMA destination increment 0: destination address unchanged */
1146
#define DMADSTINCR_1           (1*0x0400u)    /* DMA destination increment 1: destination address unchanged */
1147
#define DMADSTINCR_2           (2*0x0400u)    /* DMA destination increment 2: destination address decremented */
1148
#define DMADSTINCR_3           (3*0x0400u)    /* DMA destination increment 3: destination address incremented */
1149
 
1150
#define DMADT_0                (0*0x1000u)    /* DMA transfer mode 0: single */
1151
#define DMADT_1                (1*0x1000u)    /* DMA transfer mode 1: block */
1152
#define DMADT_2                (2*0x1000u)    /* DMA transfer mode 2: interleaved */
1153
#define DMADT_3                (3*0x1000u)    /* DMA transfer mode 3: interleaved */
1154
#define DMADT_4                (4*0x1000u)    /* DMA transfer mode 4: single, repeat */
1155
#define DMADT_5                (5*0x1000u)    /* DMA transfer mode 5: block, repeat */
1156
#define DMADT_6                (6*0x1000u)    /* DMA transfer mode 6: interleaved, repeat */
1157
#define DMADT_7                (7*0x1000u)    /* DMA transfer mode 7: interleaved, repeat */
1158
 
1159
SFR_16BIT(DMA0SA);                            /* DMA Channel 0 Source Address */
1160
SFR_16BIT(DMA0DA);                            /* DMA Channel 0 Destination Address */
1161
SFR_16BIT(DMA0SZ);                            /* DMA Channel 0 Transfer Size */
1162
SFR_16BIT(DMA1SA);                            /* DMA Channel 1 Source Address */
1163
SFR_16BIT(DMA1DA);                            /* DMA Channel 1 Destination Address */
1164
SFR_16BIT(DMA1SZ);                            /* DMA Channel 1 Transfer Size */
1165
SFR_16BIT(DMA2SA);                            /* DMA Channel 2 Source Address */
1166
SFR_16BIT(DMA2DA);                            /* DMA Channel 2 Destination Address */
1167
SFR_16BIT(DMA2SZ);                            /* DMA Channel 2 Transfer Size */
1168
 
1169
/************************************************************
1170
* Interrupt Vectors (offset from 0xFFE0)
1171
************************************************************/
1172
 
1173
#define VECTOR_NAME(name)       name##_ptr
1174
#define EMIT_PRAGMA(x)          _Pragma(#x)
1175
#define CREATE_VECTOR(name)     void (* const VECTOR_NAME(name))(void) = &name
1176
#define PLACE_VECTOR(vector,section) EMIT_PRAGMA(DATA_SECTION(vector,section))
1177
#define ISR_VECTOR(func,offset) CREATE_VECTOR(func); \
1178
                                PLACE_VECTOR(VECTOR_NAME(func), offset)
1179
 
1180
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1181
#define DACDMA_VECTOR           ".int00"                    /* 0xFFE0 DAC/DMA */
1182
#else
1183
#define DACDMA_VECTOR           (0 * 1u)                     /* 0xFFE0 DAC/DMA */
1184
/*#define DACDMA_ISR(func)        ISR_VECTOR(func, ".int00")  */ /* 0xFFE0 DAC/DMA */ /* CCE V2 Style */
1185
#endif
1186
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1187
#define PORT2_VECTOR            ".int01"                    /* 0xFFE2 Port 2 */
1188
#else
1189
#define PORT2_VECTOR            (1 * 1u)                     /* 0xFFE2 Port 2 */
1190
/*#define PORT2_ISR(func)         ISR_VECTOR(func, ".int01")  */ /* 0xFFE2 Port 2 */ /* CCE V2 Style */
1191
#endif
1192
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1193
#define PORT1_VECTOR            ".int04"                    /* 0xFFE8 Port 1 */
1194
#else
1195
#define PORT1_VECTOR            (4 * 1u)                     /* 0xFFE8 Port 1 */
1196
/*#define PORT1_ISR(func)         ISR_VECTOR(func, ".int04")  */ /* 0xFFE8 Port 1 */ /* CCE V2 Style */
1197
#endif
1198
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1199
#define TIMERA1_VECTOR          ".int05"                    /* 0xFFEA Timer A CC1-2, TA */
1200
#else
1201
#define TIMERA1_VECTOR          (5 * 1u)                     /* 0xFFEA Timer A CC1-2, TA */
1202
/*#define TIMERA1_ISR(func)       ISR_VECTOR(func, ".int05")  */ /* 0xFFEA Timer A CC1-2, TA */ /* CCE V2 Style */
1203
#endif
1204
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1205
#define TIMERA0_VECTOR          ".int06"                    /* 0xFFEC Timer A CC0 */
1206
#else
1207
#define TIMERA0_VECTOR          (6 * 1u)                     /* 0xFFEC Timer A CC0 */
1208
/*#define TIMERA0_ISR(func)       ISR_VECTOR(func, ".int06")  */ /* 0xFFEC Timer A CC0 */ /* CCE V2 Style */
1209
#endif
1210
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1211
#define ADC12_VECTOR            ".int07"                    /* 0xFFEE ADC */
1212
#else
1213
#define ADC12_VECTOR            (7 * 1u)                     /* 0xFFEE ADC */
1214
/*#define ADC12_ISR(func)         ISR_VECTOR(func, ".int07")  */ /* 0xFFEE ADC */ /* CCE V2 Style */
1215
#endif
1216
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1217
#define USART0TX_VECTOR         ".int08"                    /* 0xFFF0 USART 0 Transmit */
1218
#else
1219
#define USART0TX_VECTOR         (8 * 1u)                     /* 0xFFF0 USART 0 Transmit */
1220
/*#define USART0TX_ISR(func)      ISR_VECTOR(func, ".int08")  */ /* 0xFFF0 USART 0 Transmit */ /* CCE V2 Style */
1221
#endif
1222
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1223
#define USART0RX_VECTOR         ".int09"                    /* 0xFFF2 USART 0 Receive */
1224
#else
1225
#define USART0RX_VECTOR         (9 * 1u)                     /* 0xFFF2 USART 0 Receive */
1226
/*#define USART0RX_ISR(func)      ISR_VECTOR(func, ".int09")  */ /* 0xFFF2 USART 0 Receive */ /* CCE V2 Style */
1227
#endif
1228
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1229
#define WDT_VECTOR              ".int10"                    /* 0xFFF4 Watchdog Timer */
1230
#else
1231
#define WDT_VECTOR              (10 * 1u)                    /* 0xFFF4 Watchdog Timer */
1232
/*#define WDT_ISR(func)           ISR_VECTOR(func, ".int10")  */ /* 0xFFF4 Watchdog Timer */ /* CCE V2 Style */
1233
#endif
1234
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1235
#define COMPARATORA_VECTOR      ".int11"                    /* 0xFFF6 Comparator A */
1236
#else
1237
#define COMPARATORA_VECTOR      (11 * 1u)                    /* 0xFFF6 Comparator A */
1238
/*#define COMPARATORA_ISR(func)   ISR_VECTOR(func, ".int11")  */ /* 0xFFF6 Comparator A */ /* CCE V2 Style */
1239
#endif
1240
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1241
#define TIMERB1_VECTOR          ".int12"                    /* 0xFFF8 Timer B CC1-2, TB */
1242
#else
1243
#define TIMERB1_VECTOR          (12 * 1u)                    /* 0xFFF8 Timer B CC1-2, TB */
1244
/*#define TIMERB1_ISR(func)       ISR_VECTOR(func, ".int12")  */ /* 0xFFF8 Timer B CC1-2, TB */ /* CCE V2 Style */
1245
#endif
1246
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1247
#define TIMERB0_VECTOR          ".int13"                    /* 0xFFFA Timer B CC0 */
1248
#else
1249
#define TIMERB0_VECTOR          (13 * 1u)                    /* 0xFFFA Timer B CC0 */
1250
/*#define TIMERB0_ISR(func)       ISR_VECTOR(func, ".int13")  */ /* 0xFFFA Timer B CC0 */ /* CCE V2 Style */
1251
#endif
1252
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1253
#define NMI_VECTOR              ".int14"                    /* 0xFFFC Non-maskable */
1254
#else
1255
#define NMI_VECTOR              (14 * 1u)                    /* 0xFFFC Non-maskable */
1256
/*#define NMI_ISR(func)           ISR_VECTOR(func, ".int14")  */ /* 0xFFFC Non-maskable */ /* CCE V2 Style */
1257
#endif
1258
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
1259
#define RESET_VECTOR            ".reset"                    /* 0xFFFE Reset [Highest Priority] */
1260
#else
1261
#define RESET_VECTOR            (15 * 1u)                    /* 0xFFFE Reset [Highest Priority] */
1262
/*#define RESET_ISR(func)         ISR_VECTOR(func, ".int15")  */ /* 0xFFFE Reset [Highest Priority] */ /* CCE V2 Style */
1263
#endif
1264
 
1265
 
1266
/************************************************************
1267
* End of Modules
1268
************************************************************/
1269
 
1270
#ifdef __cplusplus
1271
}
1272
#endif /* extern "C" */
1273
 
1274
#endif /* #ifndef __msp430x15x */
1275