slau358q.pdf - 第121页

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

100%1 / 142
MSP-GANG.dll Description
www.ti.com
120
SLAU358QSeptember 2011Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.44 MSPGANG_Set_IO_State
Modifies the static levels on the I/O pins (JTAG lines). The JTAG lines can be set to the desired level (low
or high) or they can be high impedance. The state and the level can be the same on all outputs. The level
on one selected line (RST, TDI, TDOI, TMS or BSL-RX) can be different for each target.
Syntax
LONG MSPGANG_Set_IO_State(long Vcc_mV, BYTE * data );
Arguments
Vcc_mV Voltage level in mV on the target’s V
CC
data[0] Open destination buffer for output and transferred data for each targets.
0 = None
1 = TDI (target1 to target8)
2 = TDOI (target1 to target8)
3 = TMS (target1 to target8)
4 = RST (target1 to target8)
5 = BSL-RX (target1 to target8)
data[1] Data transferred to the buffer above.
b0 to b7 target1 to target8
data[2] Output enable bits: 0 = high impedance, 1 = output
b2 (0x04) common RST the same state for all 8 targets (Note: if the RST buffer above is selected,
then this state is ignored)
b3 (0x08) common TEST the same state for all 8 targets
b4 (0x10) common TCK the same state for all 8 targets
b5 (0x20) common TMS the same state for all 8 targets (Note: if the TMS buffer above is selected,
then this state is ignored)
data[3] Output level on all targets: 0 = LOW, 1 = HIGH
b2 (0x04) common RST the same level for all eight targets (Note: if the RST buffer above is selected,
then this state is ignored)
b3 (0x08) common TEST the same level for all eight targets
b4 (0x10) common TCK the same level for all eight targets
b5 (0x20) common TMS the same level for all eight targets (Note: if the TMS buffer above is selected,
then this state is ignored)
data[4] V
CC
enable bits to each target
b0 to b7 target1 to target8
data[5] I
CC
HI enable: 0 = disable, 1 = enable
data[6] spare
data[7] spare
Example 1
Generate a short RST pulse on target 1 only and force RST level LOW on targets 2 to 5 and RST level
HIGH on targets 6 and 7. V
CC
on targets 1 to 7 is 3.3 V ( 0x0CE4) and on target 8 is 0 V (disabled).
BYTE data[8] = { 04 60 00 00 7F 00 00 00 };
MSPGANG_Set_IO_State( 3300, data );
then
data[1] = 0x61;
MSPGANG_Set_IO_State( 3300, data );
www.ti.com
MSP-GANG.dll Description
121
SLAU358QSeptember 2011Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
Example 2
Generate a short RST pulse on all targets. V
CC
on targets 1 to 7 is 3.3 V ( 0x0CE4) and on target 8 is 0 V
(disabled).
BYTE data[8] = { 00 00 04 00 7F 00 00 00 };
MSPGANG_Set_IO_State( 3300, data );
then
data[4] = 0x04;
MSPGANG_Set_IO_State( 3300, data );
MSP-GANG.dll Description
www.ti.com
122
SLAU358QSeptember 2011Revised 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 );