MSP430 DLL API Documentation  3.9.1.2
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