slau358q.pdf - 第116页
MSP-GANG.dll Description www.ti.com 116 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
115
SLAU358Q–September 2011–Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
{ 0x20, " MSP430FR" },
{ 0x10, " CC430" },
{ 0x80, " MSP432" },
MCU_Group_list
{ 1, 1, " MSP430F1xx" },
{ 20, 1, " MSP430F2xx" },
{ 22, 1, " MSP430AFE2xx" },
{ 21, 1, " MSP430G2xx" },
{ 23, 1, " MSP430i2xx" },
{ 25, 1, " MSP430Txxx" },
{ 40, 1, " MSP430F4xx" },
{ 41, 1, " MSP430FE4xx" },
{ 42, 1, " MSP430FG4xx" },
{ 43, 1, " MSP430FW4xx" },
{ 50, 1, " MSP430F5xx" },
{ 60, 1, " MSP430F6xx" },
{ 62, 1, " MSP430FG6xx" },
{ 55, 0x20, " MSP430FR2xx" },
{ 56, 0x20, " MSP430FR4xx" },
{ 57, 0x20, " MSP430FR5xx" },
{ 67, 0x20, " MSP430FR6xx" },
{ 51, 0x10, " CC-430F5xx" },
{ 61, 0x10, " CC-430F6xx" },
{ 0x84,0x80, " MSP432P4xx" },
{ 0x85,0x80, " MSP432E4xx" },
List of the MCU names in a selected group can be found as follows (in this example, a list of the MCUs
from the MSP430F5xx group (group number 50)):
for(n = 0; n< 100; n++) MCU_name_list[n].index = 0;
for(n = 0; n< 100; n++)
{
p = MSPGANG_Get_MCU_Name(50, n, MCU_name_list[n].name);
if(p == 0) break;
MCU_name_list[n].index = n;
}
4.2.40 MSPGANG_Set_MCU_Name
The MSPGANG_Set_MCU_Name allows to select desired target MCU.
Syntax
LONG MSPGANG_Set_MCU_Name(LPTSTR name);
Arguments
LPTSTR MCU_name MCU name, the same as it is listed in the GUI software
Result
LONG Error code

MSP-GANG.dll Description
www.ti.com
116
SLAU358Q–September 2011–Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.41 MSPGANG_HW_devices
The MSPGANG_HW_devices function scanning all available COM ports and saving information about
these ports in following structure.
#define MAX_COM_SIZE 60
#define HW_NAME_SIZE 30
typedef union
{
unsigned char bytes[HW_NAME_SIZE];
struct
{
unsigned short ComNo;
char ComName[7];
char description[HW_NAME_SIZE-2-7];
}x;
}COM_PORTS_DEF;
COM_PORTS_DEF *AvailableComPorts = NULL;
MSPGANG_HW_devices(MAX_COM_SIZE, (void **) &AvailableComPorts));
If detected, USB VCP information is placed at the first location.
Syntax
LONG MSPGANG_HW_devices(LONG max, void **AvailableComPorts)
Arguments
LONG max
void **AvailableComPorts
Result
LONG Error code

www.ti.com
MSP-GANG.dll Description
117
SLAU358Q–September 2011–Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.42 MSPGANG_GetProgressStatus
MSPGANG_GetProgressStatus gets progress status from MSP-GANG. The data received contains a
Gang Mask of all processes done in the previous function. Each bit in the Gang mask represents one
targeted device:
bit 0 → Target 1, bit 1 → Target 2, ... bit 7 → Target 8
For example, when connected_gang_mask is 0x7A, then targets 2, 4, 5, 6, and 7 are detected, and
communication with these targets is established. The cumulative mask contains the final result for all
targets.
Syntax
LONG MSPGANG_GetProgressStatus(void *lpData)
Arguments
void *lpData Pointer to structure below
Result
LONG Error code
#define SCRIPT_TEXT_SIZE 16
union GANG_PROGRESS_STATUS
{
BYTE bytes[PROGRESS_STATUS_SIZE+4];
struct
{
BYTE header;
BYTE ctr;
WORD task_ctr;
WORD chunk_ctr;
BYTE run;
BYTE ack;
WORD Finished_tasks_mask;
//--- 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;
//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 Connected_gang_mask;
BYTE Erased_gang_mask;
BYTE BlankCheck_gang_mask;
BYTE Programmed_gang_mask;
BYTE Verified_gang_mask;