Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2850 dpurdie 1
/********************************************************************
2
*
3
* Standard register and bit definitions for the Texas Instruments
4
* MSP430 microcontroller.
5
*
6
* This file supports assembler and C development for
7
* MSP430x14x1 devices.
8
*
9
* Texas Instruments, Version 2.3
10
*
11
* Rev. 1.2, Additional Timer B bit definitions.
12
*           Renamed XTOFF to XT2OFF.
13
* Rev. 1.3, Removed leading 0 to aviod interpretation as octal
14
*            values under C
15
* Rev. 1.4, Corrected LPMx_EXIT to reference new intrinsic    _bic_SR_register_on_exit
16
*           Changed TAIV and TBIV to be read-only
17
* Rev. 1.5, Enclose all #define statements with parentheses
18
* Rev. 1.6, Defined vectors for USART (in addition to UART)
19
* Rev. 1.7, Added USART special function labels (UxME, UxIE, UxIFG)
20
* Rev. 2.1, Alignment of defintions in Users Guide and of version numbers
21
* Rev. 2.2, Removed unused def of TASSEL2 / TBSSEL2
22
* Rev. 2.3, added definitions for Interrupt Vectors xxIV
23
*
24
********************************************************************/
25
 
26
#ifndef __msp430x14x1
27
#define __msp430x14x1
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
 
42
 
43
/************************************************************
44
* STANDARD BITS
45
************************************************************/
46
 
47
#define BIT0                   (0x0001)
48
#define BIT1                   (0x0002)
49
#define BIT2                   (0x0004)
50
#define BIT3                   (0x0008)
51
#define BIT4                   (0x0010)
52
#define BIT5                   (0x0020)
53
#define BIT6                   (0x0040)
54
#define BIT7                   (0x0080)
55
#define BIT8                   (0x0100)
56
#define BIT9                   (0x0200)
57
#define BITA                   (0x0400)
58
#define BITB                   (0x0800)
59
#define BITC                   (0x1000)
60
#define BITD                   (0x2000)
61
#define BITE                   (0x4000)
62
#define BITF                   (0x8000)
63
 
64
/************************************************************
65
* STATUS REGISTER BITS
66
************************************************************/
67
 
68
#define C                      (0x0001)
69
#define Z                      (0x0002)
70
#define N                      (0x0004)
71
#define V                      (0x0100)
72
#define GIE                    (0x0008)
73
#define CPUOFF                 (0x0010)
74
#define OSCOFF                 (0x0020)
75
#define SCG0                   (0x0040)
76
#define SCG1                   (0x0080)
77
 
78
/* Low Power Modes coded with Bits 4-7 in SR */
79
 
80
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
81
#define LPM0                   (CPUOFF)
82
#define LPM1                   (SCG0+CPUOFF)
83
#define LPM2                   (SCG1+CPUOFF)
84
#define LPM3                   (SCG1+SCG0+CPUOFF)
85
#define LPM4                   (SCG1+SCG0+OSCOFF+CPUOFF)
86
/* End #defines for assembler */
87
 
88
#else /* Begin #defines for C */
89
#define LPM0_bits              (CPUOFF)
90
#define LPM1_bits              (SCG0+CPUOFF)
91
#define LPM2_bits              (SCG1+CPUOFF)
92
#define LPM3_bits              (SCG1+SCG0+CPUOFF)
93
#define LPM4_bits              (SCG1+SCG0+OSCOFF+CPUOFF)
94
 
95
#include "in430.h"
96
 
97
#define LPM0         _bis_SR_register(LPM0_bits)         /* Enter Low Power Mode 0 */
98
#define LPM0_EXIT    _bic_SR_register_on_exit(LPM0_bits) /* Exit Low Power Mode 0 */
99
#define LPM1         _bis_SR_register(LPM1_bits)         /* Enter Low Power Mode 1 */
100
#define LPM1_EXIT    _bic_SR_register_on_exit(LPM1_bits) /* Exit Low Power Mode 1 */
101
#define LPM2         _bis_SR_register(LPM2_bits)         /* Enter Low Power Mode 2 */
102
#define LPM2_EXIT    _bic_SR_register_on_exit(LPM2_bits) /* Exit Low Power Mode 2 */
103
#define LPM3         _bis_SR_register(LPM3_bits)         /* Enter Low Power Mode 3 */
104
#define LPM3_EXIT    _bic_SR_register_on_exit(LPM3_bits) /* Exit Low Power Mode 3 */
105
#define LPM4         _bis_SR_register(LPM4_bits)         /* Enter Low Power Mode 4 */
106
#define LPM4_EXIT    _bic_SR_register_on_exit(LPM4_bits) /* Exit Low Power Mode 4 */
107
#endif /* End #defines for C */
108
 
109
/************************************************************
110
* PERIPHERAL FILE MAP
111
************************************************************/
112
 
113
/************************************************************
114
* SPECIAL FUNCTION REGISTER ADDRESSES + CONTROL BITS
115
************************************************************/
116
 
117
SFR_8BIT(IE1);                                /* Interrupt Enable 1 */
118
#define U0IE                   IE1            /* UART0 Interrupt Enable Register */
119
#define WDTIE                  (0x01)
120
#define OFIE                   (0x02)
121
#define NMIIE                  (0x10)
122
#define ACCVIE                 (0x20)
123
#define URXIE0                 (0x40)
124
#define UTXIE0                 (0x80)
125
 
126
SFR_8BIT(IFG1);                               /* Interrupt Flag 1 */
127
#define U0IFG                  IFG1           /* UART0 Interrupt Flag Register */
128
#define WDTIFG                 (0x01)
129
#define OFIFG                  (0x02)
130
#define NMIIFG                 (0x10)
131
#define URXIFG0                (0x40)
132
#define UTXIFG0                (0x80)
133
 
134
SFR_8BIT(ME1);                                /* Module Enable 1 */
135
#define U0ME                   ME1            /* UART0 Module Enable Register */
136
#define URXE0                  (0x40)
137
#define UTXE0                  (0x80)
138
#define USPIE0                 (0x40)
139
 
140
SFR_8BIT(IE2);                                /* Interrupt Enable 2 */
141
#define U1IE                   IE2            /* UART1 Interrupt Enable Register */
142
#define URXIE1                 (0x10)
143
#define UTXIE1                 (0x20)
144
 
145
SFR_8BIT(IFG2);                               /* Interrupt Flag 2 */
146
#define U1IFG                  IFG2           /* UART1 Interrupt Flag Register */
147
#define URXIFG1                (0x10)
148
#define UTXIFG1                (0x20)
149
 
150
SFR_8BIT(ME2);                                /* Module Enable 2 */
151
#define U1ME                   ME2            /* UART1 Module Enable Register */
152
#define URXE1                  (0x10)
153
#define UTXE1                  (0x20)
154
#define USPIE1                 (0x10)
155
 
156
/************************************************************
157
* WATCHDOG TIMER
158
************************************************************/
159
#define __MSP430_HAS_WDT__                    /* Definition to show that Module is available */
160
 
161
SFR_16BIT(WDTCTL);                            /* Watchdog Timer Control */
162
/* The bit names have been prefixed with "WDT" */
163
#define WDTIS0                 (0x0001)
164
#define WDTIS1                 (0x0002)
165
#define WDTSSEL                (0x0004)
166
#define WDTCNTCL               (0x0008)
167
#define WDTTMSEL               (0x0010)
168
#define WDTNMI                 (0x0020)
169
#define WDTNMIES               (0x0040)
170
#define WDTHOLD                (0x0080)
171
 
