slau358q.pdf - 第100页
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.…

www.ti.com
MSP-GANG.dll Description
99
SLAU358Q–September 2011–Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
BYTE F5xx; //42
BYTE MCU_Group; //43
WORD RAM_addr; //44
BYTE SYS_CLK; //46 used for F5xx and up
//#define STANDARD 0 - for compatibility
#define Xv2_PLL 1 //as standard before
#define HF_8MHz 2 //FRAM FR57xx
#define HF_1MHz 3 //Apollo
#define HF2_8MHz 4 //FRAM FR58xx, FR59xx
#define Xv2_PLL_G60XX 5
#define DCO_16384HZ 6 //i2xxx
BYTE InfoA_type; //47
//#define STANDARD 0 - for compatibility
#define I2XX_1K 1 //i2xxx 1K - 0x1000-0x13FF
BYTE FLASH_Type; //48
//#define STANDARD 0 - for compatibility
#define SEGMENT_1K 1 //i2xxx 1K flash segment size
#define FLASH_SEGM_2K 2
#define FLASH_SEGM_4K 4
#define FLASH_SEGM_8K 8
#define FLASH_SEGM_16K 16
#define FLASH_SEGM_32K 32
BYTE Secure_Type; //49
//#define STANDARD 0 - for compatibility
#define SUC 1 //i2xxx
BYTE Map; //50
BYTE SysClkDiv2; //51
BYTE NMI_to_addr; //52
#define NMI_TO_ADDR_NOT_SUPPORTED 0x80
BYTE FW_type; //53
#define FAMILY_XMS432P401 21 //XSP432P401 Rev-B obsolete -
not supported
#define FAMILY_MSP432P401 22
#define FAMILY_MSP432P4111 23
#define FAMILY_MSP432 21
BYTE MCU_Type; //54
#define MSP430F 0x01 //or can be 0
#define CC_RF_BIT_ID 0x10
#define MSP_FR_BIT_ID 0x20
#define MSP432_BIT_ID 0x80
BYTE free_1; //55
BYTE free_2; //56
BYTE free_3; //57
WORD Id2[2]; //58
BYTE free_4; //62
// BYTE free[128-48];
}device;
};

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 -