slau358q.pdf - 第101页
www.ti.com MSP-GANG.dll Description 101 SLAU358Q – September 2011 – Revised October 2019 Submit Documentation Feedback Copyright © 2011–2019, Texas Instruments Incorporated Dynamic Link Library for MSP-GANG Programmer 4.…

MSP-GANG.dll Description
www.ti.com
100
SLAU358Q–September 2011–Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.32 MSPGANG_Read_Code_File
MSPGANG_Read_Code_File reads or appends a code file or reads a password file and saves it in its
internal buffer. By default, the file is treated as the main code file as long as the setup has not redirected
the file to 'Append code' or 'Password code' using the MSPGANG_SetConfig function.
MSPGANG_SetConfig(CFG_OPEN_FILE_TYPE, CODE_FILE_INDEX)
MSPGANG_SetConfig(CFG_OPEN_FILE_TYPE, APPEND_FILE_INDEX)
MSPGANG_SetConfig(CFG_OPEN_FILE_TYPE, PASSW_FILE_INDEX)
When the MSPGANG_Read_Code_File is executed, the flag set by
MSPGANG_SetConfig(CFG_OPEN_FILE_TYPE, CODE_FILE_INDEX) is set to the default value of Read
Code File.
Syntax
LONG MSPGANG_Read_Code_File(LPTSTR FullPath)
Arguments
LPTSTR FullPath Path to the code file (*.hex,*.txt or *.s19, *.s28, *.s37)
Result
LONG Error code
4.2.33 MSPGANG_Save_Config, MSPGANG_Load_Config, MSPGANG_Default_Config
The current configuration file can be saved using the MSPGANG_Save_Config function and recalled when
required using the MSPGANG_Load_Config function. The current configuration can be erased and the
default configuration loaded by calling the MSPGANG_Default_Config function. When the new
configuration is loaded, some of the parameters can be modified item-by-item using
MSPGANG_SetConfig and can be read from the configuration item-by-item using MSPGANG_GetConfig.
The MSP-GANG configuration can also be created using the MSP-GANG GUI software (MSP-GANG-exe)
by setting desired programmer setup, verifying if all works, then saving the configuration using the "Save
Setup as..." option. The setup used in the GUI can be restored in the DLL when the above mentioned
configuration file is downloaded using MSPGANG_Load_Config function.
Syntax
LONG MSPGANG_Save_Config(LPTSTR filename)
LONG MSPGANG_Load_Config(LPTSTR filename)
LONG MSPGANG_Default_Config(void)
Arguments
LPTSTR filename Path to the configuration file
Result
LONG Error code

www.ti.com
MSP-GANG.dll Description
101
SLAU358Q–September 2011–Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.34 MSPGANG_SetConfig, MSPGANG_GetConfig
Syntax
LONG MSPGANG_SetConfig(LONG index, LONG data)
Arguments
LONG index Configuration index. See list below.
LONG data Configuration data
Result
LONG Error code
Syntax
LONG MSPGANG_GetConfig(LONG index)
Arguments
LONG index Configuration index. See list below.
Result
LONG data Configuration data
List of Indexes
#define FROMIMAGE_BIT 0x1000
#define CFG_INTERFACE 0
#define INTERFACE_NONE 0
#define INTERFACE_JTAG 4
#define INTERFACE_SBW 8
#define INTERFACE_BSL 0xC
#define INTERFACE_TYPE_MAX_INDEX INTERFACE_BSL
#define CFG_JTAG_SPEED 1
#define INTERFACE_FAST 0
#define INTERFACE_MED 1
#define INTERFACE_SLOW 2
#define INTERFACE_SPEED_MAX_INDEX INTERFACE_SLOW
#define CFG_SBW_SPEED 2
// INTERFACE_FAST 0
// INTERFACE_MED 1
// INTERFACE_SLOW 2
#define CFG_BSL_SPEED 3
// INTERFACE_FAST 0
// INTERFACE_MED 1
// INTERFACE_SLOW 2
#define CFG_IO_INTERFACE 4
#define SBW_VIA_TDOI_BIT 0x00
#define SBW_VIA_RST_BIT 0x01
// 0 - SBW_VIA_TDOI (pin 1) and TCK/TEST (pin-7/8)
// 1 - SBW_VIA_RST (pin 11) and TCK/TEST (pin-7/8)
#define CFG_POWERTARGETEN 6
#define EXTERNAL_POWER_WHOLE_RANGE 0 // external power supply -

MSP-GANG.dll Description
www.ti.com
102
SLAU358Q–September 2011–Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
whole range from Vccmin to Vccmax
#define POWER_SUPPLIED_BY_MSPGANG 1 // targets supplied by
MSP-GANG
#define EXTERNAL_POWER_IN_RANGE 2 // external power supply -
verified range - selected Vcc +/- 0.3V
#define CFG_VCCINDEX 7
// Vcc in mV 1800 - 3600
#define CFG_ICC_HI_EN 8
// disable 0 (up to 30mA from MSP-GANG to each targets)
// enable 1 (up to 50mA from MSP-GANG to each targets)
#define CFG_BLOWFUSE 9
// disable 0
// enable 1
#define CFG_TARGET_EN_INDEX 10
// Targets GANG enable mask - 0x00 ...0xFF. Enable all targets -
> 0xFF
#define TARGET_1_MASK 0x01
#define TARGET_2_MASK 0x02
#define TARGET_3_MASK 0x04
#define TARGET_4_MASK 0x08
#define TARGET_5_MASK 0x10
#define TARGET_6_MASK 0x20
#define TARGET_7_MASK 0x40
#define TARGET_8_MASK 0x80
#define CFG_FLASHERASEMODE 11
#define ERASE_NONE_MEM_INDEX 0
#define ERASE_ALL_MEM_INDEX 1
#define ERASE_PRG_ONLY_MEM_INDEX 2
#define ERASE_INFILE_MEM_INDEX 3
#define ERASE_DEF_CM_INDEX 4
#define ERASE_MAX_INDEX ERASE_DEF_CM_INDEX
#define CFG_ERASEINFOA 12 \
// disable 0
// enable 1
#define CFG_ERASEINFOB 13
// disable 0
// enable 1
#define CFG_ERASEINFOC 14
// disable 0
// enable 1
#define CFG_ERASEINFOD 15
// disable 0
// enable 1
#define CFG_MASSERASE_AND_INFOA_EN 16
// disable 0
// enable 1
#define CFG_ERASESTARTADDR 17
// FLASH/FRAM start erase address