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

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;

MSP-GANG.dll Description
www.ti.com
118
SLAU358Q–September 2011–Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
BYTE Secured_gang_mask;
BYTE spare[6];
BYTE error_no;
BYTE VTIO_32mV;
BYTE VccSt_LOW;
BYTE VccSt_HI;
// VccSt_LOW, VccSt_HI provide 2 bits to each target.
// Bit A for each target and bit B for each target.
// Bits B A
// 0 0 Vcc below 0.7 V
// 0 1 Vcc below Vcc min ( 0.7 V < Vcc < Vcc min)
// 1 0 Vcc over Vcc min (OK status)
// 1 1 Vcc over 3.8 V
BYTE VccErr;
// current Vcc below min
BYTE VccErr_Cumulative;
// Cumulative (during programming) Vcc below min
BYTE JTAG_init_err_mask;
BYTE JTAG_Fuse_already_blown_mask;
BYTE Wrong_MCU_ID_mask;
BYTE Progress_bar;
// 0...100%
char comment[SCRIPT_TEXT_SIZE];
}st;
};