172
#define WDTPW                  (0x5A00)
173
 
174
/* WDT-interval times [1ms] coded with Bits 0-2 */
175
/* WDT is clocked by fSMCLK (assumed 1MHz) */
176
#define WDT_MDLY_32         (WDTPW+WDTTMSEL+WDTCNTCL)                         /* 32ms interval (default) */
177
#define WDT_MDLY_8          (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS0)                  /* 8ms     " */
178
#define WDT_MDLY_0_5        (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS1)                  /* 0.5ms   " */
179
#define WDT_MDLY_0_064      (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS1+WDTIS0)           /* 0.064ms " */
180
/* WDT is clocked by fACLK (assumed 32KHz) */
181
#define WDT_ADLY_1000       (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL)                 /* 1000ms  " */
182
#define WDT_ADLY_250        (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS0)          /* 250ms   " */
183
#define WDT_ADLY_16         (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS1)          /* 16ms    " */
184
#define WDT_ADLY_1_9        (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS1+WDTIS0)   /* 1.9ms   " */
185
/* Watchdog mode -> reset after expired time */
186
/* WDT is clocked by fSMCLK (assumed 1MHz) */
187
#define WDT_MRST_32         (WDTPW+WDTCNTCL)                                  /* 32ms interval (default) */
188
#define WDT_MRST_8          (WDTPW+WDTCNTCL+WDTIS0)                           /* 8ms     " */
189
#define WDT_MRST_0_5        (WDTPW+WDTCNTCL+WDTIS1)                           /* 0.5ms   " */
190
#define WDT_MRST_0_064      (WDTPW+WDTCNTCL+WDTIS1+WDTIS0)                    /* 0.064ms " */
191
/* WDT is clocked by fACLK (assumed 32KHz) */
192
#define WDT_ARST_1000       (WDTPW+WDTCNTCL+WDTSSEL)                          /* 1000ms  " */
193
#define WDT_ARST_250        (WDTPW+WDTCNTCL+WDTSSEL+WDTIS0)                   /* 250ms   " */
194
#define WDT_ARST_16         (WDTPW+WDTCNTCL+WDTSSEL+WDTIS1)                   /* 16ms    " */
195
#define WDT_ARST_1_9        (WDTPW+WDTCNTCL+WDTSSEL+WDTIS1+WDTIS0)            /* 1.9ms   " */
196
 
197
/* INTERRUPT CONTROL */
198
/* These two bits are defined in the Special Function Registers */
199
/* #define WDTIE               0x01 */
200
/* #define WDTIFG              0x01 */
201
 
202
/************************************************************
203
* HARDWARE MULTIPLIER
204
************************************************************/
205
#define __MSP430_HAS_MPY__                    /* Definition to show that Module is available */
206
 
207
SFR_16BIT(MPY);                               /* Multiply Unsigned/Operand 1 */
208
SFR_16BIT(MPYS);                              /* Multiply Signed/Operand 1 */
209
SFR_16BIT(MAC);                               /* Multiply Unsigned and Accumulate/Operand 1 */
210
SFR_16BIT(MACS);                              /* Multiply Signed and Accumulate/Operand 1 */
211
SFR_16BIT(OP2);                               /* Operand 2 */
212
SFR_16BIT(RESLO);                             /* Result Low Word */
213
SFR_16BIT(RESHI);                             /* Result High Word */
214
SFR_16BIT(SUMEXT);                            /* Sum Extend */
215
 
216
/************************************************************
217
* DIGITAL I/O Port1/2
218
************************************************************/
219
#define __MSP430_HAS_PORT1__                  /* Definition to show that Module is available */
220
#define __MSP430_HAS_PORT2__                  /* Definition to show that Module is available */
221
 
222
SFR_8BIT(P1IN);                               /* Port 1 Input */
223
SFR_8BIT(P1OUT);                              /* Port 1 Output */
224
SFR_8BIT(P1DIR);                              /* Port 1 Direction */
225
SFR_8BIT(P1IFG);                              /* Port 1 Interrupt Flag */
226
SFR_8BIT(P1IES);                              /* Port 1 Interrupt Edge Select */
227
SFR_8BIT(P1IE);                               /* Port 1 Interrupt Enable */
228
SFR_8BIT(P1SEL);                              /* Port 1 Selection */
229
 
230
SFR_8BIT(P2IN);                               /* Port 2 Input */
231
SFR_8BIT(P2OUT);                              /* Port 2 Output */
232
SFR_8BIT(P2DIR);                              /* Port 2 Direction */
233
SFR_8BIT(P2IFG);                              /* Port 2 Interrupt Flag */
234
SFR_8BIT(P2IES);                              /* Port 2 Interrupt Edge Select */
235
SFR_8BIT(P2IE);                               /* Port 2 Interrupt Enable */
236
SFR_8BIT(P2SEL);                              /* Port 2 Selection */
237
 
238
/************************************************************
239
* DIGITAL I/O Port3/4
240
************************************************************/
241
#define __MSP430_HAS_PORT3__                  /* Definition to show that Module is available */
242
#define __MSP430_HAS_PORT4__                  /* Definition to show that Module is available */
243
 
244
SFR_8BIT(P3IN);                               /* Port 3 Input */
245
SFR_8BIT(P3OUT);                              /* Port 3 Output */
246
SFR_8BIT(P3DIR);                              /* Port 3 Direction */
247
SFR_8BIT(P3SEL);                              /* Port 3 Selection */
248
 
249
SFR_8BIT(P4IN);                               /* Port 4 Input */
250
SFR_8BIT(P4OUT);                              /* Port 4 Output */
251
SFR_8BIT(P4DIR);                              /* Port 4 Direction */
252
SFR_8BIT(P4SEL);                              /* Port 4 Selection */
253
 
254
/************************************************************
255
* DIGITAL I/O Port5/6
256
************************************************************/
257
#define __MSP430_HAS_PORT5__                  /* Definition to show that Module is available */
258
#define __MSP430_HAS_PORT6__                  /* Definition to show that Module is available */
259
 
260
SFR_8BIT(P5IN);                               /* Port 5 Input */
261
SFR_8BIT(P5OUT);                              /* Port 5 Output */
262
SFR_8BIT(P5DIR);                              /* Port 5 Direction */
263
SFR_8BIT(P5SEL);                              /* Port 5 Selection */
264
 
265
SFR_8BIT(P6IN);                               /* Port 6 Input */
266
SFR_8BIT(P6OUT);                              /* Port 6 Output */
267
SFR_8BIT(P6DIR);                              /* Port 6 Direction */
268
SFR_8BIT(P6SEL);                              /* Port 6 Selection */
269
 
270
/************************************************************
271
* USART
272
************************************************************/
273
 
274
/* UxCTL */
275
#define PENA                   (0x80)         /* Parity enable */
276
#define PEV                    (0x40)         /* Parity 0:odd / 1:even */
277
#define SPB                    (0x20)         /* Stop Bits 0:one / 1: two */
278
#define CHAR                   (0x10)         /* Data 0:7-bits / 1:8-bits */
279
#define LISTEN                 (0x08)         /* Listen mode */
280
#define SYNC                   (0x04)         /* UART / SPI mode */
281
#define MM                     (0x02)         /* Master Mode off/on */
282
#define SWRST                  (0x01)         /* USART Software Reset */
283
 
