MSP430 DLL API Documentation  3.14.0.0
MSP430_Debug.h
Go to the documentation of this file.
1 /*
2  * MSP430_Debug.h
3  *
4  * API for accessing debugging functionality of MSP430 library.
5  *
6  * Copyright (c) 2004 - 2016 Texas Instruments Incorporated - http://www.ti.com/
7  *
8  * All rights reserved not granted herein.
9  * Limited License.
10  *
11  * Texas Instruments Incorporated grants a world-wide, royalty-free,
12  * non-exclusive license under copyrights and patents it now or hereafter
13  * owns or controls to make, have made, use, import, offer to sell and sell ("Utilize")
14  * this software subject to the terms herein. With respect to the foregoing patent
15  * license, such license is granted solely to the extent that any such patent is necessary
16  * to Utilize the software alone. The patent license shall not apply to any combinations which
17  * include this software, other than combinations with devices manufactured by or for TI (“TI Devices”).
18  * No hardware patent is licensed hereunder.
19  *
20  * Redistributions must preserve existing copyright notices and reproduce this license (including the
21  * above copyright notice and the disclaimer and (if applicable) source code license limitations below)
22  * in the documentation and/or other materials provided with the distribution
23  *
24  * Redistribution and use in binary form, without modification, are permitted provided that the following
25  * conditions are met:
26  *
27  * * No reverse engineering, decompilation, or disassembly of this software is permitted with respect to any
28  * software provided in binary form.
29  * * any redistribution and use are licensed by TI for use only with TI Devices.
30  * * Nothing shall obligate TI to provide you with source code for the software licensed and provided to you in object code.
31  *
32  * If software source code is provided to you, modification and redistribution of the source code are permitted
33  * provided that the following conditions are met:
34  *
35  * * any redistribution and use of the source code, including any resulting derivative works, are licensed by
36  * TI for use only with TI Devices.
37  * * any redistribution and use of any object code compiled from the source code and any resulting derivative
38  * works, are licensed by TI for use only with TI Devices.
39  *
40  * Neither the name of Texas Instruments Incorporated nor the names of its suppliers may be used to endorse or
41  * promote products derived from this software without specific prior written permission.
42  *
43  * DISCLAIMER.
44  *
45  * THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
46  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
47  * IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
48  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
49  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
50  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
51  * POSSIBILITY OF SUCH DAMAGE.
52  */
53 
88 #ifndef MSP430_DEBUG_H
89 #define MSP430_DEBUG_H
90 
91 #include "MSP430.h"
92 
93 #if defined(__cplusplus)
94 extern "C" {
95 #endif
96 
97 #ifndef MSP430_DEBUG_TYPES
98 #define MSP430_DEBUG_TYPES
99 
101 #undef R0
102 #undef R1
103 #undef R2
104 #undef R3
105 #undef R4
106 #undef R5
107 #undef R6
108 #undef R7
109 #undef R8
110 #undef R9
111 #undef R10
112 #undef R11
113 #undef R12
114 #undef R13
115 #undef R14
116 #undef R15
117 #undef PC
118 #undef SP
119 #undef SR
120 #undef CG1
121 #undef CG2
122 #undef VCC
123 
125 typedef enum DEVICE_REGISTERS {
126  R0 = 0,
127  R1 = 1,
128  R2 = 2,
129  R3 = 3,
130  R4 = 4,
131  R5 = 5,
132  R6 = 6,
133  R7 = 7,
134  R8 = 8,
135  R9 = 9,
136  R10 = 10,
137  R11 = 11,
138  R12 = 12,
139  R13 = 13,
140  R14 = 14,
141  R15 = 15,
142  xPSR = 16,
144  MSP_SP = 18,
145  PSP_SP = 19
147 
148 // ToDo Remove check with IAR
149 #define PC R0
150 #define SP R1
151 #define SR R2
152 #define CG1 R2
153 #define CG2 R3
154 
156 #define MASKREG(REG) (1 << REG)
157 #define ALL_REGS 0xffffffff
159 
161 typedef enum RUN_MODES {
162  FREE_RUN = 1,
165 } RUN_MODES_t;
166 
168 typedef enum STATE_MODES {
169  STOPPED = 0,
170  RUNNING = 1,
175 } STATE_MODES_t;
176 
178 typedef enum EMEX_MODE {
182  EMEX_LOW = 1,
197 
198 
199 } EMEX_MODE_t;
200 
202 typedef enum DEVICE_CLOCK_CONTROL {
203  GCC_NONE = 0,
208 
209 #if ! defined(uController)
210 typedef struct EEM_GCLKCTRL {
215  const char* GENCLKCTRLF;
216  const char* GENCLKCTRLE;
217  const char* GENCLKCTRLD;
218  const char* GENCLKCTRLC;
219  const char* GENCLKCTRLB;
220  const char* GENCLKCTRLA;
221  const char* GENCLKCTRL9;
222  const char* GENCLKCTRL8;
223  const char* GENCLKCTRL7;
224  const char* GENCLKCTRL6;
225  const char* GENCLKCTRL5;
226  const char* GENCLKCTRL4;
227  const char* GENCLKCTRL3;
228  const char* GENCLKCTRL2;
229  const char* GENCLKCTRL1;
230  const char* GENCLKCTRL0;
231 } EemGclkCtrl_t;
232 
236 typedef struct EEM_MCLKCTRL {
238  const char* MCLKCTRL0F;
239  const char* MCLKCTRL0E;
240  const char* MCLKCTRL0D;
241  const char* MCLKCTRL0C;
242  const char* MCLKCTRL0B;
243  const char* MCLKCTRL0A;
244  const char* MCLKCTRL09;
245  const char* MCLKCTRL08;
246  const char* MCLKCTRL07;
247  const char* MCLKCTRL06;
248  const char* MCLKCTRL05;
249  const char* MCLKCTRL04;
250  const char* MCLKCTRL03;
251  const char* MCLKCTRL02;
252  const char* MCLKCTRL01;
253  const char* MCLKCTRL00;
254 
256  const char* MCLKCTRL1F;
257  const char* MCLKCTRL1E;
258  const char* MCLKCTRL1D;
259  const char* MCLKCTRL1C;
260  const char* MCLKCTRL1B;
261  const char* MCLKCTRL1A;
262  const char* MCLKCTRL19;
263  const char* MCLKCTRL18;
264  const char* MCLKCTRL17;
265  const char* MCLKCTRL16;
266  const char* MCLKCTRL15;
267  const char* MCLKCTRL14;
268  const char* MCLKCTRL13;
269  const char* MCLKCTRL12;
270  const char* MCLKCTRL11;
271  const char* MCLKCTRL10;
272 } EemMclkCtrl_t;
273 #endif // end of def uController
274 
284 #define TCE_SMCLK (1 << 0)
286 #define ST_ACLK (1 << 1)
287 #define ST_SMCLK (1 << 2)
288 #define TCE_MCLK (1 << 3)
289 #define JT_FLLO (1 << 4)
290 #define ST_TACLK (1 << 5)
292 #define ECLK_SYN (1 << 0)
294 //#define ST_ACLK (1 << 1)
295 //#define ST_SMCLK (1 << 2)
296 #define ST_MCLK (1 << 3)
297 //#define JT_FLLO (1 << 4)
298 #define FORCE_SYN (1 << 5)
320 #define EEM_EN (1 << 0)
323 #define CLEAR_STOP (1 << 1)
325 #define EMU_CLK_EN (1 << 2)
327 #define EMU_FEAT_EN (1 << 3)
329 #define DEB_TRIG_LATCH (1 << 4)
331 
334 #define EEM_STOPPED (1 << 7)
335 
337 #define EMU_MODE_F44X_100 0x0000
338 #define EMU_MODE_F43X_100 0x4000
340 #define EMU_MODE_F4XX_64 0x5000
342 #define EMU_MODE_F4XX_80 0x6000
344 
345 #endif /* MSP430_DEBUG_TYPES */
346 
371 DLL430_SYMBOL STATUS_T WINAPI MSP430_Registers(int32_t* registers, int32_t mask, int32_t rw);
372 
373 #define MSP430_Read_Registers(REGISTERS, MASK) MSP430_Registers(REGISTERS, MASK, READ)
374 #define MSP430_Write_Registers(REGISTERS, MASK) MSP430_Registers(REGISTERS, MASK, WRITE)
375 
392 DLL430_SYMBOL STATUS_T WINAPI MSP430_ExtRegisters(int32_t address, uint8_t* buffer, int32_t count, int32_t rw);
393 
394 #define MSP430_Read_ExtRegister(ADDRESS, BUFFER) MSP430_ExtRegisters(ADDRESS, BUFFER,1 ,READ)
395 #define MSP430_Write_ExtRegister(ADDRESS, BUFFER) MSP430_ExtRegisters(ADDRESS, BUFFER, 1, WRITE)
396 
420 DLL430_SYMBOL STATUS_T WINAPI MSP430_Register(int32_t* reg, int32_t regNb, int32_t rw);
421 
422 #define MSP430_Read_Register(REG, REGNB) MSP430_Register(REG, REGNB, READ)
423 #define MSP430_Write_Register(REG, REGNB) MSP430_Register(REG, REGNB, WRITE)
424 
425 
456 DLL430_SYMBOL STATUS_T WINAPI MSP430_Run(int32_t mode, int32_t releaseJTAG);
457 
495 DLL430_SYMBOL STATUS_T WINAPI MSP430_State(int32_t* state, int32_t stop, int32_t* pCPUCycles);
496 
497 
523 #ifndef uController
524 DLL430_SYMBOL STATUS_T WINAPI MSP430_CcGetClockNames(int32_t localDeviceId, EemGclkCtrl_t** CcClockNames);
525 #endif
526 
527 
553 #if ! defined(uController)
554 DLL430_SYMBOL STATUS_T WINAPI MSP430_CcGetModuleNames(int32_t localDeviceId, EemMclkCtrl_t** CcModuleNames);
555 #endif
556 
557 
558 
559 #if defined(__cplusplus)
560 }
561 #endif
562 
563 #endif // MSP430_DEBUG_H
Definition: MSP430_Debug.h:142
Device Emex module has 2 breakpoints and range comparison.
Definition: MSP430_Debug.h:188
Definition: MSP430_Debug.h:138
const char * GENCLKCTRL4
Definition: MSP430_Debug.h:226
Device Emex module has eight breakpoints, range comparison, state storage, and trigger sequencer...
Definition: MSP430_Debug.h:186
Definition: MSP430_Debug.h:144
DEVICE_REGISTERS
Temporary work-around to #defines in stdconst.h (and others)
Definition: MSP430_Debug.h:125
const char * MCLKCTRL09
Definition: MSP430_Debug.h:244
Definition: MSP430_Debug.h:139
const char * MCLKCTRL07
Definition: MSP430_Debug.h:246
RUN_MODES
Run modes.
Definition: MSP430_Debug.h:161
const char * MCLKCTRL1A
Definition: MSP430_Debug.h:261
Definition: MSP430_Debug.h:206
const char * MCLKCTRL00
Definition: MSP430_Debug.h:253
Definition: MSP430_Debug.h:196
Definition: MSP430_Debug.h:140
const char * MCLKCTRL17
Definition: MSP430_Debug.h:264
DLL430_SYMBOL STATUS_T WINAPI MSP430_State(int32_t *state, int32_t stop, int32_t *pCPUCycles)
Determine the state of the device. The device is optionally stopped. During single step operations...
enum DEVICE_REGISTERS DEVICE_REGISTERS_t
Temporary work-around to #defines in stdconst.h (and others)
This file contains the Application Programming Interface (API) to access an MSP430 microcontroller vi...
Definition: MSP430_Debug.h:130
Device Emex module has 4 breakpoints and range comparison.
Definition: MSP430_Debug.h:190
Definition: MSP430_Debug.h:131
Definition: MSP430_Debug.h:195
const char * MCLKCTRL04
Definition: MSP430_Debug.h:249
const char * GENCLKCTRLB
Definition: MSP430_Debug.h:219
const char * MCLKCTRL15
Definition: MSP430_Debug.h:266
enum RUN_MODES RUN_MODES_t
Run modes.
const char * MCLKCTRL1F
MCLKCTRL1F to MCLKCTRL10 reflect the bit description strings for MCLKCTRL1.
Definition: MSP430_Debug.h:256
const char * MCLKCTRL08
Definition: MSP430_Debug.h:245
Definition: MSP430_Debug.h:136
Device has no Emex module.
Definition: MSP430_Debug.h:180
Definition: MSP430_Debug.h:171
DLL430_SYMBOL STATUS_T WINAPI MSP430_Registers(int32_t *registers, int32_t mask, int32_t rw)
const char * GENCLKCTRL0
Definition: MSP430_Debug.h:230
const char * MCLKCTRL03
Definition: MSP430_Debug.h:250
Definition: MSP430_Debug.h:203
Definition: MSP430_Debug.h:213
DLL430_SYMBOL STATUS_T WINAPI MSP430_Run(int32_t mode, int32_t releaseJTAG)
Run the device using the specified mode. JTAG control signals are optionally released.
EMEX_MODE
One of the following enumerations is returned in device.emulation.
Definition: MSP430_Debug.h:178
const char * GENCLKCTRL8
Definition: MSP430_Debug.h:222
const char * GENCLKCTRLA
Definition: MSP430_Debug.h:220
const char * MCLKCTRL0C
Definition: MSP430_Debug.h:241
const char * MCLKCTRL1C
Definition: MSP430_Debug.h:259
Definition: MSP430_Debug.h:128
Device Emex module has 6 breakpoints, range comparison and trigger sequencer,.
Definition: MSP430_Debug.h:192
const char * MCLKCTRL0F
MCLKCTRL0F to MCLKCTRL00 reflect the bit description strings for MCLKCTRL0.
Definition: MSP430_Debug.h:238
const char * MCLKCTRL0E
Definition: MSP430_Debug.h:239
Definition: MSP430_Debug.h:129
const char * GENCLKCTRL2
Definition: MSP430_Debug.h:228
const char * MCLKCTRL02
Definition: MSP430_Debug.h:251
Definition: MSP430_Debug.h:126
const char * MCLKCTRL06
Definition: MSP430_Debug.h:247
const char * MCLKCTRL19
Definition: MSP430_Debug.h:262
const char * MCLKCTRL11
Definition: MSP430_Debug.h:270
const char * MCLKCTRL14
Definition: MSP430_Debug.h:267
Definition: MSP430_Debug.h:134
DLL430_SYMBOL STATUS_T WINAPI MSP430_ExtRegisters(int32_t address, uint8_t *buffer, int32_t count, int32_t rw)
const char * MCLKCTRL1B
Definition: MSP430_Debug.h:260
enum EMEX_MODE EMEX_MODE_t
One of the following enumerations is returned in device.emulation.
const char * GENCLKCTRL1
Definition: MSP430_Debug.h:229
const char * MCLKCTRL0B
Definition: MSP430_Debug.h:242
const char * MCLKCTRL0A
Definition: MSP430_Debug.h:243
const char * GENCLKCTRLF
MCLKCTRL0F to MCLKCTRL00 reflect the bit description strings for MCLKCTRL0.
Definition: MSP430_Debug.h:215
STATE_MODES
State modes.
Definition: MSP430_Debug.h:168
const char * GENCLKCTRLD
Definition: MSP430_Debug.h:217
struct EEM_MCLKCTRL EemMclkCtrl_t
Definition: MSP430_Debug.h:162
Definition: MSP430_Debug.h:169
const char * MCLKCTRL01
Definition: MSP430_Debug.h:252
const char * MCLKCTRL18
Definition: MSP430_Debug.h:263
Definition: MSP430_Debug.h:127
Definition: MSP430_Debug.h:145
const char * MCLKCTRL0D
Definition: MSP430_Debug.h:240
Definition: MSP430_Debug.h:172
Definition: MSP430_Debug.h:236
Device Emex module has two breakpoints.
Definition: MSP430_Debug.h:182
enum STATE_MODES STATE_MODES_t
State modes.
Definition: MSP430_Debug.h:133
const char * MCLKCTRL13
Definition: MSP430_Debug.h:268
const char * MCLKCTRL1E
Definition: MSP430_Debug.h:257
Definition: MSP430_Debug.h:137
Definition: MSP430_Debug.h:143
Definition: MSP430_Debug.h:174
const char * MCLKCTRL10
Definition: MSP430_Debug.h:271
const char * GENCLKCTRL9
Definition: MSP430_Debug.h:221
Definition: MSP430_Debug.h:163
DLL430_SYMBOL STATUS_T WINAPI MSP430_CcGetModuleNames(int32_t localDeviceId, EemMclkCtrl_t **CcModuleNames)
Returns the string descriptions of the devices&#39; EEM Module Clock Control registers MCLKCTRL0 and MCLK...
int32_t STATUS_T
this is the definition for the DLL functions return value
Definition: MSP430.h:181
Definition: MSP430_Debug.h:173
DEVICE_CLOCK_CONTROL
One of the following enumerations is returned in device.clockControl.
Definition: MSP430_Debug.h:202
Definition: MSP430_Debug.h:141
DLL430_SYMBOL STATUS_T WINAPI MSP430_Register(int32_t *reg, int32_t regNb, int32_t rw)
Read and write only one register of the device.
Device Emex module has three breakpoints and range comparison.
Definition: MSP430_Debug.h:184
const char * GENCLKCTRL5
Definition: MSP430_Debug.h:225
const char * MCLKCTRL05
Definition: MSP430_Debug.h:248
const char * GENCLKCTRL6
Definition: MSP430_Debug.h:224
Device Emex module has 8 or 10 breakpoints, range comparison, state storage, and trigger sequencer...
Definition: MSP430_Debug.h:194
const char * GENCLKCTRLC
Definition: MSP430_Debug.h:218
DLL430_SYMBOL STATUS_T WINAPI MSP430_CcGetClockNames(int32_t localDeviceId, EemGclkCtrl_t **CcClockNames)
Returns the string descriptions of the devices&#39; EEM General Clock Control register GENCLKCNTRL...
struct EEM_GCLKCTRL EemGclkCtrl_t
const char * GENCLKCTRL3
Definition: MSP430_Debug.h:227
const char * MCLKCTRL12
Definition: MSP430_Debug.h:269
Definition: MSP430_Debug.h:164
Definition: MSP430_Debug.h:170
const char * GENCLKCTRLE
Definition: MSP430_Debug.h:216
enum DEVICE_CLOCK_CONTROL DEVICE_CLOCK_CONTROL_t
One of the following enumerations is returned in device.clockControl.
const char * MCLKCTRL16
Definition: MSP430_Debug.h:265
const char * MCLKCTRL1D
Definition: MSP430_Debug.h:258
const char * GENCLKCTRL7
Definition: MSP430_Debug.h:223
Definition: MSP430_Debug.h:135
Definition: MSP430_Debug.h:204
Definition: MSP430_Debug.h:132
Definition: MSP430_Debug.h:205