MSP430 DLL API Documentation  3.12.0.004
MSP430.h
Go to the documentation of this file.
1 /*
2  * MSP430.h
3  *
4  * API for accessing MSP430 devices via JTAG.
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 
161 #ifndef MSP430_H
162 #define MSP430_H
163 
164 
165 #include <DLL430_SYMBOL.h>
166 #include <stdint.h>
167 
168 #if defined(_WIN32) || defined(_WIN64)
169 #include <windows.h>
170 #endif
171 
172 #if defined(__cplusplus)
173 extern "C" {
174 #endif
175 
176 #ifndef MSP430_TYPES
177 #define MSP430_TYPES
178 
180 typedef int32_t STATUS_T;
181 
185 typedef enum STATUS_CODE {
187  STATUS_OK = 0,
188 } STATUS_CODE_t;
189 
193 #pragma pack(1)
194 typedef union DEVICE_T {
197  uint8_t buffer[184];
198  struct
199  {
201  uint16_t endian;
203  uint16_t id;
205  uint8_t string[32];
207  uint16_t mainStart;
209  uint16_t infoStart;
211  uint16_t ramEnd;
213  uint16_t nBreakpoints;
215  uint16_t emulation;
217  uint16_t clockControl;
219  uint16_t lcdStart;
221  uint16_t lcdEnd;
223  uint16_t vccMinOp;
225  uint16_t vccMaxOp;
227  uint16_t hasTestVpp;
229  uint16_t ramStart;
231  uint16_t ram2Start;
233  uint16_t ram2End;
235  uint16_t infoEnd;
237  uint32_t mainEnd;
239  uint16_t bslStart;
241  uint16_t bslEnd;
243  uint16_t nRegTrigger;
245  uint16_t nCombinations;
247  uint8_t cpuArch;
249  uint8_t jtagId;
251  uint16_t coreIpId;
253  uint32_t deviceIdPtr;
255  uint16_t eemVersion;
259  uint16_t nBreakpointsDma;
261  uint16_t TrigerMask;
265  uint16_t nStateStorage;
267  uint16_t nCycleCounter;
271  uint16_t nSequencer;
273  uint16_t HasFramMemroy;
275  uint16_t mainSegmentSize;
280  uint32_t structSize;
282  uint32_t info32BitStart;
284  uint32_t info32BitEnd;
286  uint32_t ram32BitStart;
288  uint32_t ram32BitEnd;
292  uint32_t ram32BitBandEnd;
294  uint32_t main32BitStart;
296  uint32_t main32BitEnd;
298  uint32_t debug32BitStart;
300  uint32_t debug32BitEnd;
302  uint32_t bsl32BitStart;
304  uint32_t bsl32BitEnd;
315  };
316 } DEVICE_T_t;
317 #pragma pack()
318 
319 
321 #define DEVICE_UNKNOWN 0
322 
323 typedef enum CPU_ARCH_TYPE
324 {
330 
332 {
336 
337 typedef enum READ_WRITE {
338  WRITE = 0,
339  READ = 1,
341 } READ_WRITE_t;
342 
343 typedef enum ENABLE_DISABLE {
344  DISABLE = 0,
345  ENABLE = 1,
347 
349 typedef enum RESET_METHOD {
350  PUC_RESET = (1 << 0),
351  RST_RESET = (1 << 1),
352  VCC_RESET = (1 << 2),
353  FORCE_RESET = (1 << 3),
354 
368 
369 
371 typedef enum ERASE_TYPE {
374  ERASE_ALL = 2,
377 } ERASE_TYPE_t;
378 
380 typedef enum CONFIG_MODE {
387  SET_MDB_BEFORE_RUN = 9,
391 
406  // just used internal for the device code of L092 and C092
408  // set true to write the external SPI image of the L092
410  // set DEBUG_LPM_X true to start debugging of LPMx.5
411  // this will start polling for LPMX.5 events if a system notify callback was
412  // previously set using MSP430_SET_SYSTEM_NOTIFY_CALLBACK()
414  // Configure JTAG speed
416  // total device erase including IP protection
418  // Enable the CURRENTDRIVE FINE EnergyTrace Mode, for measuring small currents
420  // Enable software breakpoints
422  // Enable/disable interrupts during single step or run (0: all interrupts are exectued
423  // 1: interrupts for single step are disabled
424  // 2: interrupts when device is running are disabled)
425  // The values can be ORed. MSP432 only
427  // Configure value for JTAG lock key for 5xx devices
429 } CONFIG_MODE_t;
430 
437 
439 typedef enum INTERFACE_TYPE {
440  JTAG_IF = 0,
444  UNDEF_IF = 4,
450 
452 typedef enum INTERFACE_SPEED {
453  FAST = 0,
454  MEDIUM = 1,
455  SLOW = 2
457 
459 typedef enum FILE_TYPE {
463 } FILE_TYPE_t;
464 
465 typedef enum MESSAGE_LEVEL {
469 
470 typedef void(*MessageCallbackFn)(MESSAGE_LEVEL_T, const char *);
471 
472 #define ERROR_DEFINITIONS \
473  ERROR_DEF(NO_ERR, "No error") \
474  ERROR_DEF(INITIALIZE_ERR, "Could not initialize device interface") \
475  ERROR_DEF(CLOSE_ERR, "Could not close device interface") \
476  ERROR_DEF(PARAMETER_ERR, "Invalid parameter(s)") \
477  ERROR_DEF(NO_DEVICE_ERR, "Could not find device (or device not supported)") \
478  ERROR_DEF(DEVICE_UNKNOWN_ERR, "Unknown device") \
479  ERROR_DEF(READ_MEMORY_ERR, "Could not read device memory") \
480  ERROR_DEF(WRITE_MEMORY_ERR, "Could not write device memory") \
481  ERROR_DEF(READ_FUSES_ERR, "Could not read device configuration fuses") \
482  ERROR_DEF(CONFIGURATION_ERR, "Incorrectly configured device; device derivative not supported") \
483  ERROR_DEF(VCC_ERR, "Could not set device Vcc") \
484  ERROR_DEF(RESET_ERR, "Could not reset device") \
485  ERROR_DEF(PRESERVE_RESTORE_ERR, "Could not preserve/restore device memory") \
486  ERROR_DEF(FREQUENCY_ERR, "Could not set device operating frequency") \
487  ERROR_DEF(ERASE_ERR, "Could not erase device memory") \
488  ERROR_DEF(BREAKPOINT_ERR, "Could not set device breakpoint") \
489  ERROR_DEF(STEP_ERR, "Could not single step device") \
490  ERROR_DEF(RUN_ERR, "Could not run device (to breakpoint)") \
491  ERROR_DEF(STATE_ERR, "Could not determine device state") \
492  ERROR_DEF(EEM_OPEN_ERR, "Could not open Enhanced Emulation Module") \
493  ERROR_DEF(EEM_READ_ERR, "Could not read Enhanced Emulation Module register") \
494  ERROR_DEF(EEM_WRITE_ERR, "Could not write Enhanced Emulation Module register") \
495  ERROR_DEF(EEM_CLOSE_ERR, "Could not close Enhanced Emulation Module") \
496  ERROR_DEF(FILE_OPEN_ERR, "File open error") \
497  ERROR_DEF(FILE_DETECT_ERR, "File type could not be identified") \
498  ERROR_DEF(FILE_END_ERR, "File end error") \
499  ERROR_DEF(FILE_IO_ERR, "File input/output error") \
500  ERROR_DEF(FILE_DATA_ERR, "File data error") \
501  ERROR_DEF(VERIFY_ERR, "Verification error") \
502  ERROR_DEF(BLOW_FUSE_ERR, "Could not secure the device") \
503  ERROR_DEF(FUSE_BLOWN_ERR, "The Debug Interface to the device has been secured") \
504  ERROR_DEF(INTEL_HEX_CODE_ERR, "Error within Intel Hex file") \
505  ERROR_DEF(WRITE_REGISTER_ERR, "Could not write device Register") \
506  ERROR_DEF(READ_REGISTER_ERR, "Could not read device Register") \
507  ERROR_DEF(INTERFACE_SUPPORT_ERR, "Not supported by selected Interface or Interface is not initialized") \
508  ERROR_DEF(COMM_ERR, "Interface Communication error") \
509  ERROR_DEF(NO_EX_POWER, "No external power supply detected") \
510  ERROR_DEF(LOW_EX_POWER, "External power too low") \
511  ERROR_DEF(EX_POWER_OK, "External power detected") \
512  ERROR_DEF(HIGH_EX_POWER, "External power too high") \
513  ERROR_DEF(SELFTEST_ERR, "Hardware Self Test Error") \
514  ERROR_DEF(FLASH_TIMEOUT_ERR, "Fast Flash Routine experienced a timeout") \
515  ERROR_DEF(THREAD_ERR, "Could not create thread for polling") \
516  ERROR_DEF(EEM_INIT_ERR, "Could not initialize Enhanced Emulation Module") \
517  ERROR_DEF(RESOURCE_ERR, "Insufficient resources") \
518  ERROR_DEF(CLK_CTRL_ERR, "No clock control emulation on connected device") \
519  ERROR_DEF(STATE_STOR_ERR, "No state storage buffer implemented on connected device") \
520  ERROR_DEF(READ_TRACE_ERR, "Could not read trace buffer") \
521  ERROR_DEF(VAR_WATCH_EN_ERR, "Enable the variable watch function") \
522  ERROR_DEF(SEQUENCER_ERR, "No trigger sequencer implemented on connected device") \
523  ERROR_DEF(SEQ_ENABLE_ERR, "Could not read sequencer state - Sequencer is disabled") \
524  ERROR_DEF(CLR_SEQ_TRIGGER, "Could not remove trigger - Used in sequencer") \
525  ERROR_DEF(SET_SEQ_TRIGGER, "Could not set combination - Trigger is used in sequencer") \
526  ERROR_DEF(SPMA_ACTIVE_ERR, "System Protection Module A is enabled - Device locked") \
527  ERROR_DEF(SPMA_INVALID_KEY_ERR, "Invalid SPMA key was passed to the target device - Device locked") \
528  ERROR_DEF(SPMA_MAX_TRIALS, "Device does not accept any further SPMA keys - Device locked") \
529  ERROR_DEF(USB_FET_BSL_ACTIVE_ERR, "MSP-FET430UIF Firmware erased - Bootloader active") \
530  ERROR_DEF(USB_FET_NOT_FOUND_ERR, "Could not find MSP-FET430UIF on specified COM port") \
531  ERROR_DEF(USB_FET_BUSY_ERR, "MSP-FET430UIF is already in use") \
532  ERROR_DEF(THREAD_ACTIVE_ERR, "EEM polling thread is already active") \
533  ERROR_DEF(THREAD_TERMINATE_ERR, "Could not terminate EEM polling thread") \
534  ERROR_DEF(UNLOCK_BSL_ERR, "Could not unlock BSL memory segments") \
535  ERROR_DEF(BSL_MEMORY_LOCKED_ERR, "Could not perform access, BSL memory segments are protected") \
536  ERROR_DEF(FOUND_OTHER_DEVICE, "Another device as selected was found") \
537  ERROR_DEF(WRONG_PASSWORD, "Could not enable JTAG wrong password") \
538  ERROR_DEF(UPDATE_MULTIPLE_UIF_ERR, "Only one UIF must be connected during update to v3") \
539  ERROR_DEF(CDC_UIF_ERR, "CDC-USB-FET-Driver was not installed. Please install the driver") \
540  ERROR_DEF(UIF_MANUAL_POWERCYCLE_NEEDED, "Manual reboot of USB-FET needed ! PLEASE unplug and reconnect your USB-FET!!") \
541  ERROR_DEF(INTERNAL_ERR, "Internal error") \
542  ERROR_DEF(FETRECOVERY_NEEDED, "One of the connected MSP-FETs / eZ-FETs debuggers needs recovery") \
543  ERROR_DEF(WRITE_EXTERNAL_MEM_ERR, "One of the connected MSP-FETs / eZ-FETs debuggers needs recovery") \
544  ERROR_DEF(FEATURE_NOT_SUPPORTED, "Feature not supported") \
545  ERROR_DEF(RECOVERY_MULTIPLE_UIF, "Only one MSP-FET / eZ-FET must be connected during recovery") \
546  ERROR_DEF(RECOVERY_FAILED, "MSP-FET / eZ-FET recovery failed") \
547  ERROR_DEF(UPDATE_CORE_ERR, "MSP-FET / eZ-FET core(communication layer) update failed") \
548  ERROR_DEF(UPDATE_MODULE_ERR, "MSP-FET / eZ-FET legacy module update failed") \
549  ERROR_DEF(ET_NOT_SUPPORTED, "EnergyTrace is not supported by the selected debugger") \
550  ERROR_DEF(HARDWARE_STATE_UNKNOWN, "Hardware State is unknown") \
551  ERROR_DEF(DEVICE_CRC_WRONG, "Device configuration data inconsistent. Please discontinue using/replace target device.") \
552  ERROR_DEF(EEM_NOT_ACCESSIBLE, "EEM module not accessible while running in Ultra Low Power Debug Mode - Deactivate Ultra Low Power Debug mode to enable this feature") \
553  ERROR_DEF(REMOVE_SOFTWARE_BREAKPOINT_ERR, "Failed to remove software breakpoints, please reprogram target device") \
554  ERROR_DEF(TRIGGER_CONFLICT_ERR, "Trigger configuration conflicts with existing triggers") \
555  ERROR_DEF(TARGET_RUNNING_ERR, "Operation not possible while device is running") \
556  ERROR_DEF(INCOMPATIBLE_WITH_SW_BREAKPOINT_API, "This function can not be used when software breakpoints are enabled") \
557  ERROR_DEF(SPEED_CONFIG_ERR, "JTAG/SBW speed configuration failed") \
558  ERROR_DEF(SWBP_CRITICAL_INSTRUCTION, "Software breakpoint can't be set (followed by critical value)") \
559  ERROR_DEF(ET_NOT_SUPPORTED_DEVICE, "EnergyTrace is not supported by selected MSP430 device") \
560  ERROR_DEF(ET_NOT_SUPPORTED_ULP_DEBUG, "EnergyTrace requires Ultra-Low Power debug / LPMx.5 enabled") \
561  ERROR_DEF(LEGACY_DEVICE_ERR, "Legacy version of silicon used, which is no longer supported. Please contact TI to obtain a newer version.") \
562  ERROR_DEF(SECURE_NOT_SUPPORTED_ERR, "Secure device via the IDE is not supported. See Device User Guide for further information.") \
563  ERROR_DEF(CYCLE_COUNTER_CONFLICT, "Cycle counter is in basic mode. Set to advanced mode to use this function.") \
564  ERROR_DEF(NO_LPT_SUPPORT, "Parallel port FET (MSP-FETP430IF) is no longer supported.") \
565  ERROR_DEF(WRONG_TARGET_ARCHITECTURE, "Wrong target architecture was selected - Valid architectures are MSP430 or MSP432_M4.") \
566  ERROR_DEF(MSP432_TOTAL_ERASE, "Mass erase executed. Please power-cycle your device and restart the debug session.") \
567  ERROR_DEF(POSSIBLE_OVERCURRENT, "Your connected hardware might drain too much power from the debugger.This results in an overcurrent.") \
568  ERROR_DEF(FET_UPDATE_FAILED, "MSP Tool firmware update failed. Please ensure the USB or Backchannel UART connection is not in use.") \
569  ERROR_DEF(INTERFACE_SUPPORT_ERR_MSP432, "MSP432 devices are not supported using the MSPFET430-UIF") \
570  ERROR_DEF(DAP_LOCK_WRONG_PROTOCOL, "DAP is locked or wrong debug protocol selected.") \
571  ERROR_DEF(DEVICE_DB_ERR, "Device database not loaded.") \
572  ERROR_DEF(INVALID_ERR, "Invalid error number")
573 
575 #define ERROR_DEF(errorEnum, errorString) errorEnum,
577 #undef ERROR_DEF
578 
579 // System events
580 typedef enum SYSTEM_EVENT_MSP
581 {
597 
598 typedef void (* SYSTEM_NOTIFY_CALLBACK) (SYSTEM_EVENT_MSP_t MySystemEvent);
599 
600 #endif /* MSP430_TYPES */
601 
602 // Functions. -----------------------------------------------------------------
619 DLL430_SYMBOL STATUS_T WINAPI MSP430_SET_SYSTEM_NOTIFY_CALLBACK(SYSTEM_NOTIFY_CALLBACK parSystemNotifyCallback);
620 
621 // Functions. -----------------------------------------------------------------
640 DLL430_SYMBOL STATUS_T WINAPI MSP430_SetTargetArchitecture(TARGET_ARCHITECTURE_t architecture);
641 
642 /*
643 \fn STATUS_T MSP430_LoadDeviceDb(const char* file);
644 
645 \brief Load the device database from XML archive.
646 
647 \param file: The filename of a zip archive containing the device info files.
648 
649 \return STATUS_OK: The device info was loaded.
650 \n STATUS_ERROR: The device info was not loaded.
651 */
652 DLL430_SYMBOL STATUS_T WINAPI MSP430_LoadDeviceDb(const char* file);
653 
654 /*
655 \fn STATUS_T MSP430_DumpDeviceDb(const char* file);
656 
657 \brief Dumps the device database to a XML file.
658 
659 \param file: The filename of a zip archive containing the device info files.
660 
661 \return STATUS_OK: The device info was dumped.
662 \n STATUS_ERROR: The device info was not dumped.
663 */
664 DLL430_SYMBOL STATUS_T WINAPI MSP430_DumpDeviceDb(const char* file);
665 
674 DLL430_SYMBOL STATUS_T WINAPI MSP430_ClearDeviceDb();
675 
721 DLL430_SYMBOL STATUS_T WINAPI MSP430_Initialize(const char* port, int32_t* version);
722 
739 DLL430_SYMBOL STATUS_T WINAPI MSP430_Close(int32_t vccOff);
740 
741 
749 DLL430_SYMBOL STATUS_T WINAPI MSP430_GetJtagID(int32_t* JtagId);
750 
768 DLL430_SYMBOL STATUS_T WINAPI MSP430_GetFoundDevice(uint8_t* FoundDevice, int32_t count);
769 
803 DLL430_SYMBOL STATUS_T WINAPI MSP430_OpenDevice(const char* Device, const char* Password, int32_t PwLength,int32_t DeviceCode, int32_t setId);
804 
805 
824 DLL430_SYMBOL STATUS_T WINAPI MSP430_Device(int32_t localDeviceId, uint8_t* buffer, int32_t count);
825 
871 DLL430_SYMBOL STATUS_T WINAPI MSP430_Configure(int32_t mode, int32_t value);
872 
896 DLL430_SYMBOL STATUS_T WINAPI MSP430_VCC(int32_t voltage);
897 
898 
916 DLL430_SYMBOL STATUS_T WINAPI MSP430_GetCurVCCT(int32_t* voltage);
917 
942 DLL430_SYMBOL STATUS_T WINAPI MSP430_GetExtVoltage(int32_t* voltage, int32_t* state);
943 
944 
975 DLL430_SYMBOL STATUS_T WINAPI MSP430_Reset(int32_t method, int32_t execute, int32_t releaseJTAG);
976 
1016 DLL430_SYMBOL STATUS_T WINAPI MSP430_Erase(int32_t type, int32_t address, int32_t length);
1017 
1047 DLL430_SYMBOL STATUS_T WINAPI MSP430_Memory(int32_t address, uint8_t* buffer, int32_t count, int32_t rw);
1048 
1049 #define MSP430_Read_Memory(ADDRESS, BUFFER, COUNT) MSP430_Memory(ADDRESS, BUFFER, COUNT, READ)
1050 #define MSP430_Write_Memory(ADDRESS, BUFFER, COUNT) MSP430_Memory(ADDRESS, BUFFER, COUNT, WRITE)
1051 
1070 DLL430_SYMBOL STATUS_T WINAPI MSP430_Secure(void);
1071 
1095 #if ! defined(uController)
1096 DLL430_SYMBOL STATUS_T WINAPI MSP430_ReadOutFile(int32_t wStart, int32_t wLength, const char* lpszFileName, int32_t iFileType);
1097 #endif
1098 
1140 #if ! defined(uController)
1141 DLL430_SYMBOL STATUS_T WINAPI MSP430_ProgramFile(const char* File, int32_t eraseType, int32_t verifyMem);
1142 #endif
1143 
1171 #if ! defined(uController)
1172 DLL430_SYMBOL STATUS_T WINAPI MSP430_VerifyFile(const char* File);
1173 #endif
1174 
1197 DLL430_SYMBOL STATUS_T WINAPI MSP430_VerifyMem(int32_t StartAddr, int32_t Length, const uint8_t* DataArray);
1198 
1220 DLL430_SYMBOL STATUS_T WINAPI MSP430_EraseCheck(int32_t StartAddr, int32_t Length);
1221 
1232 DLL430_SYMBOL int32_t WINAPI MSP430_Error_Number(void);
1233 
1244 #if ! defined(uController)
1245 DLL430_SYMBOL const char* WINAPI MSP430_Error_String(int32_t errorNumber);
1246 #endif
1247 
1262 #if ! defined(uController)
1263 DLL430_SYMBOL STATUS_T WINAPI MSP430_GetNumberOfUsbIfs(int32_t* Number);
1264 #endif
1265 
1292 #if ! defined(uController)
1293 DLL430_SYMBOL STATUS_T WINAPI MSP430_GetNameOfUsbIf(int32_t Idx, char** Name, int32_t* Status);
1294 #endif
1295 
1305 DLL430_SYMBOL STATUS_T WINAPI MSP430_GetInterface_Type(enum INTERFACE_TYPE* type);
1306 
1317 DLL430_SYMBOL STATUS_T WINAPI MSP430_RegisterMessageCallback(MessageCallbackFn callback);
1318 
1319 #if defined(__cplusplus)
1320 }
1321 #endif
1322 
1323 #endif // MSP430_H
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetInterface_Type(enum INTERFACE_TYPE *type)
Determine the type of interface for the connection to the device.
System event FET restart needed.
Definition: MSP430.h:587
READ_WRITE
Definition: MSP430.h:337
Definition: MSP430.h:333
uint16_t nBreakpointsReadWrite
Definition: MSP430.h:258
uint16_t clockControl
Clock control level.
Definition: MSP430.h:217
Definition: MSP430.h:409
Definition: MSP430.h:443
uint16_t eemVersion
The EEM Version Number.
Definition: MSP430.h:255
enum FILE_TYPE FILE_TYPE_t
File types.
uint32_t ram32BitBandStart
Indicates the start of the 32-bit RAM Bit-Band alias region space.
Definition: MSP430.h:290
enum RESET_METHOD RESET_METHOD_t
Device reset methods.
uint16_t ram2Start
RAM2 starting address.
Definition: MSP430.h:231
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetFoundDevice(uint8_t *FoundDevice, int32_t count)
DLL430_SYMBOL STATUS_T WINAPI MSP430_Initialize(const char *port, int32_t *version)
Initialize the interface.
Definition: MSP430.h:338
uint16_t endian
The value 0xaa55.
Definition: MSP430.h:201
uint16_t lcdEnd
LCD ending address.
Definition: MSP430.h:221
uint32_t main32BitStart
Indicates the start of the 32-bit MAIN space.
Definition: MSP430.h:294
Definition: MSP430.h:327
uint32_t main32BitEnd
Indicates the end of the 32-bit MAIN space.
Definition: MSP430.h:296
Definition: MSP430.h:433
Definition: MSP430.h:385
CONFIG_MODE
Configurations to set with MSP430_Configure.
Definition: MSP430.h:380
uint16_t nCombinations
Number of EEM Trigger Combinations.
Definition: MSP430.h:245
FILE_TYPE
File types.
Definition: MSP430.h:459
uint32_t ram32BitStart
Indicates the start of the 32-bit RAM space.
Definition: MSP430.h:286
int32_t nDataWatchpoints
number of DataWatchpoints (if hardware resources are separated) or -1 if hardware resources are share...
Definition: MSP430.h:306
ERROR_CODE
Definition: MSP430.h:576
uint32_t infoSecond32BitStart
Indicates the start of the second 32-bit Info memory space.
Definition: MSP430.h:310
MESSAGE_LEVEL
Definition: MSP430.h:465
uint16_t mainSegmentSize
Flash segment size for Main.
Definition: MSP430.h:275
SYSTEM_EVENT_MSP
Definition: MSP430.h:580
uint16_t coreIpId
The CoreIP ID.
Definition: MSP430.h:251
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetNumberOfUsbIfs(int32_t *Number)
Returns the number of MSP-FET430UIF USB FETs connected to the PC system.
DLL430_SYMBOL STATUS_T WINAPI MSP430_Reset(int32_t method, int32_t execute, int32_t releaseJTAG)
Reset the device using the specified method(s). Optionally start device execution, and release the JTAG control signals.
Definition: MSP430.h:448
Definition: MSP430.h:334
Definition: MSP430.h:407
Definition: MSP430.h:187
uint16_t ramEnd
RAM ending address.
Definition: MSP430.h:211
enum ERROR_CODE ERROR_CODE_t
uint32_t infoSecond32BitEnd
Indicates the end of the second 32-bit Info memory space.
Definition: MSP430.h:312
Definition: MSP430.h:366
uint32_t bsl32BitStart
Indicates the start of the 32-bit BSL memory space.
Definition: MSP430.h:302
Definition: MSP430.h:461
enum TARGET_ARCHITECTURE TARGET_ARCHITECTURE_t
void(* MessageCallbackFn)(MESSAGE_LEVEL_T, const char *)
Definition: MSP430.h:470
Definition: MSP430.h:383
System event FET connection is lost.
Definition: MSP430.h:583
uint32_t ram32BitEnd
Indicates the end of the 32-bit RAM space.
Definition: MSP430.h:288
uint16_t bslStart
BSL starting address.
Definition: MSP430.h:239
uint16_t paddingForLegacyDll
Definition: MSP430.h:278
DLL430_SYMBOL STATUS_T WINAPI MSP430_Secure(void)
The device is secured (i.e., the JTAG security fuse is blown). MSP-FET430UIF USB JTAG adaptor >>> D...
uint16_t HasFramMemroy
Msp430 has FRAM Memory.
Definition: MSP430.h:273
DLL430_SYMBOL STATUS_T WINAPI MSP430_ReadOutFile(int32_t wStart, int32_t wLength, const char *lpszFileName, int32_t iFileType)
Read the specified range of device memory, and write it to the specified file.
uint16_t TrigerMask
Trigger Mask for Breakpoint.
Definition: MSP430.h:261
enum INTERFACE_SPEED INTERFACE_SPEED_t
Configurations values for CONFIG_MODE INTERFACE_SPEED.
int32_t nDataWatchpointsValueMatch
number of DataWatchpoints that can be used to match against an address and a value or -1 ...
Definition: MSP430.h:308
DLL430_SYMBOL STATUS_T WINAPI MSP430_SetTargetArchitecture(TARGET_ARCHITECTURE_t architecture)
uint16_t nRegTrigger
Number of CPU Register Trigger.
Definition: MSP430.h:243
Definition: MSP430.h:325
Definition: MSP430.h:435
uint32_t ram32BitBandEnd
Indicates the end of the 32-bit RAM Bit-Band alias region space.
Definition: MSP430.h:292
enum MESSAGE_LEVEL MESSAGE_LEVEL_T
enum INTERFACE_TYPE INTERFACE_TYPE_t
Configurations values for CONFIG_MODE INTERFACE_MODE.
DLL430_SYMBOL const char *WINAPI MSP430_Error_String(int32_t errorNumber)
Determine the string associated with errorNumber.
Definition: MSP430.h:357
uint16_t nBreakpointsOptions
Breakpoint Modes.
Definition: MSP430.h:257
System event device entered LPMx.5.
Definition: MSP430.h:589
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetJtagID(int32_t *JtagId)
Deprecated.
uint16_t ram2End
RAM2 ending address.
Definition: MSP430.h:233
uint32_t debug32BitStart
Indicates the start of the 32-bit DEBUG memory space.
Definition: MSP430.h:298
DLL430_SYMBOL STATUS_T WINAPI MSP430_Close(int32_t vccOff)
Close the interface.
Definition: MSP430.h:428
Definition: MSP430.h:419
Definition: MSP430.h:405
Definition: MSP430.h:576
Definition: MSP430.h:444
uint8_t jtagId
The JTAG ID - value returned on an instruction shift.
Definition: MSP430.h:249
Definition: MSP430.h:372
Definition: MSP430.h:445
enum CPU_ARCH_TYPE CPU_ARCH_TYPE_t
DLL430_SYMBOL STATUS_T WINAPI MSP430_VerifyFile(const char *File)
Compare the MSP430 memory and the contents of the specified file.
DLL430_SYMBOL STATUS_T WINAPI MSP430_Erase(int32_t type, int32_t address, int32_t length)
Erase the device FLASH/FRAM memory.
DLL430_SYMBOL STATUS_T WINAPI MSP430_Memory(int32_t address, uint8_t *buffer, int32_t count, int32_t rw)
Read and write the device memory. "Device memory" includes the Special Function Registers (i...
CPU_ARCH_TYPE
Definition: MSP430.h:323
Definition: MSP430.h:345
Definition: MSP430.h:447
enum ERASE_TYPE ERASE_TYPE_t
FLASH erase type.
uint32_t deviceIdPtr
The Device-ID Pointer.
Definition: MSP430.h:253
uint8_t buffer[184]
Definition: MSP430.h:197
System event - Timout occourt during FPGA DR/IR shift.
Definition: MSP430.h:595
uint32_t info32BitStart
Indicates the start of the 32-bit RAM space.
Definition: MSP430.h:282
Definition: MSP430.h:467
DLL430_SYMBOL STATUS_T WINAPI MSP430_ClearDeviceDb()
Remove all loaded devices from the device database.
Definition: MSP430.h:415
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetExtVoltage(int32_t *voltage, int32_t *state)
Detect if external voltage is supplied to the target device. Report back the value of an external vol...
DLL430_SYMBOL STATUS_T WINAPI MSP430_LoadDeviceDb(const char *file)
enum DISABLE_INTERRUPTS_TYPE DISABLE_INTERRUPTS_TYPE_t
Configurations values for CONFIG_MODE DISABLE_INTERRUPTS.
Definition: MSP430.h:328
uint32_t info32BitEnd
Indicates the end of the 32-bit RAM space.
Definition: MSP430.h:284
void(* SYSTEM_NOTIFY_CALLBACK)(SYSTEM_EVENT_MSP_t MySystemEvent)
Definition: MSP430.h:598
Definition: MSP430.h:373
DLL430_SYMBOL STATUS_T WINAPI MSP430_DumpDeviceDb(const char *file)
Definition: MSP430.h:382
uint16_t nCycleCounterOperations
Cycle couter modes.
Definition: MSP430.h:269
Definition: MSP430.h:441
Definition: MSP430.h:186
Definition: MSP430.h:421
DLL430_SYMBOL STATUS_T WINAPI MSP430_Configure(int32_t mode, int32_t value)
Configure the mode(s) of the device and/or the software. Possible configuration modes are covered by ...
uint8_t cpuArch
The MSP430 architecture (non-X, X or Xv2).
Definition: MSP430.h:247
Definition: MSP430.h:362
Definition: MSP430.h:417
Definition: MSP430.h:339
enum READ_WRITE READ_WRITE_t
Definition: MSP430.h:352
enum CONFIG_MODE CONFIG_MODE_t
Configurations to set with MSP430_Configure.
uint32_t structSize
Indicates the complete size in bytes of the structure.
Definition: MSP430.h:280
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetCurVCCT(int32_t *voltage)
Report back the current voltage supplied to the target device.
uint16_t nSequencer
Msp430 has Sequencer.
Definition: MSP430.h:271
Definition: MSP430.h:454
uint16_t lcdStart
LCD starting address.
Definition: MSP430.h:219
Definition: MSP430.h:466
DLL430_SYMBOL STATUS_T WINAPI MSP430_SET_SYSTEM_NOTIFY_CALLBACK(SYSTEM_NOTIFY_CALLBACK parSystemNotifyCallback)
Initialize the SYSTEM NOTIFYCALLBACK.
uint16_t id
Identification number.
Definition: MSP430.h:203
Definition: MSP430.h:426
int32_t STATUS_T
this is the definition for the DLL functions return value
Definition: MSP430.h:180
enum STATUS_CODE STATUS_CODE_t
Status codes of the DLL functions.
System event devices wakes up from LPMx.5.
Definition: MSP430.h:591
Definition: MSP430.h:455
Definition: MSP430.h:344
uint32_t mainEnd
MAIN ending address.
Definition: MSP430.h:237
Definition: MSP430.h:384
DLL430_SYMBOL int32_t WINAPI MSP430_Error_Number(void)
Determine the number of the error when a MSP430_xxx() function returns STATUS_ERROR.
DLL430_SYMBOL STATUS_T WINAPI MSP430_RegisterMessageCallback(MessageCallbackFn callback)
Defines the callback function to call for messages The callback will be automatically cleared by call...
union DEVICE_T DEVICE_T_t
Device information structure.
INTERFACE_SPEED
Configurations values for CONFIG_MODE INTERFACE_SPEED.
Definition: MSP430.h:452
uint16_t nBreakpoints
Number of breakpoints.
Definition: MSP430.h:213
uint32_t debug32BitEnd
Indicates the end of the 32-bit DEBUG memory space.
Definition: MSP430.h:300
RESET_METHOD
Device reset methods.
Definition: MSP430.h:349
uint16_t ramStart
RAM starting address.
Definition: MSP430.h:229
enum ENABLE_DISABLE ENABLE_DISABLE_t
TARGET_ARCHITECTURE
Definition: MSP430.h:331
System event - overcurrent detection on JTAG lines or VCC line.
Definition: MSP430.h:593
uint16_t emulation
Emulation level.
Definition: MSP430.h:215
DLL430_SYMBOL STATUS_T WINAPI MSP430_EraseCheck(int32_t StartAddr, int32_t Length)
Verify that the specified memory range is erased.
uint16_t nStateStorage
MSP430 has Stage Storage.
Definition: MSP430.h:265
uint16_t bslEnd
BSL ending address.
Definition: MSP430.h:241
Definition: MSP430.h:390
ENABLE_DISABLE
Definition: MSP430.h:343
uint32_t info32BitSegmentSize
Flash segment size for 32-bit Info memory space (MSP432 SimpleLink only)
Definition: MSP430.h:314
Definition: MSP430.h:376
Definition: MSP430.h:402
Device information structure.
Definition: MSP430.h:194
STATUS_CODE
Status codes of the DLL functions.
Definition: MSP430.h:185
Definition: MSP430.h:413
Definition: MSP430.h:340
Definition: MSP430.h:462
INTERFACE_TYPE
Configurations values for CONFIG_MODE INTERFACE_MODE.
Definition: MSP430.h:439
uint16_t nCycleCounter
Number of cycle counters of MSP430.
Definition: MSP430.h:267
uint32_t bsl32BitEnd
Indicates the end of the 32-bit BSL memory space.
Definition: MSP430.h:304
Definition: MSP430.h:381
Definition: MSP430.h:350
forces a Power up clear reset
Definition: MSP430.h:359
Definition: MSP430.h:351
Definition: MSP430.h:374
uint16_t nRegTriggerOperations
Register Trigger modes.
Definition: MSP430.h:263
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetNameOfUsbIf(int32_t Idx, char **Name, int32_t *Status)
Get the name of a Virtual Com Port (VCP), Human Interface Device (HID) or Communication Device Class ...
Definition: MSP430.h:440
uint16_t vccMinOp
Vcc minimum during operation [mVolts].
Definition: MSP430.h:223
DLL430_SYMBOL STATUS_T WINAPI MSP430_OpenDevice(const char *Device, const char *Password, int32_t PwLength, int32_t DeviceCode, int32_t setId)
Identify the device, and compare the found device to the expected device.
DISABLE_INTERRUPTS_TYPE
Configurations values for CONFIG_MODE DISABLE_INTERRUPTS.
Definition: MSP430.h:432
uint16_t infoEnd
INFO ending address.
Definition: MSP430.h:235
Definition: MSP430.h:460
uint16_t vccMaxOp
Vcc maximum during operation [mVolts].
Definition: MSP430.h:225
uint16_t mainStart
MAIN MEMORY starting address.
Definition: MSP430.h:207
System event device connection is lost.
Definition: MSP430.h:585
ERASE_TYPE
FLASH erase type.
Definition: MSP430.h:371
Definition: MSP430.h:446
Definition: MSP430.h:442
DLL430_SYMBOL STATUS_T WINAPI MSP430_VerifyMem(int32_t StartAddr, int32_t Length, const uint8_t *DataArray)
Definition: MSP430.h:375
DLL430_SYMBOL STATUS_T WINAPI MSP430_Device(int32_t localDeviceId, uint8_t *buffer, int32_t count)
Obtain the device information.
Definition: MSP430.h:326
DLL430_SYMBOL STATUS_T WINAPI MSP430_ProgramFile(const char *File, int32_t eraseType, int32_t verifyMem)
The contents of the specified file are input, and then written to the device. The device is optionall...
DLL430_SYMBOL STATUS_T WINAPI MSP430_VCC(int32_t voltage)
Set the device Vcc pin to voltage/1000 volts. The USB JTAG adaptor also checks if external power is ...
Definition: MSP430.h:453
uint16_t infoStart
INFORMATION MEMORY starting address.
Definition: MSP430.h:209
uint16_t nBreakpointsDma
Definition: MSP430.h:259
Definition: MSP430.h:353
Definition: MSP430.h:434
uint16_t hasTestVpp
Device has TEST/VPP.
Definition: MSP430.h:227
enum SYSTEM_EVENT_MSP SYSTEM_EVENT_MSP_t