284
/* UxTCTL */
285
#define CKPH                   (0x80)         /* SPI: Clock Phase */
286
#define CKPL                   (0x40)         /* Clock Polarity */
287
#define SSEL1                  (0x20)         /* Clock Source Select 1 */
288
#define SSEL0                  (0x10)         /* Clock Source Select 0 */
289
#define URXSE                  (0x08)         /* Receive Start edge select */
290
#define TXWAKE                 (0x04)         /* TX Wake up mode */
291
#define STC                    (0x02)         /* SPI: STC enable 0:on / 1:off */
292
#define TXEPT                  (0x01)         /* TX Buffer empty */
293
 
294
/* UxRCTL */
295
#define FE                     (0x80)         /* Frame Error */
296
#define PE                     (0x40)         /* Parity Error */
297
#define OE                     (0x20)         /* Overrun Error */
298
#define BRK                    (0x10)         /* Break detected */
299
#define URXEIE                 (0x08)         /* RX Error interrupt enable */
300
#define URXWIE                 (0x04)         /* RX Wake up interrupt enable */
301
#define RXWAKE                 (0x02)         /* RX Wake up detect */
302
#define RXERR                  (0x01)         /* RX Error Error */
303
 
304
/************************************************************
305
* USART 0
306
************************************************************/
307
#define __MSP430_HAS_UART0__                  /* Definition to show that Module is available */
308
 
309
SFR_8BIT(U0CTL);                              /* USART 0 Control */
310
SFR_8BIT(U0TCTL);                             /* USART 0 Transmit Control */
311
SFR_8BIT(U0RCTL);                             /* USART 0 Receive Control */
312
SFR_8BIT(U0MCTL);                             /* USART 0 Modulation Control */
313
SFR_8BIT(U0BR0);                              /* USART 0 Baud Rate 0 */
314
SFR_8BIT(U0BR1);                              /* USART 0 Baud Rate 1 */
315
SFR_8BIT(U0RXBUF);                            /* USART 0 Receive Buffer */
316
SFR_8BIT(U0TXBUF);                            /* USART 0 Transmit Buffer */
317
 
318
/* Alternate register names */
319
 
320
#define UCTL0                  U0CTL          /* USART 0 Control */
321
#define UTCTL0                 U0TCTL         /* USART 0 Transmit Control */
322
#define URCTL0                 U0RCTL         /* USART 0 Receive Control */
323
#define UMCTL0                 U0MCTL         /* USART 0 Modulation Control */
324
#define UBR00                  U0BR0          /* USART 0 Baud Rate 0 */
325
#define UBR10                  U0BR1          /* USART 0 Baud Rate 1 */
326
#define RXBUF0                 U0RXBUF        /* USART 0 Receive Buffer */
327
#define TXBUF0                 U0TXBUF        /* USART 0 Transmit Buffer */
328
#define UCTL0_                 U0CTL_         /* USART 0 Control */
329
#define UTCTL0_                U0TCTL_        /* USART 0 Transmit Control */
330
#define URCTL0_                U0RCTL_        /* USART 0 Receive Control */
331
#define UMCTL0_                U0MCTL_        /* USART 0 Modulation Control */
332
#define UBR00_                 U0BR0_         /* USART 0 Baud Rate 0 */
333
#define UBR10_                 U0BR1_         /* USART 0 Baud Rate 1 */
334
#define RXBUF0_                U0RXBUF_       /* USART 0 Receive Buffer */
335
#define TXBUF0_                U0TXBUF_       /* USART 0 Transmit Buffer */
336
#define UCTL_0                 U0CTL          /* USART 0 Control */
337
#define UTCTL_0                U0TCTL         /* USART 0 Transmit Control */
338
#define URCTL_0                U0RCTL         /* USART 0 Receive Control */
339
#define UMCTL_0                U0MCTL         /* USART 0 Modulation Control */
340
#define UBR0_0                 U0BR0          /* USART 0 Baud Rate 0 */
341
#define UBR1_0                 U0BR1          /* USART 0 Baud Rate 1 */
342
#define RXBUF_0                U0RXBUF        /* USART 0 Receive Buffer */
343
#define TXBUF_0                U0TXBUF        /* USART 0 Transmit Buffer */
344
#define UCTL_0_                U0CTL_         /* USART 0 Control */
345
#define UTCTL_0_               U0TCTL_        /* USART 0 Transmit Control */
346
#define URCTL_0_               U0RCTL_        /* USART 0 Receive Control */
347
#define UMCTL_0_               U0MCTL_        /* USART 0 Modulation Control */
348
#define UBR0_0_                U0BR0_         /* USART 0 Baud Rate 0 */
349
#define UBR1_0_                U0BR1_         /* USART 0 Baud Rate 1 */
350
#define RXBUF_0_               U0RXBUF_       /* USART 0 Receive Buffer */
351
#define TXBUF_0_               U0TXBUF_       /* USART 0 Transmit Buffer */
352
 
353
/************************************************************
354
* USART 1
355
************************************************************/
356
#define __MSP430_HAS_UART1__                  /* Definition to show that Module is available */
357
 
358
SFR_8BIT(U1CTL);                              /* USART 1 Control */
359
SFR_8BIT(U1TCTL);                             /* USART 1 Transmit Control */
360
SFR_8BIT(U1RCTL);                             /* USART 1 Receive Control */
361
SFR_8BIT(U1MCTL);                             /* USART 1 Modulation Control */
362
SFR_8BIT(U1BR0);                              /* USART 1 Baud Rate 0 */
363
SFR_8BIT(U1BR1);                              /* USART 1 Baud Rate 1 */
364
SFR_8BIT(U1RXBUF);                            /* USART 1 Receive Buffer */
365
SFR_8BIT(U1TXBUF);                            /* USART 1 Transmit Buffer */
366
 
367
/* Alternate register names */
368
 
369
#define UCTL1                  U1CTL          /* USART 1 Control */
370
#define UTCTL1                 U1TCTL         /* USART 1 Transmit Control */
371
#define URCTL1                 U1RCTL         /* USART 1 Receive Control */
372
#define UMCTL1                 U1MCTL         /* USART 1 Modulation Control */
373
#define UBR01                  U1BR0          /* USART 1 Baud Rate 0 */
374
#define UBR11                  U1BR1          /* USART 1 Baud Rate 1 */
375
#define RXBUF1                 U1RXBUF        /* USART 1 Receive Buffer */
376
#define TXBUF1                 U1TXBUF        /* USART 1 Transmit Buffer */
377
#define UCTL1_                 U1CTL_         /* USART 1 Control */
378
#define UTCTL1_                U1TCTL_        /* USART 1 Transmit Control */
379
#define URCTL1_                U1RCTL_        /* USART 1 Receive Control */
380
#define UMCTL1_                U1MCTL_        /* USART 1 Modulation Control */
381
#define UBR01_                 U1BR0_         /* USART 1 Baud Rate 0 */
382
#define UBR11_                 U1BR1_         /* USART 1 Baud Rate 1 */
383
#define RXBUF1_                U1RXBUF_       /* USART 1 Receive Buffer */
384
#define TXBUF1_                U1TXBUF_       /* USART 1 Transmit Buffer */
385
#define UCTL_1                 U1CTL          /* USART 1 Control */
386
#define UTCTL_1                U1TCTL         /* USART 1 Transmit Control */
387
#define URCTL_1                U1RCTL         /* USART 1 Receive Control */
388
#define UMCTL_1                U1MCTL         /* USART 1 Modulation Control */
389
#define UBR0_1                 U1BR0          /* USART 1 Baud Rate 0 */
390
#define UBR1_1                 U1BR1          /* USART 1 Baud Rate 1 */
391
#define RXBUF_1                U1RXBUF        /* USART 1 Receive Buffer */
392
#define TXBUF_1                U1TXBUF        /* USART 1 Transmit Buffer */
393
#define UCTL_1_                U1CTL_         /* USART 1 Control */
394
#define UTCTL_1_               U1TCTL_        /* USART 1 Transmit Control */
395
#define URCTL_1_               U1RCTL_        /* USART 1 Receive Control */
396
#define UMCTL_1_               U1MCTL_        /* USART 1 Modulation Control */
397
#define UBR0_1_                U1BR0_         /* USART 1 Baud Rate 0 */
398
#define UBR1_1_                U1BR1_         /* USART 1 Baud Rate 1 */
399
#define RXBUF_1_               U1RXBUF_       /* USART 1 Receive Buffer */
400
#define TXBUF_1_               U1TXBUF_       /* USART 1 Transmit Buffer */
401
 
