| 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 |
* MSP430x21x2 devices.
|
|
|
8 |
*
|
|
|
9 |
* Texas Instruments, Version 1.2
|
|
|
10 |
*
|
|
|
11 |
* Rev. 1.0, Setup
|
|
|
12 |
* Rev. 1.1, fixed define: TAG_ADC10_1 to 0x08
|
|
|
13 |
* Rev. 1.2, Fixed typo in ADC10: SREF3 -> SREF2
|
|
|
14 |
*
|
|
|
15 |
********************************************************************/
|
|
|
16 |
|
|
|
17 |
#ifndef __msp430x21x2
|
|
|
18 |
#define __msp430x21x2
|
|
|
19 |
|
|
|
20 |
#ifdef __cplusplus
|
|
|
21 |
extern "C" {
|
|
|
22 |
#endif
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
/*----------------------------------------------------------------------------*/
|
|
|
26 |
/* PERIPHERAL FILE MAP */
|
|
|
27 |
/*----------------------------------------------------------------------------*/
|
|
|
28 |
|
|
|
29 |
/* External references resolved by a device-specific linker command file */
|
|
|
30 |
#define SFR_8BIT(address) extern volatile unsigned char address
|
|
|
31 |
#define SFR_16BIT(address) extern volatile unsigned int address
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
/************************************************************
|
|
|
35 |
* STANDARD BITS
|
|
|
36 |
************************************************************/
|
|
|
37 |
|
|
|
38 |
#define BIT0 (0x0001)
|
|
|
39 |
#define BIT1 (0x0002)
|
|
|
40 |
#define BIT2 (0x0004)
|
|
|
41 |
#define BIT3 (0x0008)
|
|
|
42 |
#define BIT4 (0x0010)
|
|
|
43 |
#define BIT5 (0x0020)
|
|
|
44 |
#define BIT6 (0x0040)
|
|
|
45 |
#define BIT7 (0x0080)
|
|
|
46 |
#define BIT8 (0x0100)
|
|
|
47 |
#define BIT9 (0x0200)
|
|
|
48 |
#define BITA (0x0400)
|
|
|
49 |
#define BITB (0x0800)
|
|
|
50 |
#define BITC (0x1000)
|
|
|
51 |
#define BITD (0x2000)
|
|
|
52 |
#define BITE (0x4000)
|
|
|
53 |
#define BITF (0x8000)
|
|
|
54 |
|
|
|
55 |
/************************************************************
|
|
|
56 |
* STATUS REGISTER BITS
|
|
|
57 |
************************************************************/
|
|
|
58 |
|
|
|
59 |
#define C (0x0001)
|
|
|
60 |
#define Z (0x0002)
|
|
|
61 |
#define N (0x0004)
|
|
|
62 |
#define V (0x0100)
|
|
|
63 |
#define GIE (0x0008)
|
|
|
64 |
#define CPUOFF (0x0010)
|
|
|
65 |
#define OSCOFF (0x0020)
|
|
|
66 |
#define SCG0 (0x0040)
|
|
|
67 |
#define SCG1 (0x0080)
|
|
|
68 |
|
|
|
69 |
/* Low Power Modes coded with Bits 4-7 in SR */
|
|
|
70 |
|
|
|
71 |
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
|
|
|
72 |
#define LPM0 (CPUOFF)
|
|
|
73 |
#define LPM1 (SCG0+CPUOFF)
|
|
|
74 |
#define LPM2 (SCG1+CPUOFF)
|
|
|
75 |
#define LPM3 (SCG1+SCG0+CPUOFF)
|
|
|
76 |
#define LPM4 (SCG1+SCG0+OSCOFF+CPUOFF)
|
|
|
77 |
/* End #defines for assembler */
|
|
|
78 |
|
|
|
79 |
#else /* Begin #defines for C */
|
|
|
80 |
#define LPM0_bits (CPUOFF)
|
|
|
81 |
#define LPM1_bits (SCG0+CPUOFF)
|
|
|
82 |
#define LPM2_bits (SCG1+CPUOFF)
|
|
|
83 |
#define LPM3_bits (SCG1+SCG0+CPUOFF)
|
|
|
84 |
#define LPM4_bits (SCG1+SCG0+OSCOFF+CPUOFF)
|
|
|
85 |
|
|
|
86 |
#include "in430.h"
|
|
|
87 |
|
|
|
88 |
#define LPM0 _bis_SR_register(LPM0_bits) /* Enter Low Power Mode 0 */
|
|
|
89 |
#define LPM0_EXIT _bic_SR_register_on_exit(LPM0_bits) /* Exit Low Power Mode 0 */
|
|
|
90 |
#define LPM1 _bis_SR_register(LPM1_bits) /* Enter Low Power Mode 1 */
|
|
|
91 |
#define LPM1_EXIT _bic_SR_register_on_exit(LPM1_bits) /* Exit Low Power Mode 1 */
|
|
|
92 |
#define LPM2 _bis_SR_register(LPM2_bits) /* Enter Low Power Mode 2 */
|
|
|
93 |
#define LPM2_EXIT _bic_SR_register_on_exit(LPM2_bits) /* Exit Low Power Mode 2 */
|
|
|
94 |
#define LPM3 _bis_SR_register(LPM3_bits) /* Enter Low Power Mode 3 */
|
|
|
95 |
#define LPM3_EXIT _bic_SR_register_on_exit(LPM3_bits) /* Exit Low Power Mode 3 */
|
|
|
96 |
#define LPM4 _bis_SR_register(LPM4_bits) /* Enter Low Power Mode 4 */
|
|
|
97 |
#define LPM4_EXIT _bic_SR_register_on_exit(LPM4_bits) /* Exit Low Power Mode 4 */
|
|
|
98 |
#endif /* End #defines for C */
|
|
|
99 |
|
|
|
100 |
/************************************************************
|
|
|
101 |
* PERIPHERAL FILE MAP
|
|
|
102 |
************************************************************/
|
|
|
103 |
|
|
|
104 |
/************************************************************
|
|
|
105 |
* SPECIAL FUNCTION REGISTER ADDRESSES + CONTROL BITS
|
|
|
106 |
************************************************************/
|
|
|
107 |
|
|
|
108 |
SFR_8BIT(IE1); /* Interrupt Enable 1 */
|
|
|
109 |
#define WDTIE (0x01) /* Watchdog Interrupt Enable */
|
|
|
110 |
#define OFIE (0x02) /* Osc. Fault Interrupt Enable */
|
|
|
111 |
#define NMIIE (0x10) /* NMI Interrupt Enable */
|
|
|
112 |
#define ACCVIE (0x20) /* Flash Access Violation Interrupt Enable */
|
|
|
113 |
|
|
|
114 |
SFR_8BIT(IFG1); /* Interrupt Flag 1 */
|
|
|
115 |
#define WDTIFG (0x01) /* Watchdog Interrupt Flag */
|
|
|
116 |
#define OFIFG (0x02) /* Osc. Fault Interrupt Flag */
|
|
|
117 |
#define PORIFG (0x04) /* Power On Interrupt Flag */
|
|
|
118 |
#define RSTIFG (0x08) /* Reset Interrupt Flag */
|
|
|
119 |
#define NMIIFG (0x10) /* NMI Interrupt Flag */
|
|
|
120 |
|
|
|
121 |
SFR_8BIT(IE2); /* Interrupt Enable 2 */
|
|
|
122 |
#define UC0IE IE2
|
|
|
123 |
#define UCA0RXIE (0x01)
|
|
|
124 |
#define UCA0TXIE (0x02)
|
|
|
125 |
#define UCB0RXIE (0x04)
|
|
|
126 |
#define UCB0TXIE (0x08)
|
|
|
127 |
|
|
|
128 |
SFR_8BIT(IFG2); /* Interrupt Flag 2 */
|
|
|
129 |
#define UC0IFG IFG2
|
|
|
130 |
#define UCA0RXIFG (0x01)
|
|
|
131 |
#define UCA0TXIFG (0x02)
|
|
|
132 |
#define UCB0RXIFG (0x04)
|
|
|
133 |
#define UCB0TXIFG (0x08)
|
|
|
134 |
|
|
|
135 |
/************************************************************
|
|
|
136 |
* ADC10
|
|
|
137 |
************************************************************/
|
|
|
138 |
#define __MSP430_HAS_ADC10__ /* Definition to show that Module is available */
|
|
|
139 |
|
|
|
140 |
SFR_8BIT(ADC10DTC0); /* ADC10 Data Transfer Control 0 */
|
|
|
141 |
SFR_8BIT(ADC10DTC1); /* ADC10 Data Transfer Control 1 */
|
|
|
142 |
SFR_8BIT(ADC10AE0); /* ADC10 Analog Enable 0 */
|
|
|
143 |
SFR_8BIT(ADC10AE1); /* ADC10 Analog Enable 1 */
|
|
|
144 |
|
|
|
145 |
SFR_16BIT(ADC10CTL0); /* ADC10 Control 0 */
|
|
|
146 |
SFR_16BIT(ADC10CTL1); /* ADC10 Control 1 */
|
|
|
147 |
SFR_16BIT(ADC10MEM); /* ADC10 Memory */
|
|
|
148 |
SFR_16BIT(ADC10SA); /* ADC10 Data Transfer Start Address */
|
|
|
149 |
|
|
|
150 |
/* ADC10CTL0 */
|
|
|
151 |
#define ADC10SC (0x001) /* ADC10 Start Conversion */
|
|
|
152 |
#define ENC (0x002) /* ADC10 Enable Conversion */
|
|
|
153 |
#define ADC10IFG (0x004) /* ADC10 Interrupt Flag */
|
|
|
154 |
#define ADC10IE (0x008) /* ADC10 Interrupt Enalbe */
|
|
|
155 |
#define ADC10ON (0x010) /* ADC10 On/Enable */
|
|
|
156 |
#define REFON (0x020) /* ADC10 Reference on */
|
|
|
157 |
#define REF2_5V (0x040) /* ADC10 Ref 0:1.5V / 1:2.5V */
|
|
|
158 |
#define MSC (0x080) /* ADC10 Multiple SampleConversion */
|
|
|
159 |
#define REFBURST (0x100) /* ADC10 Reference Burst Mode */
|
|
|
160 |
#define REFOUT (0x200) /* ADC10 Enalbe output of Ref. */
|
|
|
161 |
#define ADC10SR (0x400) /* ADC10 Sampling Rate 0:200ksps / 1:50ksps */
|
|
|
162 |
#define ADC10SHT0 (0x800) /* ADC10 Sample Hold Select Bit: 0 */
|
|
|
163 |
#define ADC10SHT1 (0x1000) /* ADC10 Sample Hold Select Bit: 1 */
|
|
|
164 |
#define SREF0 (0x2000) /* ADC10 Reference Select Bit: 0 */
|
|
|
165 |
#define SREF1 (0x4000) /* ADC10 Reference Select Bit: 1 */
|
|
|
166 |
#define SREF2 (0x8000) /* ADC10 Reference Select Bit: 2 */
|
|
|
167 |
#define ADC10SHT_0 (0*0x800u) /* 4 x ADC10CLKs */
|
|
|
168 |
#define ADC10SHT_1 (1*0x800u) /* 8 x ADC10CLKs */
|
|
|
169 |
#define ADC10SHT_2 (2*0x800u) /* 16 x ADC10CLKs */
|
|
|
170 |
#define ADC10SHT_3 (3*0x800u) /* 64 x ADC10CLKs */
|
|
|
171 |
|
|
|
172 |
#define SREF_0 (0*0x2000u) /* VR+ = AVCC and VR- = AVSS */
|
|
|
173 |
#define SREF_1 (1*0x2000u) /* VR+ = VREF+ and VR- = AVSS */
|
|
|
174 |
#define SREF_2 (2*0x2000u) /* VR+ = VEREF+ and VR- = AVSS */
|
|
|
175 |
#define SREF_3 (3*0x2000u) /* VR+ = VEREF+ and VR- = AVSS */
|
|
|
176 |
#define SREF_4 (4*0x2000u) /* VR+ = AVCC and VR- = VREF-/VEREF- */
|
|
|
177 |
#define SREF_5 (5*0x2000u) /* VR+ = VREF+ and VR- = VREF-/VEREF- */
|
|
|
178 |
#define SREF_6 (6*0x2000u) /* VR+ = VEREF+ and VR- = VREF-/VEREF- */
|
|
|
179 |
#define SREF_7 (7*0x2000u) /* VR+ = VEREF+ and VR- = VREF-/VEREF- */
|
|
|
180 |
|
|
|
181 |
/* ADC10CTL1 */
|
|
|
182 |
#define ADC10BUSY (0x0001) /* ADC10 BUSY */
|
|
|
183 |
#define CONSEQ0 (0x0002) /* ADC10 Conversion Sequence Select 0 */
|
|
|
184 |
#define CONSEQ1 (0x0004) /* ADC10 Conversion Sequence Select 1 */
|
|
|
185 |
#define ADC10SSEL0 (0x0008) /* ADC10 Clock Source Select Bit: 0 */
|
|
|
186 |
#define ADC10SSEL1 (0x0010) /* ADC10 Clock Source Select Bit: 1 */
|
|
|
187 |
#define ADC10DIV0 (0x0020) /* ADC10 Clock Divider Select Bit: 0 */
|
|
|
188 |
#define ADC10DIV1 (0x0040) /* ADC10 Clock Divider Select Bit: 1 */
|
|
|
189 |
#define ADC10DIV2 (0x0080) /* ADC10 Clock Divider Select Bit: 2 */
|
|
|
190 |
#define ISSH (0x0100) /* ADC10 Invert Sample Hold Signal */
|
|
|
191 |
#define ADC10DF (0x0200) /* ADC10 Data Format 0:binary 1:2's complement */
|
|
|
192 |
#define SHS0 (0x0400) /* ADC10 Sample/Hold Source Bit: 0 */
|
|
|
193 |
#define SHS1 (0x0800) /* ADC10 Sample/Hold Source Bit: 1 */
|
|
|
194 |
#define INCH0 (0x1000) /* ADC10 Input Channel Select Bit: 0 */
|
|
|
195 |
#define INCH1 (0x2000) /* ADC10 Input Channel Select Bit: 1 */
|
|
|
196 |
#define INCH2 (0x4000) /* ADC10 Input Channel Select Bit: 2 */
|
|
|
197 |
#define INCH3 (0x8000) /* ADC10 Input Channel Select Bit: 3 */
|
|
|
198 |
|
|
|
199 |
#define CONSEQ_0 (0*2u) /* Single channel single conversion */
|
|
|
200 |
#define CONSEQ_1 (1*2u) /* Sequence of channels */
|
|
|
201 |
#define CONSEQ_2 (2*2u) /* Repeat single channel */
|
|
|
202 |
#define CONSEQ_3 (3*2u) /* Repeat sequence of channels */
|
|
|
203 |
|
|
|
204 |
#define ADC10SSEL_0 (0*8u) /* ADC10OSC */
|
|
|
205 |
#define ADC10SSEL_1 (1*8u) /* ACLK */
|
|
|
206 |
#define ADC10SSEL_2 (2*8u) /* MCLK */
|
|
|
207 |
#define ADC10SSEL_3 (3*8u) /* SMCLK */
|
|
|
208 |
|
|
|
209 |
#define ADC10DIV_0 (0*0x20u) /* ADC10 Clock Divider Select 0 */
|
|
|
210 |
#define ADC10DIV_1 (1*0x20u) /* ADC10 Clock Divider Select 1 */
|
|
|
211 |
#define ADC10DIV_2 (2*0x20u) /* ADC10 Clock Divider Select 2 */
|
|
|
212 |
#define ADC10DIV_3 (3*0x20u) /* ADC10 Clock Divider Select 3 */
|
|
|
213 |
#define ADC10DIV_4 (4*0x20u) /* ADC10 Clock Divider Select 4 */
|
|
|
214 |
#define ADC10DIV_5 (5*0x20u) /* ADC10 Clock Divider Select 5 */
|
|
|
215 |
#define ADC10DIV_6 (6*0x20u) /* ADC10 Clock Divider Select 6 */
|
|
|
216 |
#define ADC10DIV_7 (7*0x20u) /* ADC10 Clock Divider Select 7 */
|
|
|
217 |
|
|
|
218 |
#define SHS_0 (0*0x400u) /* ADC10SC */
|
|
|
219 |
#define SHS_1 (1*0x400u) /* TA3 OUT1 */
|
|
|
220 |
#define SHS_2 (2*0x400u) /* TA3 OUT0 */
|
|
|
221 |
#define SHS_3 (3*0x400u) /* TA3 OUT2 */
|
|
|
222 |
|
|
|
223 |
#define INCH_0 (0*0x1000u) /* Selects Channel 0 */
|
|
|
224 |
#define INCH_1 (1*0x1000u) /* Selects Channel 1 */
|
|
|
225 |
#define INCH_2 (2*0x1000u) /* Selects Channel 2 */
|
|
|
226 |
#define INCH_3 (3*0x1000u) /* Selects Channel 3 */
|
|
|
227 |
#define INCH_4 (4*0x1000u) /* Selects Channel 4 */
|
|
|
228 |
#define INCH_5 (5*0x1000u) /* Selects Channel 5 */
|
|
|
229 |
#define INCH_6 (6*0x1000u) /* Selects Channel 6 */
|
|
|
230 |
#define INCH_7 (7*0x1000u) /* Selects Channel 7 */
|
|
|
231 |
#define INCH_8 (8*0x1000u) /* Selects Channel 8 */
|
|
|
232 |
#define INCH_9 (9*0x1000u) /* Selects Channel 9 */
|
|
|
233 |
#define INCH_10 (10*0x1000u) /* Selects Channel 10 */
|
|
|
234 |
#define INCH_11 (11*0x1000u) /* Selects Channel 11 */
|
|
|
235 |
#define INCH_12 (12*0x1000u) /* Selects Channel 12 */
|
|
|
236 |
#define INCH_13 (13*0x1000u) /* Selects Channel 13 */
|
|
|
237 |
#define INCH_14 (14*0x1000u) /* Selects Channel 14 */
|
|
|
238 |
#define INCH_15 (15*0x1000u) /* Selects Channel 15 */
|
|
|
239 |
|
|
|
240 |
/* ADC10DTC0 */
|
|
|
241 |
#define ADC10FETCH (0x001) /* This bit should normally be reset */
|
|
|
242 |
#define ADC10B1 (0x002) /* ADC10 block one */
|
|
|
243 |
#define ADC10CT (0x004) /* ADC10 continuous transfer */
|
|
|
244 |
#define ADC10TB (0x008) /* ADC10 two-block mode */
|
|
|
245 |
#define ADC10DISABLE (0x000) /* ADC10DTC1 */
|
|
|
246 |
|
|
|
247 |
/************************************************************
|
|
|
248 |
* Basic Clock Module
|
|
|
249 |
************************************************************/
|
|
|
250 |
#define __MSP430_HAS_BC2__ /* Definition to show that Module is available */
|
|
|
251 |
|
|
|
252 |
SFR_8BIT(DCOCTL); /* DCO Clock Frequency Control */
|
|
|
253 |
SFR_8BIT(BCSCTL1); /* Basic Clock System Control 1 */
|
|
|
254 |
SFR_8BIT(BCSCTL2); /* Basic Clock System Control 2 */
|
|
|
255 |
SFR_8BIT(BCSCTL3); /* Basic Clock System Control 3 */
|
|
|
256 |
|
|
|
257 |
#define MOD0 (0x01) /* Modulation Bit 0 */
|
|
|
258 |
#define MOD1 (0x02) /* Modulation Bit 1 */
|
|
|
259 |
#define MOD2 (0x04) /* Modulation Bit 2 */
|
|
|
260 |
#define MOD3 (0x08) /* Modulation Bit 3 */
|
|
|
261 |
#define MOD4 (0x10) /* Modulation Bit 4 */
|
|
|
262 |
#define DCO0 (0x20) /* DCO Select Bit 0 */
|
|
|
263 |
#define DCO1 (0x40) /* DCO Select Bit 1 */
|
|
|
264 |
#define DCO2 (0x80) /* DCO Select Bit 2 */
|
|
|
265 |
|
|
|
266 |
#define RSEL0 (0x01) /* Range Select Bit 0 */
|
|
|
267 |
#define RSEL1 (0x02) /* Range Select Bit 1 */
|
|
|
268 |
#define RSEL2 (0x04) /* Range Select Bit 2 */
|
|
|
269 |
#define RSEL3 (0x08) /* Range Select Bit 3 */
|
|
|
270 |
#define DIVA0 (0x10) /* ACLK Divider 0 */
|
|
|
271 |
#define DIVA1 (0x20) /* ACLK Divider 1 */
|
|
|
272 |
#define XTS (0x40) /* LFXTCLK 0:Low Freq. / 1: High Freq. */
|
|
|
273 |
#define XT2OFF (0x80) /* Enable XT2CLK */
|
|
|
274 |
|
|
|
275 |
#define DIVA_0 (0x00) /* ACLK Divider 0: /1 */
|
|
|
276 |
#define DIVA_1 (0x10) /* ACLK Divider 1: /2 */
|
|
|
277 |
#define DIVA_2 (0x20) /* ACLK Divider 2: /4 */
|
|
|
278 |
#define DIVA_3 (0x30) /* ACLK Divider 3: /8 */
|
|
|
279 |
|
|
|
280 |
#define DCOR (0x01) /* Enable External Resistor : 1 */
|
|
|
281 |
#define DIVS0 (0x02) /* SMCLK Divider 0 */
|
|
|
282 |
#define DIVS1 (0x04) /* SMCLK Divider 1 */
|
|
|
283 |
#define SELS (0x08) /* SMCLK Source Select 0:DCOCLK / 1:XT2CLK/LFXTCLK */
|
|
|
284 |
#define DIVM0 (0x10) /* MCLK Divider 0 */
|
|
|
285 |
#define DIVM1 (0x20) /* MCLK Divider 1 */
|
|
|
286 |
#define SELM0 (0x40) /* MCLK Source Select 0 */
|
|
|
287 |
#define SELM1 (0x80) /* MCLK Source Select 1 */
|
|
|
288 |
|
|
|
289 |
#define DIVS_0 (0x00) /* SMCLK Divider 0: /1 */
|
|
|
290 |
#define DIVS_1 (0x02) /* SMCLK Divider 1: /2 */
|
|
|
291 |
#define DIVS_2 (0x04) /* SMCLK Divider 2: /4 */
|
|
|
292 |
#define DIVS_3 (0x06) /* SMCLK Divider 3: /8 */
|
|
|
293 |
|
|
|
294 |
#define DIVM_0 (0x00) /* MCLK Divider 0: /1 */
|
|
|
295 |
#define DIVM_1 (0x10) /* MCLK Divider 1: /2 */
|
|
|
296 |
#define DIVM_2 (0x20) /* MCLK Divider 2: /4 */
|
|
|
297 |
#define DIVM_3 (0x30) /* MCLK Divider 3: /8 */
|
|
|
298 |
|
|
|
299 |
#define SELM_0 (0x00) /* MCLK Source Select 0: DCOCLK */
|
|
|
300 |
#define SELM_1 (0x40) /* MCLK Source Select 1: DCOCLK */
|
|
|
301 |
#define SELM_2 (0x80) /* MCLK Source Select 2: XT2CLK/LFXTCLK */
|
|
|
302 |
#define SELM_3 (0xC0) /* MCLK Source Select 3: LFXTCLK */
|
|
|
303 |
|
|
|
304 |
#define LFXT1OF (0x01) /* Low/high Frequency Oscillator Fault Flag */
|
|
|
305 |
#define XT2OF (0x02) /* High frequency oscillator 2 fault flag */
|
|
|
306 |
#define XCAP0 (0x04) /* XIN/XOUT Cap 0 */
|
|
|
307 |
#define XCAP1 (0x08) /* XIN/XOUT Cap 1 */
|
|
|
308 |
#define LFXT1S0 (0x10) /* Mode 0 for LFXT1 (XTS = 0) */
|
|
|
309 |
#define LFXT1S1 (0x20) /* Mode 1 for LFXT1 (XTS = 0) */
|
|
|
310 |
#define XT2S0 (0x40) /* Mode 0 for XT2 */
|
|
|
311 |
#define XT2S1 (0x80) /* Mode 1 for XT2 */
|
|
|
312 |
|
|
|
313 |
#define XCAP_0 (0x00) /* XIN/XOUT Cap : 0 pF */
|
|
|
314 |
#define XCAP_1 (0x04) /* XIN/XOUT Cap : 6 pF */
|
|
|
315 |
#define XCAP_2 (0x08) /* XIN/XOUT Cap : 10 pF */
|
|
|
316 |
#define XCAP_3 (0x0C) /* XIN/XOUT Cap : 12.5 pF */
|
|
|
317 |
|
|
|
318 |
#define LFXT1S_0 (0x00) /* Mode 0 for LFXT1 : Normal operation */
|
|
|
319 |
#define LFXT1S_1 (0x10) /* Mode 1 for LFXT1 : Reserved */
|
|
|
320 |
#define LFXT1S_2 (0x20) /* Mode 2 for LFXT1 : VLO */
|
|
|
321 |
#define LFXT1S_3 (0x30) /* Mode 3 for LFXT1 : Digital input signal */
|
|
|
322 |
|
|
|
323 |
#define XT2S_0 (0x00) /* Mode 0 for XT2 : 0.4 - 1 MHz */
|
|
|
324 |
#define XT2S_1 (0x40) /* Mode 1 for XT2 : 1 - 4 MHz */
|
|
|
325 |
#define XT2S_2 (0x80) /* Mode 2 for XT2 : 2 - 16 MHz */
|
|
|
326 |
#define XT2S_3 (0xC0) /* Mode 3 for XT2 : Digital input signal */
|
|
|
327 |
|
|
|
328 |
/************************************************************
|
|
|
329 |
* Comparator A
|
|
|
330 |
************************************************************/
|
|
|
331 |
#define __MSP430_HAS_CAPLUS__ /* Definition to show that Module is available */
|
|
|
332 |
|
|
|
333 |
SFR_8BIT(CACTL1); /* Comparator A Control 1 */
|
|
|
334 |
SFR_8BIT(CACTL2); /* Comparator A Control 2 */
|
|
|
335 |
SFR_8BIT(CAPD); /* Comparator A Port Disable */
|
|
|
336 |
|
|
|
337 |
#define CAIFG (0x01) /* Comp. A Interrupt Flag */
|
|
|
338 |
#define CAIE (0x02) /* Comp. A Interrupt Enable */
|
|
|
339 |
#define CAIES (0x04) /* Comp. A Int. Edge Select: 0:rising / 1:falling */
|
|
|
340 |
#define CAON (0x08) /* Comp. A enable */
|
|
|
341 |
#define CAREF0 (0x10) /* Comp. A Internal Reference Select 0 */
|
|
|
342 |
#define CAREF1 (0x20) /* Comp. A Internal Reference Select 1 */
|
|
|
343 |
#define CARSEL (0x40) /* Comp. A Internal Reference Enable */
|
|
|
344 |
#define CAEX (0x80) /* Comp. A Exchange Inputs */
|
|
|
345 |
|
|
|
346 |
#define CAREF_0 (0x00) /* Comp. A Int. Ref. Select 0 : Off */
|
|
|
347 |
#define CAREF_1 (0x10) /* Comp. A Int. Ref. Select 1 : 0.25*Vcc */
|
|
|
348 |
#define CAREF_2 (0x20) /* Comp. A Int. Ref. Select 2 : 0.5*Vcc */
|
|
|
349 |
#define CAREF_3 (0x30) /* Comp. A Int. Ref. Select 3 : Vt*/
|
|
|
350 |
|
|
|
351 |
#define CAOUT (0x01) /* Comp. A Output */
|
|
|
352 |
#define CAF (0x02) /* Comp. A Enable Output Filter */
|
|
|
353 |
#define P2CA0 (0x04) /* Comp. A +Terminal Multiplexer */
|
|
|
354 |
#define P2CA1 (0x08) /* Comp. A -Terminal Multiplexer */
|
|
|
355 |
#define P2CA2 (0x10) /* Comp. A -Terminal Multiplexer */
|
|
|
356 |
#define P2CA3 (0x20) /* Comp. A -Terminal Multiplexer */
|
|
|
357 |
#define P2CA4 (0x40) /* Comp. A +Terminal Multiplexer */
|
|
|
358 |
#define CASHORT (0x80) /* Comp. A Short + and - Terminals */
|
|
|
359 |
|
|
|
360 |
#define CAPD0 (0x01) /* Comp. A Disable Input Buffer of Port Register .0 */
|
|
|
361 |
#define CAPD1 (0x02) /* Comp. A Disable Input Buffer of Port Register .1 */
|
|
|
362 |
#define CAPD2 (0x04) /* Comp. A Disable Input Buffer of Port Register .2 */
|
|
|
363 |
#define CAPD3 (0x08) /* Comp. A Disable Input Buffer of Port Register .3 */
|
|
|
364 |
#define CAPD4 (0x10) /* Comp. A Disable Input Buffer of Port Register .4 */
|
|
|
365 |
#define CAPD5 (0x20) /* Comp. A Disable Input Buffer of Port Register .5 */
|
|
|
366 |
#define CAPD6 (0x40) /* Comp. A Disable Input Buffer of Port Register .6 */
|
|
|
367 |
#define CAPD7 (0x80) /* Comp. A Disable Input Buffer of Port Register .7 */
|
|
|
368 |
|
|
|
369 |
/*************************************************************
|
|
|
370 |
* Flash Memory
|
|
|
371 |
*************************************************************/
|
|
|
372 |
#define __MSP430_HAS_FLASH2__ /* Definition to show that Module is available */
|
|
|
373 |
|
|
|
374 |
SFR_16BIT(FCTL1); /* FLASH Control 1 */
|
|
|
375 |
SFR_16BIT(FCTL2); /* FLASH Control 2 */
|
|
|
376 |
SFR_16BIT(FCTL3); /* FLASH Control 3 */
|
|
|
377 |
|
|
|
378 |
#define FRKEY (0x9600) /* Flash key returned by read */
|
|
|
379 |
#define FWKEY (0xA500) /* Flash key for write */
|
|
|
380 |
#define FXKEY (0x3300) /* for use with XOR instruction */
|
|
|
381 |
|
|
|
382 |
#define ERASE (0x0002) /* Enable bit for Flash segment erase */
|
|
|
383 |
#define MERAS (0x0004) /* Enable bit for Flash mass erase */
|
|
|
384 |
#define EEI (0x0008) /* Enable Erase Interrupts */
|
|
|
385 |
#define EEIEX (0x0010) /* Enable Emergency Interrupt Exit */
|
|
|
386 |
#define WRT (0x0040) /* Enable bit for Flash write */
|
|
|
387 |
#define BLKWRT (0x0080) /* Enable bit for Flash segment write */
|
|
|
388 |
#define SEGWRT (0x0080) /* old definition */ /* Enable bit for Flash segment write */
|
|
|
389 |
|
|
|
390 |
#define FN0 (0x0001) /* Divide Flash clock by 1 to 64 using FN0 to FN5 according to: */
|
|
|
391 |
#define FN1 (0x0002) /* 32*FN5 + 16*FN4 + 8*FN3 + 4*FN2 + 2*FN1 + FN0 + 1 */
|
|
|
392 |
#ifndef FN2
|
|
|
393 |
#define FN2 (0x0004)
|
|
|
394 |
#endif
|
|
|
395 |
#ifndef FN3
|
|
|
396 |
#define FN3 (0x0008)
|
|
|
397 |
#endif
|
|
|
398 |
#ifndef FN4
|
|
|
399 |
#define FN4 (0x0010)
|
|
|
400 |
#endif
|
|
|
401 |
#define FN5 (0x0020)
|
|
|
402 |
#define FSSEL0 (0x0040) /* Flash clock select 0 */ /* to distinguish from USART SSELx */
|
|
|
403 |
#define FSSEL1 (0x0080) /* Flash clock select 1 */
|
|
|
404 |
|
|
|
405 |
#define FSSEL_0 (0x0000) /* Flash clock select: 0 - ACLK */
|
|
|
406 |
#define FSSEL_1 (0x0040) /* Flash clock select: 1 - MCLK */
|
|
|
407 |
#define FSSEL_2 (0x0080) /* Flash clock select: 2 - SMCLK */
|
|
|
408 |
#define FSSEL_3 (0x00C0) /* Flash clock select: 3 - SMCLK */
|
|
|
409 |
|
|
|
410 |
#define BUSY (0x0001) /* Flash busy: 1 */
|
|
|
411 |
#define KEYV (0x0002) /* Flash Key violation flag */
|
|
|
412 |
#define ACCVIFG (0x0004) /* Flash Access violation flag */
|
|
|
413 |
#define WAIT (0x0008) /* Wait flag for segment write */
|
|
|
414 |
#define LOCK (0x0010) /* Lock bit: 1 - Flash is locked (read only) */
|
|
|
415 |
#define EMEX (0x0020) /* Flash Emergency Exit */
|
|
|
416 |
#define LOCKA (0x0040) /* Segment A Lock bit: read = 1 - Segment is locked (read only) */
|
|
|
417 |
#define FAIL (0x0080) /* Last Program or Erase failed */
|
|
|
418 |
|
|
|
419 |
/************************************************************
|
|
|
420 |
* DIGITAL I/O Port1/2 Pull up / Pull down Resistors
|
|
|
421 |
************************************************************/
|
|
|
422 |
#define __MSP430_HAS_PORT1_R__ /* Definition to show that Module is available */
|
|
|
423 |
#define __MSP430_HAS_PORT2_R__ /* Definition to show that Module is available */
|
|
|
424 |
|
|
|
425 |
SFR_8BIT(P1IN); /* Port 1 Input */
|
|
|
426 |
SFR_8BIT(P1OUT); /* Port 1 Output */
|
|
|
427 |
SFR_8BIT(P1DIR); /* Port 1 Direction */
|
|
|
428 |
SFR_8BIT(P1IFG); /* Port 1 Interrupt Flag */
|
|
|
429 |
SFR_8BIT(P1IES); /* Port 1 Interrupt Edge Select */
|
|
|
430 |
SFR_8BIT(P1IE); /* Port 1 Interrupt Enable */
|
|
|
431 |
SFR_8BIT(P1SEL); /* Port 1 Selection */
|
|
|
432 |
SFR_8BIT(P1SEL2); /* Port 1 Selection 2 */
|
|
|
433 |
SFR_8BIT(P1REN); /* Port 1 Resistor Enable */
|
|
|
434 |
|
|
|
435 |
SFR_8BIT(P2IN); /* Port 2 Input */
|
|
|
436 |
SFR_8BIT(P2OUT); /* Port 2 Output */
|
|
|
437 |
SFR_8BIT(P2DIR); /* Port 2 Direction */
|
|
|
438 |
SFR_8BIT(P2IFG); /* Port 2 Interrupt Flag */
|
|
|
439 |
SFR_8BIT(P2IES); /* Port 2 Interrupt Edge Select */
|
|
|
440 |
SFR_8BIT(P2IE); /* Port 2 Interrupt Enable */
|
|
|
441 |
SFR_8BIT(P2SEL); /* Port 2 Selection */
|
|
|
442 |
SFR_8BIT(P2SEL2); /* Port 2 Selection 2 */
|
|
|
443 |
SFR_8BIT(P2REN); /* Port 2 Resistor Enable */
|
|
|
444 |
|
|
|
445 |
/************************************************************
|
|
|
446 |
* DIGITAL I/O Port3 Pull up / Pull down Resistors
|
|
|
447 |
************************************************************/
|
|
|
448 |
#define __MSP430_HAS_PORT3_R__ /* Definition to show that Module is available */
|
|
|
449 |
|
|
|
450 |
SFR_8BIT(P3IN); /* Port 3 Input */
|
|
|
451 |
SFR_8BIT(P3OUT); /* Port 3 Output */
|
|
|
452 |
SFR_8BIT(P3DIR); /* Port 3 Direction */
|
|
|
453 |
SFR_8BIT(P3SEL); /* Port 3 Selection */
|
|
|
454 |
SFR_8BIT(P3REN); /* Port 3 Resistor Enable */
|
|
|
455 |
|
|
|
456 |
/************************************************************
|
|
|
457 |
* Timer0_A3
|
|
|
458 |
************************************************************/
|
|
|
459 |
#define __MSP430_HAS_TA3__ /* Definition to show that Module is available */
|
|
|
460 |
|
|
|
461 |
SFR_16BIT(TA0IV); /* Timer0_A3 Interrupt Vector Word */
|
|
|
462 |
SFR_16BIT(TA0CTL); /* Timer0_A3 Control */
|
|
|
463 |
SFR_16BIT(TA0CCTL0); /* Timer0_A3 Capture/Compare Control 0 */
|
|
|
464 |
SFR_16BIT(TA0CCTL1); /* Timer0_A3 Capture/Compare Control 1 */
|
|
|
465 |
SFR_16BIT(TA0CCTL2); /* Timer0_A3 Capture/Compare Control 2 */
|
|
|
466 |
SFR_16BIT(TA0R); /* Timer0_A3 */
|
|
|
467 |
SFR_16BIT(TA0CCR0); /* Timer0_A3 Capture/Compare 0 */
|
|
|
468 |
SFR_16BIT(TA0CCR1); /* Timer0_A3 Capture/Compare 1 */
|
|
|
469 |
SFR_16BIT(TA0CCR2); /* Timer0_A3 Capture/Compare 2 */
|
|
|
470 |
|
|
|
471 |
/* Alternate register names */
|
|
|
472 |
#define TAIV TA0IV /* Timer A Interrupt Vector Word */
|
|
|
473 |
#define TACTL TA0CTL /* Timer A Control */
|
|
|
474 |
#define TACCTL0 TA0CCTL0 /* Timer A Capture/Compare Control 0 */
|
|
|
475 |
#define TACCTL1 TA0CCTL1 /* Timer A Capture/Compare Control 1 */
|
|
|
476 |
#define TACCTL2 TA0CCTL2 /* Timer A Capture/Compare Control 2 */
|
|
|
477 |
#define TAR TA0R /* Timer A */
|
|
|
478 |
#define TACCR0 TA0CCR0 /* Timer A Capture/Compare 0 */
|
|
|
479 |
#define TACCR1 TA0CCR1 /* Timer A Capture/Compare 1 */
|
|
|
480 |
#define TACCR2 TA0CCR2 /* Timer A Capture/Compare 2 */
|
|
|
481 |
#define TAIV_ TA0IV_ /* Timer A Interrupt Vector Word */
|
|
|
482 |
#define TACTL_ TA0CTL_ /* Timer A Control */
|
|
|
483 |
#define TACCTL0_ TA0CCTL0_ /* Timer A Capture/Compare Control 0 */
|
|
|
484 |
#define TACCTL1_ TA0CCTL1_ /* Timer A Capture/Compare Control 1 */
|
|
|
485 |
#define TACCTL2_ TA0CCTL2_ /* Timer A Capture/Compare Control 2 */
|
|
|
486 |
#define TAR_ TA0R_ /* Timer A */
|
|
|
487 |
#define TACCR0_ TA0CCR0_ /* Timer A Capture/Compare 0 */
|
|
|
488 |
#define TACCR1_ TA0CCR1_ /* Timer A Capture/Compare 1 */
|
|
|
489 |
#define TACCR2_ TA0CCR2_ /* Timer A Capture/Compare 2 */
|
|
|
490 |
|
|
|
491 |
/* Alternate register names 2 */
|
|
|
492 |
#define CCTL0 TACCTL0 /* Timer A Capture/Compare Control 0 */
|
|
|
493 |
#define CCTL1 TACCTL1 /* Timer A Capture/Compare Control 1 */
|
|
|
494 |
#define CCTL2 TACCTL2 /* Timer A Capture/Compare Control 2 */
|
|
|
495 |
#define CCR0 TACCR0 /* Timer A Capture/Compare 0 */
|
|
|
496 |
#define CCR1 TACCR1 /* Timer A Capture/Compare 1 */
|
|
|
497 |
#define CCR2 TACCR2 /* Timer A Capture/Compare 2 */
|
|
|
498 |
#define CCTL0_ TACCTL0_ /* Timer A Capture/Compare Control 0 */
|
|
|
499 |
#define CCTL1_ TACCTL1_ /* Timer A Capture/Compare Control 1 */
|
|
|
500 |
#define CCTL2_ TACCTL2_ /* Timer A Capture/Compare Control 2 */
|
|
|
501 |
#define CCR0_ TACCR0_ /* Timer A Capture/Compare 0 */
|
|
|
502 |
#define CCR1_ TACCR1_ /* Timer A Capture/Compare 1 */
|
|
|
503 |
#define CCR2_ TACCR2_ /* Timer A Capture/Compare 2 */
|
|
|
504 |
|
|
|
505 |
#define TASSEL1 (0x0200) /* Timer A clock source select 0 */
|
|
|
506 |
#define TASSEL0 (0x0100) /* Timer A clock source select 1 */
|
|
|
507 |
#define ID1 (0x0080) /* Timer A clock input divider 1 */
|
|
|
508 |
#define ID0 (0x0040) /* Timer A clock input divider 0 */
|
|
|
509 |
#define MC1 (0x0020) /* Timer A mode control 1 */
|
|
|
510 |
#define MC0 (0x0010) /* Timer A mode control 0 */
|
|
|
511 |
#define TACLR (0x0004) /* Timer A counter clear */
|
|
|
512 |
#define TAIE (0x0002) /* Timer A counter interrupt enable */
|
|
|
513 |
#define TAIFG (0x0001) /* Timer A counter interrupt flag */
|
|
|
514 |
|
|
|
515 |
#define MC_0 (0*0x10u) /* Timer A mode control: 0 - Stop */
|
|
|
516 |
#define MC_1 (1*0x10u) /* Timer A mode control: 1 - Up to CCR0 */
|
|
|
517 |
#define MC_2 (2*0x10u) /* Timer A mode control: 2 - Continous up */
|
|
|
518 |
#define MC_3 (3*0x10u) /* Timer A mode control: 3 - Up/Down */
|
|
|
519 |
#define ID_0 (0*0x40u) /* Timer A input divider: 0 - /1 */
|
|
|
520 |
#define ID_1 (1*0x40u) /* Timer A input divider: 1 - /2 */
|
|
|
521 |
#define ID_2 (2*0x40u) /* Timer A input divider: 2 - /4 */
|
|
|
522 |
#define ID_3 (3*0x40u) /* Timer A input divider: 3 - /8 */
|
|
|
523 |
#define TASSEL_0 (0*0x100u) /* Timer A clock source select: 0 - TACLK */
|
|
|
524 |
#define TASSEL_1 (1*0x100u) /* Timer A clock source select: 1 - ACLK */
|
|
|
525 |
#define TASSEL_2 (2*0x100u) /* Timer A clock source select: 2 - SMCLK */
|
|
|
526 |
#define TASSEL_3 (3*0x100u) /* Timer A clock source select: 3 - INCLK */
|
|
|
527 |
|
|
|
528 |
#define CM1 (0x8000) /* Capture mode 1 */
|
|
|
529 |
#define CM0 (0x4000) /* Capture mode 0 */
|
|
|
530 |
#define CCIS1 (0x2000) /* Capture input select 1 */
|
|
|
531 |
#define CCIS0 (0x1000) /* Capture input select 0 */
|
|
|
532 |
#define SCS (0x0800) /* Capture sychronize */
|
|
|
533 |
#define SCCI (0x0400) /* Latched capture signal (read) */
|
|
|
534 |
#define CAP (0x0100) /* Capture mode: 1 /Compare mode : 0 */
|
|
|
535 |
#define OUTMOD2 (0x0080) /* Output mode 2 */
|
|
|
536 |
#define OUTMOD1 (0x0040) /* Output mode 1 */
|
|
|
537 |
#define OUTMOD0 (0x0020) /* Output mode 0 */
|
|
|
538 |
#define CCIE (0x0010) /* Capture/compare interrupt enable */
|
|
|
539 |
#define CCI (0x0008) /* Capture input signal (read) */
|
|
|
540 |
#define OUT (0x0004) /* PWM Output signal if output mode 0 */
|
|
|
541 |
#define COV (0x0002) /* Capture/compare overflow flag */
|
|
|
542 |
#define CCIFG (0x0001) /* Capture/compare interrupt flag */
|
|
|
543 |
|
|
|
544 |
#define OUTMOD_0 (0*0x20u) /* PWM output mode: 0 - output only */
|
|
|
545 |
#define OUTMOD_1 (1*0x20u) /* PWM output mode: 1 - set */
|
|
|
546 |
#define OUTMOD_2 (2*0x20u) /* PWM output mode: 2 - PWM toggle/reset */
|
|
|
547 |
#define OUTMOD_3 (3*0x20u) /* PWM output mode: 3 - PWM set/reset */
|
|
|
548 |
#define OUTMOD_4 (4*0x20u) /* PWM output mode: 4 - toggle */
|
|
|
549 |
#define OUTMOD_5 (5*0x20u) /* PWM output mode: 5 - Reset */
|
|
|
550 |
#define OUTMOD_6 (6*0x20u) /* PWM output mode: 6 - PWM toggle/set */
|
|
|
551 |
#define OUTMOD_7 (7*0x20u) /* PWM output mode: 7 - PWM reset/set */
|
|
|
552 |
#define CCIS_0 (0*0x1000u) /* Capture input select: 0 - CCIxA */
|
|
|
553 |
#define CCIS_1 (1*0x1000u) /* Capture input select: 1 - CCIxB */
|
|
|
554 |
#define CCIS_2 (2*0x1000u) /* Capture input select: 2 - GND */
|
|
|
555 |
#define CCIS_3 (3*0x1000u) /* Capture input select: 3 - Vcc */
|
|
|
556 |
#define CM_0 (0*0x4000u) /* Capture mode: 0 - disabled */
|
|
|
557 |
#define CM_1 (1*0x4000u) /* Capture mode: 1 - pos. edge */
|
|
|
558 |
#define CM_2 (2*0x4000u) /* Capture mode: 1 - neg. edge */
|
|
|
559 |
#define CM_3 (3*0x4000u) /* Capture mode: 1 - both edges */
|
|
|
560 |
|
|
|
561 |
/* T0_A3IV Definitions */
|
|
|
562 |
#define TA0IV_NONE (0x0000) /* No Interrupt pending */
|
|
|
563 |
#define TA0IV_TACCR1 (0x0002) /* TA0CCR1_CCIFG */
|
|
|
564 |
#define TA0IV_TACCR2 (0x0004) /* TA0CCR2_CCIFG */
|
|
|
565 |
#define TA0IV_6 (0x0006) /* Reserved */
|
|
|
566 |
#define TA0IV_8 (0x0008) /* Reserved */
|
|
|
567 |
#define TA0IV_TAIFG (0x000A) /* TA0IFG */
|
|
|
568 |
|
|
|
569 |
/************************************************************
|
|
|
570 |
* Timer1_A2
|
|
|
571 |
************************************************************/
|
|
|
572 |
#define __MSP430_HAS_T1A2__ /* Definition to show that Module is available */
|
|
|
573 |
|
|
|
574 |
SFR_16BIT(TA1IV); /* Timer1_A5 Interrupt Vector Word */
|
|
|
575 |
SFR_16BIT(TA1CTL); /* Timer1_A5 Control */
|
|
|
576 |
SFR_16BIT(TA1CCTL0); /* Timer1_A5 Capture/Compare Control 0 */
|
|
|
577 |
SFR_16BIT(TA1CCTL1); /* Timer1_A5 Capture/Compare Control 1 */
|
|
|
578 |
SFR_16BIT(TA1R); /* Timer1_A5 */
|
|
|
579 |
SFR_16BIT(TA1CCR0); /* Timer1_A5 Capture/Compare 0 */
|
|
|
580 |
SFR_16BIT(TA1CCR1); /* Timer1_A5 Capture/Compare 1 */
|
|
|
581 |
|
|
|
582 |
/* Bits are already defined within the Timer0_Ax */
|
|
|
583 |
|
|
|
584 |
/* T1_A2IV Definitions */
|
|
|
585 |
#define TA1IV_NONE (0x0000) /* No Interrupt pending */
|
|
|
586 |
#define TA1IV_TACCR1 (0x0002) /* TA1CCR1_CCIFG */
|
|
|
587 |
#define TA1IV_4 (0x0004) /* Reserved */
|
|
|
588 |
#define TA1IV_6 (0x0006) /* Reserved */
|
|
|
589 |
#define TA1IV_8 (0x0008) /* Reserved */
|
|
|
590 |
#define TA1IV_TAIFG (0x000A) /* TA1IFG */
|
|
|
591 |
|
|
|
592 |
/************************************************************
|
|
|
593 |
* USCI
|
|
|
594 |
************************************************************/
|
|
|
595 |
#define __MSP430_HAS_USCI__ /* Definition to show that Module is available */
|
|
|
596 |
|
|
|
597 |
SFR_8BIT(UCA0CTL0); /* USCI A0 Control Register 0 */
|
|
|
598 |
SFR_8BIT(UCA0CTL1); /* USCI A0 Control Register 1 */
|
|
|
599 |
SFR_8BIT(UCA0BR0); /* USCI A0 Baud Rate 0 */
|
|
|
600 |
SFR_8BIT(UCA0BR1); /* USCI A0 Baud Rate 1 */
|
|
|
601 |
SFR_8BIT(UCA0MCTL); /* USCI A0 Modulation Control */
|
|
|
602 |
SFR_8BIT(UCA0STAT); /* USCI A0 Status Register */
|
|
|
603 |
SFR_8BIT(UCA0RXBUF); /* USCI A0 Receive Buffer */
|
|
|
604 |
SFR_8BIT(UCA0TXBUF); /* USCI A0 Transmit Buffer */
|
|
|
605 |
SFR_8BIT(UCA0ABCTL); /* USCI A0 LIN Control */
|
|
|
606 |
SFR_8BIT(UCA0IRTCTL); /* USCI A0 IrDA Transmit Control */
|
|
|
607 |
SFR_8BIT(UCA0IRRCTL); /* USCI A0 IrDA Receive Control */
|
|
|
608 |
|
|
|
609 |
|
|
|
610 |
|
|
|
611 |
SFR_8BIT(UCB0CTL0); /* USCI B0 Control Register 0 */
|
|
|
612 |
SFR_8BIT(UCB0CTL1); /* USCI B0 Control Register 1 */
|
|
|
613 |
SFR_8BIT(UCB0BR0); /* USCI B0 Baud Rate 0 */
|
|
|
614 |
SFR_8BIT(UCB0BR1); /* USCI B0 Baud Rate 1 */
|
|
|
615 |
SFR_8BIT(UCB0I2CIE); /* USCI B0 I2C Interrupt Enable Register */
|
|
|
616 |
SFR_8BIT(UCB0STAT); /* USCI B0 Status Register */
|
|
|
617 |
SFR_8BIT(UCB0RXBUF); /* USCI B0 Receive Buffer */
|
|
|
618 |
SFR_8BIT(UCB0TXBUF); /* USCI B0 Transmit Buffer */
|
|
|
619 |
SFR_16BIT(UCB0I2COA); /* USCI B0 I2C Own Address */
|
|
|
620 |
SFR_16BIT(UCB0I2CSA); /* USCI B0 I2C Slave Address */
|
|
|
621 |
|
|
|
622 |
// UART-Mode Bits
|
|
|
623 |
#define UCPEN (0x80) /* Async. Mode: Parity enable */
|
|
|
624 |
#define UCPAR (0x40) /* Async. Mode: Parity 0:odd / 1:even */
|
|
|
625 |
#define UCMSB (0x20) /* Async. Mode: MSB first 0:LSB / 1:MSB */
|
|
|
626 |
#define UC7BIT (0x10) /* Async. Mode: Data Bits 0:8-bits / 1:7-bits */
|
|
|
627 |
#define UCSPB (0x08) /* Async. Mode: Stop Bits 0:one / 1: two */
|
|
|
628 |
#define UCMODE1 (0x04) /* Async. Mode: USCI Mode 1 */
|
|
|
629 |
#define UCMODE0 (0x02) /* Async. Mode: USCI Mode 0 */
|
|
|
630 |
#define UCSYNC (0x01) /* Sync-Mode 0:UART-Mode / 1:SPI-Mode */
|
|
|
631 |
|
|
|
632 |
// SPI-Mode Bits
|
|
|
633 |
#define UCCKPH (0x80) /* Sync. Mode: Clock Phase */
|
|
|
634 |
#define UCCKPL (0x40) /* Sync. Mode: Clock Polarity */
|
|
|
635 |
#define UCMST (0x08) /* Sync. Mode: Master Select */
|
|
|
636 |
|
|
|
637 |
// I2C-Mode Bits
|
|
|
638 |
#define UCA10 (0x80) /* 10-bit Address Mode */
|
|
|
639 |
#define UCSLA10 (0x40) /* 10-bit Slave Address Mode */
|
|
|
640 |
#define UCMM (0x20) /* Multi-Master Environment */
|
|
|
641 |
//#define res (0x10) /* reserved */
|
|
|
642 |
#define UCMODE_0 (0x00) /* Sync. Mode: USCI Mode: 0 */
|
|
|
643 |
#define UCMODE_1 (0x02) /* Sync. Mode: USCI Mode: 1 */
|
|
|
644 |
#define UCMODE_2 (0x04) /* Sync. Mode: USCI Mode: 2 */
|
|
|
645 |
#define UCMODE_3 (0x06) /* Sync. Mode: USCI Mode: 3 */
|
|
|
646 |
|
|
|
647 |
// UART-Mode Bits
|
|
|
648 |
#define UCSSEL1 (0x80) /* USCI 0 Clock Source Select 1 */
|
|
|
649 |
#define UCSSEL0 (0x40) /* USCI 0 Clock Source Select 0 */
|
|
|
650 |
#define UCRXEIE (0x20) /* RX Error interrupt enable */
|
|
|
651 |
#define UCBRKIE (0x10) /* Break interrupt enable */
|
|
|
652 |
#define UCDORM (0x08) /* Dormant (Sleep) Mode */
|
|
|
653 |
#define UCTXADDR (0x04) /* Send next Data as Address */
|
|
|
654 |
#define UCTXBRK (0x02) /* Send next Data as Break */
|
|
|
655 |
#define UCSWRST (0x01) /* USCI Software Reset */
|
|
|
656 |
|
|
|
657 |
// SPI-Mode Bits
|
|
|
658 |
//#define res (0x20) /* reserved */
|
|
|
659 |
//#define res (0x10) /* reserved */
|
|
|
660 |
//#define res (0x08) /* reserved */
|
|
|
661 |
//#define res (0x04) /* reserved */
|
|
|
662 |
//#define res (0x02) /* reserved */
|
|
|
663 |
|
|
|
664 |
// I2C-Mode Bits
|
|
|
665 |
//#define res (0x20) /* reserved */
|
|
|
666 |
#define UCTR (0x10) /* Transmit/Receive Select/Flag */
|
|
|
667 |
#define UCTXNACK (0x08) /* Transmit NACK */
|
|
|
668 |
#define UCTXSTP (0x04) /* Transmit STOP */
|
|
|
669 |
#define UCTXSTT (0x02) /* Transmit START */
|
|
|
670 |
#define UCSSEL_0 (0x00) /* USCI 0 Clock Source: 0 */
|
|
|
671 |
#define UCSSEL_1 (0x40) /* USCI 0 Clock Source: 1 */
|
|
|
672 |
#define UCSSEL_2 (0x80) /* USCI 0 Clock Source: 2 */
|
|
|
673 |
#define UCSSEL_3 (0xC0) /* USCI 0 Clock Source: 3 */
|
|
|
674 |
|
|
|
675 |
#define UCBRF3 (0x80) /* USCI First Stage Modulation Select 3 */
|
|
|
676 |
#define UCBRF2 (0x40) /* USCI First Stage Modulation Select 2 */
|
|
|
677 |
#define UCBRF1 (0x20) /* USCI First Stage Modulation Select 1 */
|
|
|
678 |
#define UCBRF0 (0x10) /* USCI First Stage Modulation Select 0 */
|
|
|
679 |
#define UCBRS2 (0x08) /* USCI Second Stage Modulation Select 2 */
|
|
|
680 |
#define UCBRS1 (0x04) /* USCI Second Stage Modulation Select 1 */
|
|
|
681 |
#define UCBRS0 (0x02) /* USCI Second Stage Modulation Select 0 */
|
|
|
682 |
#define UCOS16 (0x01) /* USCI 16-times Oversampling enable */
|
|
|
683 |
|
|
|
684 |
#define UCBRF_0 (0x00) /* USCI First Stage Modulation: 0 */
|
|
|
685 |
#define UCBRF_1 (0x10) /* USCI First Stage Modulation: 1 */
|
|
|
686 |
#define UCBRF_2 (0x20) /* USCI First Stage Modulation: 2 */
|
|
|
687 |
#define UCBRF_3 (0x30) /* USCI First Stage Modulation: 3 */
|
|
|
688 |
#define UCBRF_4 (0x40) /* USCI First Stage Modulation: 4 */
|
|
|
689 |
#define UCBRF_5 (0x50) /* USCI First Stage Modulation: 5 */
|
|
|
690 |
#define UCBRF_6 (0x60) /* USCI First Stage Modulation: 6 */
|
|
|
691 |
#define UCBRF_7 (0x70) /* USCI First Stage Modulation: 7 */
|
|
|
692 |
#define UCBRF_8 (0x80) /* USCI First Stage Modulation: 8 */
|
|
|
693 |
#define UCBRF_9 (0x90) /* USCI First Stage Modulation: 9 */
|
|
|
694 |
#define UCBRF_10 (0xA0) /* USCI First Stage Modulation: A */
|
|
|
695 |
#define UCBRF_11 (0xB0) /* USCI First Stage Modulation: B */
|
|
|
696 |
#define UCBRF_12 (0xC0) /* USCI First Stage Modulation: C */
|
|
|
697 |
#define UCBRF_13 (0xD0) /* USCI First Stage Modulation: D */
|
|
|
698 |
#define UCBRF_14 (0xE0) /* USCI First Stage Modulation: E */
|
|
|
699 |
#define UCBRF_15 (0xF0) /* USCI First Stage Modulation: F */
|
|
|
700 |
|
|
|
701 |
#define UCBRS_0 (0x00) /* USCI Second Stage Modulation: 0 */
|
|
|
702 |
#define UCBRS_1 (0x02) /* USCI Second Stage Modulation: 1 */
|
|
|
703 |
#define UCBRS_2 (0x04) /* USCI Second Stage Modulation: 2 */
|
|
|
704 |
#define UCBRS_3 (0x06) /* USCI Second Stage Modulation: 3 */
|
|
|
705 |
#define UCBRS_4 (0x08) /* USCI Second Stage Modulation: 4 */
|
|
|
706 |
#define UCBRS_5 (0x0A) /* USCI Second Stage Modulation: 5 */
|
|
|
707 |
#define UCBRS_6 (0x0C) /* USCI Second Stage Modulation: 6 */
|
|
|
708 |
#define UCBRS_7 (0x0E) /* USCI Second Stage Modulation: 7 */
|
|
|
709 |
|
|
|
710 |
#define UCLISTEN (0x80) /* USCI Listen mode */
|
|
|
711 |
#define UCFE (0x40) /* USCI Frame Error Flag */
|
|
|
712 |
#define UCOE (0x20) /* USCI Overrun Error Flag */
|
|
|
713 |
#define UCPE (0x10) /* USCI Parity Error Flag */
|
|
|
714 |
#define UCBRK (0x08) /* USCI Break received */
|
|
|
715 |
#define UCRXERR (0x04) /* USCI RX Error Flag */
|
|
|
716 |
#define UCADDR (0x02) /* USCI Address received Flag */
|
|
|
717 |
#define UCBUSY (0x01) /* USCI Busy Flag */
|
|
|
718 |
#define UCIDLE (0x02) /* USCI Idle line detected Flag */
|
|
|
719 |
|
|
|
720 |
//#define res (0x80) /* reserved */
|
|
|
721 |
//#define res (0x40) /* reserved */
|
|
|
722 |
//#define res (0x20) /* reserved */
|
|
|
723 |
//#define res (0x10) /* reserved */
|
|
|
724 |
#define UCNACKIE (0x08) /* NACK Condition interrupt enable */
|
|
|
725 |
#define UCSTPIE (0x04) /* STOP Condition interrupt enable */
|
|
|
726 |
#define UCSTTIE (0x02) /* START Condition interrupt enable */
|
|
|
727 |
#define UCALIE (0x01) /* Arbitration Lost interrupt enable */
|
|
|
728 |
|
|
|
729 |
#define UCSCLLOW (0x40) /* SCL low */
|
|
|
730 |
#define UCGC (0x20) /* General Call address received Flag */
|
|
|
731 |
#define UCBBUSY (0x10) /* Bus Busy Flag */
|
|
|
732 |
#define UCNACKIFG (0x08) /* NAK Condition interrupt Flag */
|
|
|
733 |
#define UCSTPIFG (0x04) /* STOP Condition interrupt Flag */
|
|
|
734 |
#define UCSTTIFG (0x02) /* START Condition interrupt Flag */
|
|
|
735 |
#define UCALIFG (0x01) /* Arbitration Lost interrupt Flag */
|
|
|
736 |
|
|
|
737 |
#define UCIRTXPL5 (0x80) /* IRDA Transmit Pulse Length 5 */
|
|
|
738 |
#define UCIRTXPL4 (0x40) /* IRDA Transmit Pulse Length 4 */
|
|
|
739 |
#define UCIRTXPL3 (0x20) /* IRDA Transmit Pulse Length 3 */
|
|
|
740 |
#define UCIRTXPL2 (0x10) /* IRDA Transmit Pulse Length 2 */
|
|
|
741 |
#define UCIRTXPL1 (0x08) /* IRDA Transmit Pulse Length 1 */
|
|
|
742 |
#define UCIRTXPL0 (0x04) /* IRDA Transmit Pulse Length 0 */
|
|
|
743 |
#define UCIRTXCLK (0x02) /* IRDA Transmit Pulse Clock Select */
|
|
|
744 |
#define UCIREN (0x01) /* IRDA Encoder/Decoder enable */
|
|
|
745 |
|
|
|
746 |
#define UCIRRXFL5 (0x80) /* IRDA Receive Filter Length 5 */
|
|
|
747 |
#define UCIRRXFL4 (0x40) /* IRDA Receive Filter Length 4 */
|
|
|
748 |
#define UCIRRXFL3 (0x20) /* IRDA Receive Filter Length 3 */
|
|
|
749 |
#define UCIRRXFL2 (0x10) /* IRDA Receive Filter Length 2 */
|
|
|
750 |
#define UCIRRXFL1 (0x08) /* IRDA Receive Filter Length 1 */
|
|
|
751 |
#define UCIRRXFL0 (0x04) /* IRDA Receive Filter Length 0 */
|
|
|
752 |
#define UCIRRXPL (0x02) /* IRDA Receive Input Polarity */
|
|
|
753 |
#define UCIRRXFE (0x01) /* IRDA Receive Filter enable */
|
|
|
754 |
|
|
|
755 |
//#define res (0x80) /* reserved */
|
|
|
756 |
//#define res (0x40) /* reserved */
|
|
|
757 |
#define UCDELIM1 (0x20) /* Break Sync Delimiter 1 */
|
|
|
758 |
#define UCDELIM0 (0x10) /* Break Sync Delimiter 0 */
|
|
|
759 |
#define UCSTOE (0x08) /* Sync-Field Timeout error */
|
|
|
760 |
#define UCBTOE (0x04) /* Break Timeout error */
|
|
|
761 |
//#define res (0x02) /* reserved */
|
|
|
762 |
#define UCABDEN (0x01) /* Auto Baud Rate detect enable */
|
|
|
763 |
|
|
|
764 |
#define UCGCEN (0x8000) /* I2C General Call enable */
|
|
|
765 |
#define UCOA9 (0x0200) /* I2C Own Address 9 */
|
|
|
766 |
#define UCOA8 (0x0100) /* I2C Own Address 8 */
|
|
|
767 |
#define UCOA7 (0x0080) /* I2C Own Address 7 */
|
|
|
768 |
#define UCOA6 (0x0040) /* I2C Own Address 6 */
|
|
|
769 |
#define UCOA5 (0x0020) /* I2C Own Address 5 */
|
|
|
770 |
#define UCOA4 (0x0010) /* I2C Own Address 4 */
|
|
|
771 |
#define UCOA3 (0x0008) /* I2C Own Address 3 */
|
|
|
772 |
#define UCOA2 (0x0004) /* I2C Own Address 2 */
|
|
|
773 |
#define UCOA1 (0x0002) /* I2C Own Address 1 */
|
|
|
774 |
#define UCOA0 (0x0001) /* I2C Own Address 0 */
|
|
|
775 |
|
|
|
776 |
#define UCSA9 (0x0200) /* I2C Slave Address 9 */
|
|
|
777 |
#define UCSA8 (0x0100) /* I2C Slave Address 8 */
|
|
|
778 |
#define UCSA7 (0x0080) /* I2C Slave Address 7 */
|
|
|
779 |
#define UCSA6 (0x0040) /* I2C Slave Address 6 */
|
|
|
780 |
#define UCSA5 (0x0020) /* I2C Slave Address 5 */
|
|
|
781 |
#define UCSA4 (0x0010) /* I2C Slave Address 4 */
|
|
|
782 |
#define UCSA3 (0x0008) /* I2C Slave Address 3 */
|
|
|
783 |
#define UCSA2 (0x0004) /* I2C Slave Address 2 */
|
|
|
784 |
#define UCSA1 (0x0002) /* I2C Slave Address 1 */
|
|
|
785 |
#define UCSA0 (0x0001) /* I2C Slave Address 0 */
|
|
|
786 |
|
|
|
787 |
/************************************************************
|
|
|
788 |
* WATCHDOG TIMER
|
|
|
789 |
************************************************************/
|
|
|
790 |
#define __MSP430_HAS_WDT__ /* Definition to show that Module is available */
|
|
|
791 |
|
|
|
792 |
SFR_16BIT(WDTCTL); /* Watchdog Timer Control */
|
|
|
793 |
/* The bit names have been prefixed with "WDT" */
|
|
|
794 |
#define WDTIS0 (0x0001)
|
|
|
795 |
#define WDTIS1 (0x0002)
|
|
|
796 |
#define WDTSSEL (0x0004)
|
|
|
797 |
#define WDTCNTCL (0x0008)
|
|
|
798 |
#define WDTTMSEL (0x0010)
|
|
|
799 |
#define WDTNMI (0x0020)
|
|
|
800 |
#define WDTNMIES (0x0040)
|
|
|
801 |
#define WDTHOLD (0x0080)
|
|
|
802 |
|
|
|
803 |
#define WDTPW (0x5A00)
|
|
|
804 |
|
|
|
805 |
/* WDT-interval times [1ms] coded with Bits 0-2 */
|
|
|
806 |
/* WDT is clocked by fSMCLK (assumed 1MHz) */
|
|
|
807 |
#define WDT_MDLY_32 (WDTPW+WDTTMSEL+WDTCNTCL) /* 32ms interval (default) */
|
|
|
808 |
#define WDT_MDLY_8 (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS0) /* 8ms " */
|
|
|
809 |
#define WDT_MDLY_0_5 (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS1) /* 0.5ms " */
|
|
|
810 |
#define WDT_MDLY_0_064 (WDTPW+WDTTMSEL+WDTCNTCL+WDTIS1+WDTIS0) /* 0.064ms " */
|
|
|
811 |
/* WDT is clocked by fACLK (assumed 32KHz) */
|
|
|
812 |
#define WDT_ADLY_1000 (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL) /* 1000ms " */
|
|
|
813 |
#define WDT_ADLY_250 (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS0) /* 250ms " */
|
|
|
814 |
#define WDT_ADLY_16 (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS1) /* 16ms " */
|
|
|
815 |
#define WDT_ADLY_1_9 (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS1+WDTIS0) /* 1.9ms " */
|
|
|
816 |
/* Watchdog mode -> reset after expired time */
|
|
|
817 |
/* WDT is clocked by fSMCLK (assumed 1MHz) */
|
|
|
818 |
#define WDT_MRST_32 (WDTPW+WDTCNTCL) /* 32ms interval (default) */
|
|
|
819 |
#define WDT_MRST_8 (WDTPW+WDTCNTCL+WDTIS0) /* 8ms " */
|
|
|
820 |
#define WDT_MRST_0_5 (WDTPW+WDTCNTCL+WDTIS1) /* 0.5ms " */
|
|
|
821 |
#define WDT_MRST_0_064 (WDTPW+WDTCNTCL+WDTIS1+WDTIS0) /* 0.064ms " */
|
|
|
822 |
/* WDT is clocked by fACLK (assumed 32KHz) */
|
|
|
823 |
#define WDT_ARST_1000 (WDTPW+WDTCNTCL+WDTSSEL) /* 1000ms " */
|
|
|
824 |
#define WDT_ARST_250 (WDTPW+WDTCNTCL+WDTSSEL+WDTIS0) /* 250ms " */
|
|
|
825 |
#define WDT_ARST_16 (WDTPW+WDTCNTCL+WDTSSEL+WDTIS1) /* 16ms " */
|
|
|
826 |
#define WDT_ARST_1_9 (WDTPW+WDTCNTCL+WDTSSEL+WDTIS1+WDTIS0) /* 1.9ms " */
|
|
|
827 |
|
|
|
828 |
/* INTERRUPT CONTROL */
|
|
|
829 |
/* These two bits are defined in the Special Function Registers */
|
|
|
830 |
/* #define WDTIE 0x01 */
|
|
|
831 |
/* #define WDTIFG 0x01 */
|
|
|
832 |
|
|
|
833 |
/************************************************************
|
|
|
834 |
* Calibration Data in Info Mem
|
|
|
835 |
************************************************************/
|
|
|
836 |
|
|
|
837 |
/* TLV Calibration Data Structure */
|
|
|
838 |
#define TAG_DCO_30 (0x01) /* Tag for DCO30 Calibration Data */
|
|
|
839 |
#define TAG_ADC10_1 (0x08) /* Tag for ADC10_1 Calibration Data */
|
|
|
840 |
#define TAG_EMPTY (0xFE) /* Tag for Empty Data Field in Calibration Data */
|
|
|
841 |
|
|
|
842 |
#ifndef __DisableCalData
|
|
|
843 |
SFR_16BIT(TLV_CHECKSUM); /* TLV CHECK SUM */
|
|
|
844 |
SFR_8BIT(TLV_DCO_30_TAG); /* TLV TAG_DCO30 TAG */
|
|
|
845 |
SFR_8BIT(TLV_DCO_30_LEN); /* TLV TAG_DCO30 LEN */
|
|
|
846 |
SFR_8BIT(TLV_ADC10_1_TAG); /* TLV ADC10_1 TAG */
|
|
|
847 |
SFR_8BIT(TLV_ADC10_1_LEN); /* TLV ADC10_1 LEN */
|
|
|
848 |
#endif
|
|
|
849 |
|
|
|
850 |
#define CAL_ADC_25T85 (0x0007) /* Index for 2.5V/85Deg Cal. Value */
|
|
|
851 |
#define CAL_ADC_25T30 (0x0006) /* Index for 2.5V/30Deg Cal. Value */
|
|
|
852 |
#define CAL_ADC_25VREF_FACTOR (0x0005) /* Index for 2.5V Ref. Factor */
|
|
|
853 |
#define CAL_ADC_15T85 (0x0004) /* Index for 1.5V/85Deg Cal. Value */
|
|
|
854 |
#define CAL_ADC_15T30 (0x0003) /* Index for 1.5V/30Deg Cal. Value */
|
|
|
855 |
#define CAL_ADC_15VREF_FACTOR (0x0002) /* Index for ADC 1.5V Ref. Factor */
|
|
|
856 |
#define CAL_ADC_OFFSET (0x0001) /* Index for ADC Offset */
|
|
|
857 |
#define CAL_ADC_GAIN_FACTOR (0x0000) /* Index for ADC Gain Factor */
|
|
|
858 |
|
|
|
859 |
#define CAL_DCO_16MHZ (0x0000) /* Index for DCOCTL Calibration Data for 16MHz */
|
|
|
860 |
#define CAL_BC1_16MHZ (0x0001) /* Index for BCSCTL1 Calibration Data for 16MHz */
|
|
|
861 |
#define CAL_DCO_12MHZ (0x0002) /* Index for DCOCTL Calibration Data for 12MHz */
|
|
|
862 |
#define CAL_BC1_12MHZ (0x0003) /* Index for BCSCTL1 Calibration Data for 12MHz */
|
|
|
863 |
#define CAL_DCO_8MHZ (0x0004) /* Index for DCOCTL Calibration Data for 8MHz */
|
|
|
864 |
#define CAL_BC1_8MHZ (0x0005) /* Index for BCSCTL1 Calibration Data for 8MHz */
|
|
|
865 |
#define CAL_DCO_1MHZ (0x0006) /* Index for DCOCTL Calibration Data for 1MHz */
|
|
|
866 |
#define CAL_BC1_1MHZ (0x0007) /* Index for BCSCTL1 Calibration Data for 1MHz */
|
|
|
867 |
|
|
|
868 |
|
|
|
869 |
/************************************************************
|
|
|
870 |
* Calibration Data in Info Mem
|
|
|
871 |
************************************************************/
|
|
|
872 |
|
|
|
873 |
#ifndef __DisableCalData
|
|
|
874 |
|
|
|
875 |
SFR_8BIT(CALDCO_16MHZ); /* DCOCTL Calibration Data for 16MHz */
|
|
|
876 |
SFR_8BIT(CALBC1_16MHZ); /* BCSCTL1 Calibration Data for 16MHz */
|
|
|
877 |
SFR_8BIT(CALDCO_12MHZ); /* DCOCTL Calibration Data for 12MHz */
|
|
|
878 |
SFR_8BIT(CALBC1_12MHZ); /* BCSCTL1 Calibration Data for 12MHz */
|
|
|
879 |
SFR_8BIT(CALDCO_8MHZ); /* DCOCTL Calibration Data for 8MHz */
|
|
|
880 |
SFR_8BIT(CALBC1_8MHZ); /* BCSCTL1 Calibration Data for 8MHz */
|
|
|
881 |
SFR_8BIT(CALDCO_1MHZ); /* DCOCTL Calibration Data for 1MHz */
|
|
|
882 |
SFR_8BIT(CALBC1_1MHZ); /* BCSCTL1 Calibration Data for 1MHz */
|
|
|
883 |
|
|
|
884 |
#endif /* #ifndef __DisableCalData */
|
|
|
885 |
|
|
|
886 |
/************************************************************
|
|
|
887 |
* Interrupt Vectors (offset from 0xFFE0)
|
|
|
888 |
************************************************************/
|
|
|
889 |
|
|
|
890 |
#define VECTOR_NAME(name) name##_ptr
|
|
|
891 |
#define EMIT_PRAGMA(x) _Pragma(#x)
|
|
|
892 |
#define CREATE_VECTOR(name) void (* const VECTOR_NAME(name))(void) = &name
|
|
|
893 |
#define PLACE_VECTOR(vector,section) EMIT_PRAGMA(DATA_SECTION(vector,section))
|
|
|
894 |
#define ISR_VECTOR(func,offset) CREATE_VECTOR(func); \
|
|
|
895 |
PLACE_VECTOR(VECTOR_NAME(func), offset)
|
|
|
896 |
|
|
|
897 |
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
|
|
|
898 |
#define PORT1_VECTOR ".int02" /* 0xFFE4 Port 1 */
|
|
|
899 |
#else
|
|
|
900 |
#define PORT1_VECTOR (2 * 1u) /* 0xFFE4 Port 1 */
|
|
|
901 |
/*#define PORT1_ISR(func) ISR_VECTOR(func, ".int02") */ /* 0xFFE4 Port 1 */ /* CCE V2 Style */
|
|
|
902 |
#endif
|
|
|
903 |
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
|
|
|
904 |
#define PORT2_VECTOR ".int03" /* 0xFFE6 Port 2 */
|
|
|
905 |
#else
|
|
|
906 |
#define PORT2_VECTOR (3 * 1u) /* 0xFFE6 Port 2 */
|
|
|
907 |
/*#define PORT2_ISR(func) ISR_VECTOR(func, ".int03") */ /* 0xFFE6 Port 2 */ /* CCE V2 Style */
|
|
|
908 |
#endif
|
|
|
909 |
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
|
|
|
910 |
#define ADC10_VECTOR ".int05" /* 0xFFEA ADC10 */
|
|
|
911 |
#else
|
|
|
912 |
#define ADC10_VECTOR (5 * 1u) /* 0xFFEA ADC10 */
|
|
|
913 |
/*#define ADC10_ISR(func) ISR_VECTOR(func, ".int05") */ /* 0xFFEA ADC10 */ /* CCE V2 Style */
|
|
|
914 |
#endif
|
|
|
915 |
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
|
|
|
916 |
#define USCIAB0TX_VECTOR ".int06" /* 0xFFEC USCI A0/B0 Transmit */
|
|
|
917 |
#else
|
|
|
918 |
#define USCIAB0TX_VECTOR (6 * 1u) /* 0xFFEC USCI A0/B0 Transmit */
|
|
|
919 |
/*#define USCIAB0TX_ISR(func) ISR_VECTOR(func, ".int06") */ /* 0xFFEC USCI A0/B0 Transmit */ /* CCE V2 Style */
|
|
|
920 |
#endif
|
|
|
921 |
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
|
|
|
922 |
#define USCIAB0RX_VECTOR ".int07" /* 0xFFEE USCI A0/B0 Receive */
|
|
|
923 |
#else
|
|
|
924 |
#define USCIAB0RX_VECTOR (7 * 1u) /* 0xFFEE USCI A0/B0 Receive */
|
|
|
925 |
/*#define USCIAB0RX_ISR(func) ISR_VECTOR(func, ".int07") */ /* 0xFFEE USCI A0/B0 Receive */ /* CCE V2 Style */
|
|
|
926 |
#endif
|
|
|
927 |
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
|
|
|
928 |
#define TIMER0_A1_VECTOR ".int08" /* 0xFFF0 Timer0 A CC1-2, TA */
|
|
|
929 |
#else
|
|
|
930 |
#define TIMER0_A1_VECTOR (8 * 1u) /* 0xFFF0 Timer0 A CC1-2, TA */
|
|
|
931 |
/*#define TIMER0_A1_ISR(func) ISR_VECTOR(func, ".int08") */ /* 0xFFF0 Timer0 A CC1-2, TA */ /* CCE V2 Style */
|
|
|
932 |
#endif
|
|
|
933 |
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
|
|
|
934 |
#define TIMER0_A0_VECTOR ".int09" /* 0xFFF2 Timer0 A CC0 */
|
|
|
935 |
#else
|
|
|
936 |
#define TIMER0_A0_VECTOR (9 * 1u) /* 0xFFF2 Timer0 A CC0 */
|
|
|
937 |
/*#define TIMER0_A0_ISR(func) ISR_VECTOR(func, ".int09") */ /* 0xFFF2 Timer0 A CC0 */ /* CCE V2 Style */
|
|
|
938 |
#endif
|
|
|
939 |
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
|
|
|
940 |
#define WDT_VECTOR ".int10" /* 0xFFF4 Watchdog Timer */
|
|
|
941 |
#else
|
|
|
942 |
#define WDT_VECTOR (10 * 1u) /* 0xFFF4 Watchdog Timer */
|
|
|
943 |
/*#define WDT_ISR(func) ISR_VECTOR(func, ".int10") */ /* 0xFFF4 Watchdog Timer */ /* CCE V2 Style */
|
|
|
944 |
#endif
|
|
|
945 |
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
|
|
|
946 |
#define COMPARATORA_VECTOR ".int11" /* 0xFFF6 Comparator A */
|
|
|
947 |
#else
|
|
|
948 |
#define COMPARATORA_VECTOR (11 * 1u) /* 0xFFF6 Comparator A */
|
|
|
949 |
/*#define COMPARATORA_ISR(func) ISR_VECTOR(func, ".int11") */ /* 0xFFF6 Comparator A */ /* CCE V2 Style */
|
|
|
950 |
#endif
|
|
|
951 |
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
|
|
|
952 |
#define TIMER1_A1_VECTOR ".int12" /* 0xFFF8 Timer1 A CC1-2, TA */
|
|
|
953 |
#else
|
|
|
954 |
#define TIMER1_A1_VECTOR (12 * 1u) /* 0xFFF8 Timer1 A CC1-2, TA */
|
|
|
955 |
/*#define TIMER1_A1_ISR(func) ISR_VECTOR(func, ".int12") */ /* 0xFFF8 Timer1 A CC1-2, TA */ /* CCE V2 Style */
|
|
|
956 |
#endif
|
|
|
957 |
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
|
|
|
958 |
#define TIMER1_A0_VECTOR ".int13" /* 0xFFFA Timer1 A CC0 */
|
|
|
959 |
#else
|
|
|
960 |
#define TIMER1_A0_VECTOR (13 * 1u) /* 0xFFFA Timer1 A CC0 */
|
|
|
961 |
/*#define TIMER1_A0_ISR(func) ISR_VECTOR(func, ".int13") */ /* 0xFFFA Timer1 A CC0 */ /* CCE V2 Style */
|
|
|
962 |
#endif
|
|
|
963 |
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
|
|
|
964 |
#define NMI_VECTOR ".int14" /* 0xFFFC Non-maskable */
|
|
|
965 |
#else
|
|
|
966 |
#define NMI_VECTOR (14 * 1u) /* 0xFFFC Non-maskable */
|
|
|
967 |
/*#define NMI_ISR(func) ISR_VECTOR(func, ".int14") */ /* 0xFFFC Non-maskable */ /* CCE V2 Style */
|
|
|
968 |
#endif
|
|
|
969 |
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
|
|
|
970 |
#define RESET_VECTOR ".reset" /* 0xFFFE Reset [Highest Priority] */
|
|
|
971 |
#else
|
|
|
972 |
#define RESET_VECTOR (15 * 1u) /* 0xFFFE Reset [Highest Priority] */
|
|
|
973 |
/*#define RESET_ISR(func) ISR_VECTOR(func, ".int15") */ /* 0xFFFE Reset [Highest Priority] */ /* CCE V2 Style */
|
|
|
974 |
#endif
|
|
|
975 |
|
|
|
976 |
/************************************************************
|
|
|
977 |
* End of Modules
|
|
|
978 |
************************************************************/
|
|
|
979 |
|
|
|
980 |
#ifdef __cplusplus
|
|
|
981 |
}
|
|
|
982 |
#endif /* extern "C" */
|
|
|
983 |
|
|
|
984 |
#endif /* #ifndef __msp430x21x2 */
|