slau358q.pdf - 第85页

www.ti.com MSP-GANG.dll Description 85 SLAU358Q – September 2011 – Revised October 2019 Submit Documentation Feedback Copyright © 2011–2019, Texas Instruments Incorporated Dynamic Link Library for MSP-GANG Programmer 4.2…

100%1 / 142
MSP-GANG.dll Description
www.ti.com
84
SLAU358QSeptember 2011Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.7 MSPGANG_GetErrorString
Returns the error string for the selected error number (response from any functions that returns error
status).
Syntax
LPTSTR MSPGANG_GetErrorString(LONG lErrorNumber)
Arguments
LONG lErrorNumber Error number
Result
LPTSTR Error string
4.2.8 MSPGANG_SelectBaudrate
MSPGANG_SelectBaudrate sets the rate of the serial communications. The default is 9600 baud. Baud
rate index 0 to 4, representing the baud rate. The Select Baud Rate command takes effect (that is,
changes the baud rate) immediately.
Syntax
LONG MSPGANG_SelectBaudrate(LONG lBaud)
Arguments
LONG lBaud Baud rate in bytes per second
0 = 9600 baud (default)
1 = 19200 baud
2 = 38400 baud
3 = 57600 baud
4 = 115200 baud
Result
LONG Error code
4.2.9 MSPGANG_GetDiagnostic
See the Get Diagnostic command (Section 3.5.2.4) for detailed information about received data contents.
Syntax
LONG MSPGANG_GetDiagnostic(void **lpData)
Arguments
void ** lpData Pointer to data buffer
Result
LONG Error code
www.ti.com
MSP-GANG.dll Description
85
SLAU358QSeptember 2011Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.10 MSPGANG_MainProcess
MSPGANG_MainProcess starts the execution if all function saved inside image memory (or SD card
memory). That includes targets initialization, fuse check, memory erase, blank check, program,
verification, and more, if selected (for example, DCO calibration).
Syntax
LONG MSPGANG_MainProcess(LONG timeout)
Arguments
LONG timeout In seconds
Result
LONG Error code
4.2.11 MSPGANG_InteractiveProcess
MSPGANG_InteractiveProcess starts the execution if all function provided in the interactive mode, similar
to the MSPGANG_MainProcess function; however, data is taken from the PC, not from the image (or SD)
memory.
Syntax
LONG MSPGANG_InteractiveProcess(LONG timeout)
Arguments
LONG timeout In seconds
Result
LONG Error code
4.2.12 MSPGANG_Interactive_Open_Target_Device
MSPGANG_Interactive_Open_Target_Device is used in the interactive mode and in initializing access to
target devices (setting Vcc, checking fuse, and initializing JTAG or SBW communication with target
devices). The argument 'name' is displayed on the LCD display. It can contains no more then 16
characters. Extra characters are ignored.
Syntax
LONG MSPGANG_Interactive_Open_Target_Device(LPTSTR name)
Arguments
LPTSTR name
Result
LONG Error code
MSP-GANG.dll Description
www.ti.com
86
SLAU358QSeptember 2011Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.13 MSPGANG_Interactive_Close_Target_Device
MSPGANG_Interactive_Close_Target_Device is used in the interactive mode and in closing access to
target devices.
Syntax
LONG MSPGANG_Interactive_Close_Target_Device(void)
Result
LONG Error code
4.2.14 MSPGANG_Interactive_DefReadTargets
The target device must be opened first if not open yet (see MSPGANG_Interactive_Open_Target_Device,
Section 4.2.12).
MSPGANG_Interactive_DefReadTargets reads the contents of the selected target devices (one to eight
targets) simultaneously from Start_addr to the End_addr and saves it in the internal data buffer (see
DATA_BUFFERS dat; structure for details).
Syntax
LONG MSPGANG_Interactive_DefReadTargets(BYTE mask, BYTE bar_min, BYTE bar_max, LONG
Start_addr, LONG End_addr)
Arguments
BYTE mask Mask of the target devices that data should be read from
BYTE bar_min Beginning progress bar value displayed on the LCD display (valid values are 0 to 100).
BYTE bar_max Ending —,,,---
LONG Start_addr Data read from Start_addr location
LONG End_addr Data read up to the End_addr location
Result
LONG Error code
Example
Get data from the info memory for the F2xx from each 8 target devices
DATA_BUFFERS *DBuf;
void *temp;
MSPGANG_GetDataBuffers_ptr((&temp));
DBuf = (DATA_BUFFERS *)temp;
long baddr, MCU_addr;
.................
//read data from all targets and save it in the internal DATA_BUFFERS
MSPGANG_Interactive_DefReadTargets( 0xFF, 0, 100, 0x10C0, 0x10FF);
//get the base address of data in the DATA_BUFFERS
baddr = MSPGANG_Convert_Address( MCU_TO_DATABUF, 0x10C0 );
if( baddr >= 0 )
.........
//data at the MCU_addr 0x10C0 to 0x10FF), target -> 1..8
data = DBuf->GangRx[ baddr + (MCU_addr-0x10C0)][target-1];
//get data for each target from internal buffer
.........