402
/************************************************************
403
* Timer A3
404
************************************************************/
405
#define __MSP430_HAS_TA3__                    /* Definition to show that Module is available */
406
 
407
SFR_16BIT(TAIV);                              /* Timer A Interrupt Vector Word */
408
SFR_16BIT(TACTL);                             /* Timer A Control */
409
SFR_16BIT(TACCTL0);                           /* Timer A Capture/Compare Control 0 */
410
SFR_16BIT(TACCTL1);                           /* Timer A Capture/Compare Control 1 */
411
SFR_16BIT(TACCTL2);                           /* Timer A Capture/Compare Control 2 */
412
SFR_16BIT(TAR);                               /* Timer A Counter Register */
413
SFR_16BIT(TACCR0);                            /* Timer A Capture/Compare 0 */
414
SFR_16BIT(TACCR1);                            /* Timer A Capture/Compare 1 */
415
SFR_16BIT(TACCR2);                            /* Timer A Capture/Compare 2 */
416
 
417
/* Alternate register names */
418
#define CCTL0                  TACCTL0        /* Timer A Capture/Compare Control 0 */
419
#define CCTL1                  TACCTL1        /* Timer A Capture/Compare Control 1 */
420
#define CCTL2                  TACCTL2        /* Timer A Capture/Compare Control 2 */
421
#define CCR0                   TACCR0         /* Timer A Capture/Compare 0 */
422
#define CCR1                   TACCR1         /* Timer A Capture/Compare 1 */
423
#define CCR2                   TACCR2         /* Timer A Capture/Compare 2 */
424
#define CCTL0_                 TACCTL0_       /* Timer A Capture/Compare Control 0 */
425
#define CCTL1_                 TACCTL1_       /* Timer A Capture/Compare Control 1 */
426
#define CCTL2_                 TACCTL2_       /* Timer A Capture/Compare Control 2 */
427
#define CCR0_                  TACCR0_        /* Timer A Capture/Compare 0 */
428
#define CCR1_                  TACCR1_        /* Timer A Capture/Compare 1 */
429
#define CCR2_                  TACCR2_        /* Timer A Capture/Compare 2 */
430
/* Alternate register names - 5xx style */
431
#define TA0IV                  TAIV           /* Timer A Interrupt Vector Word */
432
#define TA0CTL                 TACTL          /* Timer A Control */
433
#define TA0CCTL0               TACCTL0        /* Timer A Capture/Compare Control 0 */
434
#define TA0CCTL1               TACCTL1        /* Timer A Capture/Compare Control 1 */
435
#define TA0CCTL2               TACCTL2        /* Timer A Capture/Compare Control 2 */
436
#define TA0R                   TAR            /* Timer A Counter Register */
437
#define TA0CCR0                TACCR0         /* Timer A Capture/Compare 0 */
438
#define TA0CCR1                TACCR1         /* Timer A Capture/Compare 1 */
439
#define TA0CCR2                TACCR2         /* Timer A Capture/Compare 2 */
440
#define TA0IV_                 TAIV_          /* Timer A Interrupt Vector Word */
441
#define TA0CTL_                TACTL_         /* Timer A Control */
442
#define TA0CCTL0_              TACCTL0_       /* Timer A Capture/Compare Control 0 */
443
#define TA0CCTL1_              TACCTL1_       /* Timer A Capture/Compare Control 1 */
444
#define TA0CCTL2_              TACCTL2_       /* Timer A Capture/Compare Control 2 */
445
#define TA0R_                  TAR_           /* Timer A Counter Register */
446
#define TA0CCR0_               TACCR0_        /* Timer A Capture/Compare 0 */
447
#define TA0CCR1_               TACCR1_        /* Timer A Capture/Compare 1 */
448
#define TA0CCR2_               TACCR2_        /* Timer A Capture/Compare 2 */
449
 
450
#define TASSEL1                (0x0200)       /* Timer A clock source select 0 */
451
#define TASSEL0                (0x0100)       /* Timer A clock source select 1 */
452
#define ID1                    (0x0080)       /* Timer A clock input divider 1 */
453
#define ID0                    (0x0040)       /* Timer A clock input divider 0 */
454
#define MC1                    (0x0020)       /* Timer A mode control 1 */
455
#define MC0                    (0x0010)       /* Timer A mode control 0 */
456
#define TACLR                  (0x0004)       /* Timer A counter clear */
457
#define TAIE                   (0x0002)       /* Timer A counter interrupt enable */
458
#define TAIFG                  (0x0001)       /* Timer A counter interrupt flag */
459
 
460
#define MC_0                   (0*0x10u)      /* Timer A mode control: 0 - Stop */
461
#define MC_1                   (1*0x10u)      /* Timer A mode control: 1 - Up to CCR0 */
462
#define MC_2                   (2*0x10u)      /* Timer A mode control: 2 - Continous up */
463
#define MC_3                   (3*0x10u)      /* Timer A mode control: 3 - Up/Down */
464
#define ID_0                   (0*0x40u)      /* Timer A input divider: 0 - /1 */
465
#define ID_1                   (1*0x40u)      /* Timer A input divider: 1 - /2 */
466
#define ID_2                   (2*0x40u)      /* Timer A input divider: 2 - /4 */
467
#define ID_3                   (3*0x40u)      /* Timer A input divider: 3 - /8 */
468
#define TASSEL_0               (0*0x100u)     /* Timer A clock source select: 0 - TACLK */
469
#define TASSEL_1               (1*0x100u)     /* Timer A clock source select: 1 - ACLK  */
470
#define TASSEL_2               (2*0x100u)     /* Timer A clock source select: 2 - SMCLK */
471
#define TASSEL_3               (3*0x100u)     /* Timer A clock source select: 3 - INCLK */
472
 
