slau358q.pdf - 第123页
www.ti.com MSP-GANG.dll Description 123 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
122
SLAU358Q–September 2011–Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.45 MSPGANG_Convert_Address
The MSPGANG_Convert_Address function converts the MCU data address to the data buffer address in
the DLL (see DATA_BUFFERS structure), where the data (flash, FRAM, RAM) are stored. Function is
used in the MSP432 MCU where the MCU address is 32 bit. Currently the function is not used if the
MSP430 MCU is used, but it can be used in the future if the memory space increases in the MCU.
Syntax
LONG WINAPI MSPGANG_Convert_Address( BYTE type, LONG Addr );
Arguments
BYTE type MCU_TO_DATABUF 1
DATABUF_TO_MCU 2
LONG Addr MCU address for type MCU_TO_DATABUF, or data buffer address for type DATABUF_TO_MCU.
Result
LONG Data Buffer or MCU address. Result is positive if conversion of the address succeeds, and minus 1 (0xFFFFFFFF) if
failed.
Example
See Section 4.2.1, Section 4.2.2, Section 4.2.14, and Section 4.2.15.
4.2.46 MSPGANG_Memory_Header_text
The MSPGANG_Memory_Header_text displays the name of the data block specified at the MCU address.
Function is used by GUI in the data viewer.
Syntax
LPTSTR WINAPI MSPGANG_Memory_Header_text( LONG Addr );
Arguments
LONG Addr Beginning address in MCU of the selected data block
Result
LPTSTR Text of data block name
Example
char *header_txt;
// Selected MCU - MSP432P401R
header_txt = (char*)MSPGANG_Memory_Header_text( 0x8000 );
//Returned contents of the header_txt string ->
// "Flash - Sectors 8 - 15 (0x08000 to 0x0FFFF)"
4.2.47 MSPGANG_Interactive_ClrLockedDevice
Unlocks the MSP432 MCU, if it is locked. The whole main memory flash is erased. The information
memory or BSL sectors can be erased if selected in configuration.
Syntax
LONG WINAPI MSPGANG_Interactive_ClrLockedDevice( void );

www.ti.com
MSP-GANG.dll Description
123
SLAU358Q–September 2011–Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.48 MSPGANG_Get_Code_Info
Gets the checksum or code size of the selected code.
Syntax
LONG WINAPI MSPGANG_Get_Code_Info( LONG type );
Arguments
LONG type CODE_SIZE_INFO 1
CODE_CHECK_SUM 2
CODE2_SIZE_INFO 3
CODE2_CHECK_SUM 4
APPEND_CODE_SIZE_INFO 5
APPEND_CODE_CHECK_SUM 6
WHOLE_CODE_SIZE_INFO 7
WHOLE_CODE_CHECK_SUM 8
CS_PER_GANG430STD 9
Result
LONG Checksum or code size of the selected code.
4.2.49 MSPGANG_MakeSound
The MSPGANG_MakeSound make beep or sounds.
Syntax
void WINAPI MSPGANG_MakeSound( LONG type );
Arguments
LONG type BEEP_OK 1
BEEP_ERR 2
BEEP_PRG_ERR 3
BEEP_WARNING 4

MSP-GANG.dll Description
www.ti.com
124
SLAU358Q–September 2011–Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.50 MSPGANG_CallBack_ProgressBar
The MSPGANG_CallBack_ProgressBar function returns the current status during process execution. The
function should be called from an interrupt or separate thread if the main function is executed.
Syntax
LONG WINAPI MSPGANG_CallBack_ProgressBar( void ** text, void ** history, BYTE
*G_status, BYTE *DLL_status );
Result
LONG If the result is negative, then the contents of the MSPGANG_CallBack_ProgressBar have not been updated.
If the result is positive, then data has been updated.
Example
#define SCRIPT_TEXT_SIZE 16
union GANG_PROGRESS_STATUS
{
BYTE bytes[PROGRESS_STATUS_SIZE+4];
struct
{
BYTE header;
BYTE ctr;
WORD task_ctr; //byte offset - 0
WORD chunk_ctr; //byte offset - 2
BYTE run; //byte offset - 4
BYTE ack; //byte offset - 5
WORD Finished_tasks_mask; //byte offset - 6,7
//--- task mask bits ----
// CONNECT_TASK_BIT 0x0001
// ERASE_TASK_BIT 0x0002
// BLANKCHECK_TASK_BIT 0x0004
// PROGRAM_TASK_BIT 0x0008
// VERIFY_TASK_BIT 0x0010
// SECURE_TASK_BIT 0x0020
// DCO_CAL_TASK_BIT 0x0040
//spare 0x0080 to 0x4000
// RST_AND_START_FW_BIT 0x8000
BYTE cumulative; //byte offset - 8
//target masks
// TARGET_1_MASK 0x01
// TARGET_2_MASK 0x02
// TARGET_3_MASK 0x04
// TARGET_4_MASK 0x08
// TARGET_5_MASK 0x10
// TARGET_6_MASK 0x20
// TARGET_7_MASK 0x40
// TARGET_8_MASK 0x80
BYTE Rq_gang_mask; //byte offset - 9
BYTE Connected_gang_mask; //byte offset - 10
BYTE Erased_gang_mask; //byte offset - 11
BYTE BlankCheck_gang_mask; //byte offset - 12
BYTE Programmed_gang_mask; //byte offset - 13
BYTE Verified_gang_mask; //byte offset - 14
BYTE Secured_gang_mask; //byte offset - 15
BYTE spare[6]; //byte offset - 16..21
BYTE error_no; //byte offset - 22
BYTE VTIO_32mV; //byte offset - 23
BYTE VccSt_LOW; //byte offset - 24
BYTE VccSt_HI; //byte offset - 25
// VccSt_LOW, VccSt_HI provide 2 bits to each target.
// Bit A for each target and bit B for each target.
// Bits B A