473
#define CM1                    (0x8000)       /* Capture mode 1 */
474
#define CM0                    (0x4000)       /* Capture mode 0 */
475
#define CCIS1                  (0x2000)       /* Capture input select 1 */
476
#define CCIS0                  (0x1000)       /* Capture input select 0 */
477
#define SCS                    (0x0800)       /* Capture sychronize */
478
#define SCCI                   (0x0400)       /* Latched capture signal (read) */
479
#define CAP                    (0x0100)       /* Capture mode: 1 /Compare mode : 0 */
480
#define OUTMOD2                (0x0080)       /* Output mode 2 */
481
#define OUTMOD1                (0x0040)       /* Output mode 1 */
482
#define OUTMOD0                (0x0020)       /* Output mode 0 */
483
#define CCIE                   (0x0010)       /* Capture/compare interrupt enable */
484
#define CCI                    (0x0008)       /* Capture input signal (read) */
485
#define OUT                    (0x0004)       /* PWM Output signal if output mode 0 */
486
#define COV                    (0x0002)       /* Capture/compare overflow flag */
487
#define CCIFG                  (0x0001)       /* Capture/compare interrupt flag */
488
 
489
#define OUTMOD_0               (0*0x20u)      /* PWM output mode: 0 - output only */
490
#define OUTMOD_1               (1*0x20u)      /* PWM output mode: 1 - set */
491
#define OUTMOD_2               (2*0x20u)      /* PWM output mode: 2 - PWM toggle/reset */
492
#define OUTMOD_3               (3*0x20u)      /* PWM output mode: 3 - PWM set/reset */
493
#define OUTMOD_4               (4*0x20u)      /* PWM output mode: 4 - toggle */
494
#define OUTMOD_5               (5*0x20u)      /* PWM output mode: 5 - Reset */
495
#define OUTMOD_6               (6*0x20u)      /* PWM output mode: 6 - PWM toggle/set */
496
#define OUTMOD_7               (7*0x20u)      /* PWM output mode: 7 - PWM reset/set */
497
#define CCIS_0                 (0*0x1000u)    /* Capture input select: 0 - CCIxA */
498
#define CCIS_1                 (1*0x1000u)    /* Capture input select: 1 - CCIxB */
499
#define CCIS_2                 (2*0x1000u)    /* Capture input select: 2 - GND */
500
#define CCIS_3                 (3*0x1000u)    /* Capture input select: 3 - Vcc */
501
#define CM_0                   (0*0x4000u)    /* Capture mode: 0 - disabled */
502
#define CM_1                   (1*0x4000u)    /* Capture mode: 1 - pos. edge */
503
#define CM_2                   (2*0x4000u)    /* Capture mode: 1 - neg. edge */
504
#define CM_3                   (3*0x4000u)    /* Capture mode: 1 - both edges */
505
 
506
/* TA3IV Definitions */
507
#define TAIV_NONE              (0x0000)       /* No Interrupt pending */
508
#define TAIV_TACCR1            (0x0002)       /* TACCR1_CCIFG */
509
#define TAIV_TACCR2            (0x0004)       /* TACCR2_CCIFG */
510
#define TAIV_6                 (0x0006)       /* Reserved */
511
#define TAIV_8                 (0x0008)       /* Reserved */
512
#define TAIV_TAIFG             (0x000A)       /* TAIFG */
513
 
514
/************************************************************
515
* Timer B7
516
************************************************************/
517
#define __MSP430_HAS_TB7__                    /* Definition to show that Module is available */
518
 
519
SFR_16BIT(TBIV);                              /* Timer B Interrupt Vector Word */
520
SFR_16BIT(TBCTL);                             /* Timer B Control */
521
SFR_16BIT(TBCCTL0);                           /* Timer B Capture/Compare Control 0 */
522
SFR_16BIT(TBCCTL1);                           /* Timer B Capture/Compare Control 1 */
523
SFR_16BIT(TBCCTL2);                           /* Timer B Capture/Compare Control 2 */
524
SFR_16BIT(TBCCTL3);                           /* Timer B Capture/Compare Control 3 */
525
SFR_16BIT(TBCCTL4);                           /* Timer B Capture/Compare Control 4 */
526
SFR_16BIT(TBCCTL5);                           /* Timer B Capture/Compare Control 5 */
527
SFR_16BIT(TBCCTL6);                           /* Timer B Capture/Compare Control 6 */
528
SFR_16BIT(TBR);                               /* Timer B Counter Register */
529
SFR_16BIT(TBCCR0);                            /* Timer B Capture/Compare 0 */
530
SFR_16BIT(TBCCR1);                            /* Timer B Capture/Compare 1 */
531
SFR_16BIT(TBCCR2);                            /* Timer B Capture/Compare 2 */
532
SFR_16BIT(TBCCR3);                            /* Timer B Capture/Compare 3 */
533
SFR_16BIT(TBCCR4);                            /* Timer B Capture/Compare 4 */
534
SFR_16BIT(TBCCR5);                            /* Timer B Capture/Compare 5 */
535
SFR_16BIT(TBCCR6);                            /* Timer B Capture/Compare 6 */
536
 
537
/* Alternate register names - 5xx style */
538
#define TB0IV                  TBIV           /* Timer B Interrupt Vector Word */
539
#define TB0CTL                 TBCTL          /* Timer B Control */
540
#define TB0CCTL0               TBCCTL0        /* Timer B Capture/Compare Control 0 */
541
#define TB0CCTL1               TBCCTL1        /* Timer B Capture/Compare Control 1 */
542
#define TB0CCTL2               TBCCTL2        /* Timer B Capture/Compare Control 2 */
543
#define TB0CCTL3               TBCCTL3        /* Timer B Capture/Compare Control 3 */
544
#define TB0CCTL4               TBCCTL4        /* Timer B Capture/Compare Control 4 */
545
#define TB0CCTL5               TBCCTL5        /* Timer B Capture/Compare Control 5 */
546
#define TB0CCTL6               TBCCTL6        /* Timer B Capture/Compare Control 6 */
547
#define TB0R                   TBR            /* Timer B Counter Register */
548
#define TB0CCR0                TBCCR0         /* Timer B Capture/Compare 0 */
549
#define TB0CCR1                TBCCR1         /* Timer B Capture/Compare 1 */
550
#define TB0CCR2                TBCCR2         /* Timer B Capture/Compare 2 */
551
#define TB0CCR3                TBCCR3         /* Timer B Capture/Compare 3 */
552
#define TB0CCR4                TBCCR4         /* Timer B Capture/Compare 4 */
553
#define TB0CCR5                TBCCR5         /* Timer B Capture/Compare 5 */
554
#define TB0CCR6                TBCCR6         /* Timer B Capture/Compare 6 */
555
#define TB0IV_                 TBIV_          /* Timer B Interrupt Vector Word */
556
#define TB0CTL_                TBCTL_         /* Timer B Control */
557
#define TB0CCTL0_              TBCCTL0_       /* Timer B Capture/Compare Control 0 */
558
#define TB0CCTL1_              TBCCTL1_       /* Timer B Capture/Compare Control 1 */
559
#define TB0CCTL2_              TBCCTL2_       /* Timer B Capture/Compare Control 2 */
560
#define TB0CCTL3_              TBCCTL3_       /* Timer B Capture/Compare Control 3 */
561
#define TB0CCTL4_              TBCCTL4_       /* Timer B Capture/Compare Control 4 */
562
#define TB0CCTL5_              TBCCTL5_       /* Timer B Capture/Compare Control 5 */
563
#define TB0CCTL6_              TBCCTL6_       /* Timer B Capture/Compare Control 6 */
564
#define TB0R_                  TBR_           /* Timer B Counter Register */
565
#define TB0CCR0_               TBCCR0_        /* Timer B Capture/Compare 0 */
566
#define TB0CCR1_               TBCCR1_        /* Timer B Capture/Compare 1 */
567
#define TB0CCR2_               TBCCR2_        /* Timer B Capture/Compare 2 */
568
#define TB0CCR3_               TBCCR3_        /* Timer B Capture/Compare 3 */
569
#define TB0CCR4_               TBCCR4_        /* Timer B Capture/Compare 4 */
570
#define TB0CCR5_               TBCCR5_        /* Timer B Capture/Compare 5 */
571
#define TB0CCR6_               TBCCR6_        /* Timer B Capture/Compare 6 */
572
 
573
#define TBCLGRP1               (0x4000)       /* Timer B Compare latch load group 1 */
574
#define TBCLGRP0               (0x2000)       /* Timer B Compare latch load group 0 */
575
#define CNTL1                  (0x1000)       /* Counter lenght 1 */
576
#define CNTL0                  (0x0800)       /* Counter lenght 0 */
577
#define TBSSEL1                (0x0200)       /* Clock source 1 */
578
#define TBSSEL0                (0x0100)       /* Clock source 0 */
579
#define TBCLR                  (0x0004)       /* Timer B counter clear */
580
#define TBIE                   (0x0002)       /* Timer B interrupt enable */
581
#define TBIFG                  (0x0001)       /* Timer B interrupt flag */
582
 
583
#define SHR1                   (0x4000)       /* Timer B Compare latch load group 1 */
584
#define SHR0                   (0x2000)       /* Timer B Compare latch load group 0 */
585
 
586
#define TBSSEL_0               (0*0x0100u)    /* Clock Source: TBCLK */
587
#define TBSSEL_1               (1*0x0100u)    /* Clock Source: ACLK  */
588
#define TBSSEL_2               (2*0x0100u)    /* Clock Source: SMCLK */
589
#define TBSSEL_3               (3*0x0100u)    /* Clock Source: INCLK */
590
#define CNTL_0                 (0*0x0800u)    /* Counter lenght: 16 bit */
591
#define CNTL_1                 (1*0x0800u)    /* Counter lenght: 12 bit */
592
#define CNTL_2                 (2*0x0800u)    /* Counter lenght: 10 bit */
593
#define CNTL_3                 (3*0x0800u)    /* Counter lenght:  8 bit */
594
#define SHR_0                  (0*0x2000u)    /* Timer B Group: 0 - individually */
595
#define SHR_1                  (1*0x2000u)    /* Timer B Group: 1 - 3 groups (1-2, 3-4, 5-6) */
596
#define SHR_2                  (2*0x2000u)    /* Timer B Group: 2 - 2 groups (1-3, 4-6)*/
597
#define SHR_3                  (3*0x2000u)    /* Timer B Group: 3 - 1 group (all) */
598
#define TBCLGRP_0              (0*0x2000u)    /* Timer B Group: 0 - individually */
599
#define TBCLGRP_1              (1*0x2000u)    /* Timer B Group: 1 - 3 groups (1-2, 3-4, 5-6) */
600
#define TBCLGRP_2              (2*0x2000u)    /* Timer B Group: 2 - 2 groups (1-3, 4-6)*/
601
#define TBCLGRP_3              (3*0x2000u)    /* Timer B Group: 3 - 1 group (all) */
602
 
603
/* Additional Timer B Control Register bits are defined in Timer A */
604
#define CLLD1                  (0x0400)       /* Compare latch load source 1 */
605
#define CLLD0                  (0x0200)       /* Compare latch load source 0 */
606
 
607
#define SLSHR1                 (0x0400)       /* Compare latch load source 1 */
608
#define SLSHR0                 (0x0200)       /* Compare latch load source 0 */
609
 
610
#define SLSHR_0                (0*0x0200u)    /* Compare latch load sourec : 0 - immediate */
611
#define SLSHR_1                (1*0x0200u)    /* Compare latch load sourec : 1 - TBR counts to 0 */
612
#define SLSHR_2                (2*0x0200u)    /* Compare latch load sourec : 2 - up/down */
613
#define SLSHR_3                (3*0x0200u)    /* Compare latch load sourec : 3 - TBR counts to TBCTL0 */
614
 
615
#define CLLD_0                 (0*0x0200u)    /* Compare latch load sourec : 0 - immediate */
616
#define CLLD_1                 (1*0x0200u)    /* Compare latch load sourec : 1 - TBR counts to 0 */
617
#define CLLD_2                 (2*0x0200u)    /* Compare latch load sourec : 2 - up/down */
618
#define CLLD_3                 (3*0x0200u)    /* Compare latch load sourec : 3 - TBR counts to TBCTL0 */
619
 
620
/* TB7IV Definitions */
621
#define TBIV_NONE              (0x0000)       /* No Interrupt pending */
622
#define TBIV_TBCCR1            (0x0002)       /* TBCCR1_CCIFG */
623
#define TBIV_TBCCR2            (0x0004)       /* TBCCR2_CCIFG */
624
#define TBIV_TBCCR3            (0x0006)       /* TBCCR3_CCIFG */
625
#define TBIV_TBCCR4            (0x0008)       /* TBCCR4_CCIFG */
626
#define TBIV_TBCCR5            (0x000A)       /* TBCCR3_CCIFG */
627
#define TBIV_TBCCR6            (0x000C)       /* TBCCR4_CCIFG */
628
#define TBIV_TBIFG             (0x000E)       /* TBIFG */
629
 
630
/************************************************************
631
* Basic Clock Module
632
************************************************************/
633
#define __MSP430_HAS_BASIC_CLOCK__                /* Definition to show that Module is available */
634
 
635
SFR_8BIT(DCOCTL);                             /* DCO Clock Frequency Control */
636
SFR_8BIT(BCSCTL1);                            /* Basic Clock System Control 1 */
637
SFR_8BIT(BCSCTL2);                            /* Basic Clock System Control 2 */
638
 
639
#define MOD0                   (0x01)         /* Modulation Bit 0 */
640
#define MOD1                   (0x02)         /* Modulation Bit 1 */
641
#define MOD2                   (0x04)         /* Modulation Bit 2 */
642
#define MOD3                   (0x08)         /* Modulation Bit 3 */
643
#define MOD4                   (0x10)         /* Modulation Bit 4 */
644
#define DCO0                   (0x20)         /* DCO Select Bit 0 */
645
#define DCO1                   (0x40)         /* DCO Select Bit 1 */
646
#define DCO2                   (0x80)         /* DCO Select Bit 2 */
647
 
648
#define RSEL0                  (0x01)         /* Range Select Bit 0 */
649
#define RSEL1                  (0x02)         /* Range Select Bit 1 */
650
#define RSEL2                  (0x04)         /* Range Select Bit 2 */
651
#define XT5V                   (0x08)         /* XT5V should always be reset */
652
#define DIVA0                  (0x10)         /* ACLK Divider 0 */
653
#define DIVA1                  (0x20)         /* ACLK Divider 1 */
654
#define XTS                    (0x40)         /* LFXTCLK 0:Low Freq. / 1: High Freq. */
655
#define XT2OFF                 (0x80)         /* Enable XT2CLK */
656
 
657
#define DIVA_0                 (0x00)         /* ACLK Divider 0: /1 */
658
#define DIVA_1                 (0x10)         /* ACLK Divider 1: /2 */
659
#define DIVA_2                 (0x20)         /* ACLK Divider 2: /4 */
660
#define DIVA_3                 (0x30)         /* ACLK Divider 3: /8 */
661
 
662
#define DCOR                   (0x01)         /* Enable External Resistor : 1 */
663
#define DIVS0                  (0x02)         /* SMCLK Divider 0 */
664
#define DIVS1                  (0x04)         /* SMCLK Divider 1 */
665
#define SELS                   (0x08)         /* SMCLK Source Select 0:DCOCLK / 1:XT2CLK/LFXTCLK */
666
#define DIVM0                  (0x10)         /* MCLK Divider 0 */
667
#define DIVM1                  (0x20)         /* MCLK Divider 1 */
668
#define SELM0                  (0x40)         /* MCLK Source Select 0 */
669
#define SELM1                  (0x80)         /* MCLK Source Select 1 */
670
 
671
#define DIVS_0                 (0x00)         /* SMCLK Divider 0: /1 */
672
#define DIVS_1                 (0x02)         /* SMCLK Divider 1: /2 */
673
#define DIVS_2                 (0x04)         /* SMCLK Divider 2: /4 */
674
#define DIVS_3                 (0x06)         /* SMCLK Divider 3: /8 */
675
 
676
#define DIVM_0                 (0x00)         /* MCLK Divider 0: /1 */
677
#define DIVM_1                 (0x10)         /* MCLK Divider 1: /2 */
678
#define DIVM_2                 (0x20)         /* MCLK Divider 2: /4 */
679
#define DIVM_3                 (0x30)         /* MCLK Divider 3: /8 */
680
 
681
#define SELM_0                 (0x00)         /* MCLK Source Select 0: DCOCLK */
682
#define SELM_1                 (0x40)         /* MCLK Source Select 1: DCOCLK */
683
#define SELM_2                 (0x80)         /* MCLK Source Select 2: XT2CLK/LFXTCLK */
684
#define SELM_3                 (0xC0)         /* MCLK Source Select 3: LFXTCLK */
685
 
686
/*************************************************************
687
* Flash Memory
688
*************************************************************/
689
#define __MSP430_HAS_FLASH__                  /* Definition to show that Module is available */
690
 
691
SFR_16BIT(FCTL1);                             /* FLASH Control 1 */
692
SFR_16BIT(FCTL2);                             /* FLASH Control 2 */
693
SFR_16BIT(FCTL3);                             /* FLASH Control 3 */
694
 
695
#define FRKEY                  (0x9600)       /* Flash key returned by read */
696
#define FWKEY                  (0xA500)       /* Flash key for write */
697
#define FXKEY                  (0x3300)       /* for use with XOR instruction */
698
 
699
#define ERASE                  (0x0002)       /* Enable bit for Flash segment erase */
700
#define MERAS                  (0x0004)       /* Enable bit for Flash mass erase */
701
#define WRT                    (0x0040)       /* Enable bit for Flash write */
702
#define BLKWRT                 (0x0080)       /* Enable bit for Flash segment write */
703
#define SEGWRT                 (0x0080)       /* old definition */ /* Enable bit for Flash segment write */
704
 
705
#define FN0                    (0x0001)       /* Divide Flash clock by 1 to 64 using FN0 to FN5 according to: */
706
#define FN1                    (0x0002)       /*  32*FN5 + 16*FN4 + 8*FN3 + 4*FN2 + 2*FN1 + FN0 + 1 */
707
#ifndef FN2
708
#define FN2                    (0x0004)
709
#endif
710
#ifndef FN3
711
#define FN3                    (0x0008)
712
#endif
713
#ifndef FN4
714
#define FN4                    (0x0010)
715
#endif
716
#define FN5                    (0x0020)
717
#define FSSEL0                 (0x0040)       /* Flash clock select 0 */        /* to distinguish from USART SSELx */
718
#define FSSEL1                 (0x0080)       /* Flash clock select 1 */
719
 
720
#define FSSEL_0                (0x0000)       /* Flash clock select: 0 - ACLK */
721
#define FSSEL_1                (0x0040)       /* Flash clock select: 1 - MCLK */
722
#define FSSEL_2                (0x0080)       /* Flash clock select: 2 - SMCLK */
723
#define FSSEL_3                (0x00C0)       /* Flash clock select: 3 - SMCLK */
724
 
725
#define BUSY                   (0x0001)       /* Flash busy: 1 */
726
#define KEYV                   (0x0002)       /* Flash Key violation flag */
727
#define ACCVIFG                (0x0004)       /* Flash Access violation flag */
728
#define WAIT                   (0x0008)       /* Wait flag for segment write */
729
#define LOCK                   (0x0010)       /* Lock bit: 1 - Flash is locked (read only) */
730
#define EMEX                   (0x0020)       /* Flash Emergency Exit */
731
 
732
/************************************************************
733
* Comparator A
734
************************************************************/
735
#define __MSP430_HAS_COMPA__                  /* Definition to show that Module is available */
736
 
737
SFR_8BIT(CACTL1);                             /* Comparator A Control 1 */
738
SFR_8BIT(CACTL2);                             /* Comparator A Control 2 */
739
SFR_8BIT(CAPD);                               /* Comparator A Port Disable */
740
 
741
#define CAIFG                  (0x01)         /* Comp. A Interrupt Flag */
742
#define CAIE                   (0x02)         /* Comp. A Interrupt Enable */
743
#define CAIES                  (0x04)         /* Comp. A Int. Edge Select: 0:rising / 1:falling */
744
#define CAON                   (0x08)         /* Comp. A enable */
745
#define CAREF0                 (0x10)         /* Comp. A Internal Reference Select 0 */
746
#define CAREF1                 (0x20)         /* Comp. A Internal Reference Select 1 */
747
#define CARSEL                 (0x40)         /* Comp. A Internal Reference Enable */
748
#define CAEX                   (0x80)         /* Comp. A Exchange Inputs */
749
 
750
#define CAREF_0                (0x00)         /* Comp. A Int. Ref. Select 0 : Off */
751
#define CAREF_1                (0x10)         /* Comp. A Int. Ref. Select 1 : 0.25*Vcc */
752
#define CAREF_2                (0x20)         /* Comp. A Int. Ref. Select 2 : 0.5*Vcc */
753
#define CAREF_3                (0x30)         /* Comp. A Int. Ref. Select 3 : Vt*/
754
 
755
#define CAOUT                  (0x01)         /* Comp. A Output */
756
#define CAF                    (0x02)         /* Comp. A Enable Output Filter */
757
#define P2CA0                  (0x04)         /* Comp. A Connect External Signal to CA0 : 1 */
758
#define P2CA1                  (0x08)         /* Comp. A Connect External Signal to CA1 : 1 */
759
#define CACTL24                (0x10)
760
#define CACTL25                (0x20)
761
#define CACTL26                (0x40)
762
#define CACTL27                (0x80)
763
 
764
#define CAPD0                  (0x01)         /* Comp. A Disable Input Buffer of Port Register .0 */
765
#define CAPD1                  (0x02)         /* Comp. A Disable Input Buffer of Port Register .1 */
766
#define CAPD2                  (0x04)         /* Comp. A Disable Input Buffer of Port Register .2 */
767
#define CAPD3                  (0x08)         /* Comp. A Disable Input Buffer of Port Register .3 */
768
#define CAPD4                  (0x10)         /* Comp. A Disable Input Buffer of Port Register .4 */
769
#define CAPD5                  (0x20)         /* Comp. A Disable Input Buffer of Port Register .5 */
770
#define CAPD6                  (0x40)         /* Comp. A Disable Input Buffer of Port Register .6 */
771
#define CAPD7                  (0x80)         /* Comp. A Disable Input Buffer of Port Register .7 */
772
 
773
/************************************************************
774
* Interrupt Vectors (offset from 0xFFE0)
775
************************************************************/
776
 
777
#define VECTOR_NAME(name)       name##_ptr
778
#define EMIT_PRAGMA(x)          _Pragma(#x)
779
#define CREATE_VECTOR(name)     void (* const VECTOR_NAME(name))(void) = &name
780
#define PLACE_VECTOR(vector,section) EMIT_PRAGMA(DATA_SECTION(vector,section))
781
#define ISR_VECTOR(func,offset) CREATE_VECTOR(func); \
782
                                PLACE_VECTOR(VECTOR_NAME(func), offset)
783
 
784
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
785
#define PORT2_VECTOR            ".int01"                    /* 0xFFE2 Port 2 */
786
#else
787
#define PORT2_VECTOR            (1 * 1u)                     /* 0xFFE2 Port 2 */
788
/*#define PORT2_ISR(func)         ISR_VECTOR(func, ".int01")  */ /* 0xFFE2 Port 2 */ /* CCE V2 Style */
789
#endif
790
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
791
#define USART1TX_VECTOR         ".int02"                    /* 0xFFE4 USART 1 Transmit */
792
#else
793
#define USART1TX_VECTOR         (2 * 1u)                     /* 0xFFE4 USART 1 Transmit */
794
/*#define USART1TX_ISR(func)      ISR_VECTOR(func, ".int02")  */ /* 0xFFE4 USART 1 Transmit */ /* CCE V2 Style */
795
#endif
796
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
797
#define USART1RX_VECTOR         ".int03"                    /* 0xFFE6 USART 1 Receive */
798
#else
799
#define USART1RX_VECTOR         (3 * 1u)                     /* 0xFFE6 USART 1 Receive */
800
/*#define USART1RX_ISR(func)      ISR_VECTOR(func, ".int03")  */ /* 0xFFE6 USART 1 Receive */ /* CCE V2 Style */
801
#endif
802
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
803
#define PORT1_VECTOR            ".int04"                    /* 0xFFE8 Port 1 */
804
#else
805
#define PORT1_VECTOR            (4 * 1u)                     /* 0xFFE8 Port 1 */
806
/*#define PORT1_ISR(func)         ISR_VECTOR(func, ".int04")  */ /* 0xFFE8 Port 1 */ /* CCE V2 Style */
807
#endif
808
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
809
#define TIMERA1_VECTOR          ".int05"                    /* 0xFFEA Timer A CC1-2, TA */
810
#else
811
#define TIMERA1_VECTOR          (5 * 1u)                     /* 0xFFEA Timer A CC1-2, TA */
812
/*#define TIMERA1_ISR(func)       ISR_VECTOR(func, ".int05")  */ /* 0xFFEA Timer A CC1-2, TA */ /* CCE V2 Style */
813
#endif
814
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
815
#define TIMERA0_VECTOR          ".int06"                    /* 0xFFEC Timer A CC0 */
816
#else
817
#define TIMERA0_VECTOR          (6 * 1u)                     /* 0xFFEC Timer A CC0 */
818
/*#define TIMERA0_ISR(func)       ISR_VECTOR(func, ".int06")  */ /* 0xFFEC Timer A CC0 */ /* CCE V2 Style */
819
#endif
820
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
821
#define USART0TX_VECTOR         ".int08"                    /* 0xFFF0 USART 0 Transmit */
822
#else
823
#define USART0TX_VECTOR         (8 * 1u)                     /* 0xFFF0 USART 0 Transmit */
824
/*#define USART0TX_ISR(func)      ISR_VECTOR(func, ".int08")  */ /* 0xFFF0 USART 0 Transmit */ /* CCE V2 Style */
825
#endif
826
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
827
#define USART0RX_VECTOR         ".int09"                    /* 0xFFF2 USART 0 Receive */
828
#else
829
#define USART0RX_VECTOR         (9 * 1u)                     /* 0xFFF2 USART 0 Receive */
830
/*#define USART0RX_ISR(func)      ISR_VECTOR(func, ".int09")  */ /* 0xFFF2 USART 0 Receive */ /* CCE V2 Style */
831
#endif
832
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
833
#define WDT_VECTOR              ".int10"                    /* 0xFFF4 Watchdog Timer */
834
#else
835
#define WDT_VECTOR              (10 * 1u)                    /* 0xFFF4 Watchdog Timer */
836
/*#define WDT_ISR(func)           ISR_VECTOR(func, ".int10")  */ /* 0xFFF4 Watchdog Timer */ /* CCE V2 Style */
837
#endif
838
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
839
#define COMPARATORA_VECTOR      ".int11"                    /* 0xFFF6 Comparator A */
840
#else
841
#define COMPARATORA_VECTOR      (11 * 1u)                    /* 0xFFF6 Comparator A */
842
/*#define COMPARATORA_ISR(func)   ISR_VECTOR(func, ".int11")  */ /* 0xFFF6 Comparator A */ /* CCE V2 Style */
843
#endif
844
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
845
#define TIMERB1_VECTOR          ".int12"                    /* 0xFFF8 Timer B CC1-6, TB */
846
#else
847
#define TIMERB1_VECTOR          (12 * 1u)                    /* 0xFFF8 Timer B CC1-6, TB */
848
/*#define TIMERB1_ISR(func)       ISR_VECTOR(func, ".int12")  */ /* 0xFFF8 Timer B CC1-6, TB */ /* CCE V2 Style */
849
#endif
850
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
851
#define TIMERB0_VECTOR          ".int13"                    /* 0xFFFA Timer B CC0 */
852
#else
853
#define TIMERB0_VECTOR          (13 * 1u)                    /* 0xFFFA Timer B CC0 */
854
/*#define TIMERB0_ISR(func)       ISR_VECTOR(func, ".int13")  */ /* 0xFFFA Timer B CC0 */ /* CCE V2 Style */
855
#endif
856
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
857
#define NMI_VECTOR              ".int14"                    /* 0xFFFC Non-maskable */
858
#else
859
#define NMI_VECTOR              (14 * 1u)                    /* 0xFFFC Non-maskable */
860
/*#define NMI_ISR(func)           ISR_VECTOR(func, ".int14")  */ /* 0xFFFC Non-maskable */ /* CCE V2 Style */
861
#endif
862
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
863
#define RESET_VECTOR            ".reset"                    /* 0xFFFE Reset [Highest Priority] */
864
#else
865
#define RESET_VECTOR            (15 * 1u)                    /* 0xFFFE Reset [Highest Priority] */
866
/*#define RESET_ISR(func)         ISR_VECTOR(func, ".int15")  */ /* 0xFFFE Reset [Highest Priority] */ /* CCE V2 Style */
867
#endif
868
 
869
 
870
/************************************************************
871
* End of Modules
872
************************************************************/
873
 
874
#ifdef __cplusplus
875
}
876
#endif /* extern "C" */
877
 
878
#endif /* #ifndef __msp430x14x1 */
879