slau358q.pdf - 第120页

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

100%1 / 142
www.ti.com
MSP-GANG.dll Description
119
SLAU358QSeptember 2011Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.43 MSPGANG_GetAPIStatus
MSPGANG_GetAPIStatus gets the selected status or results from the MSP-Gang programmer. The
following numbers (no) are available:
GET_APP_FLAGS 10
GET_LAST_STATUS 12
GET_LAST_ERROR_NO 14
Syntax
LONG MSPGANG_GetAPIStatus (LONG no, BYTE *data)
Arguments
LONG no Status type
BYTE *data Pointer to status results. See below.
Result
LONG Error code
no = GET_APP_FLAGS (10)
response:
Byte-0
b0 (LSB) Hardware rev-0
b1 initialization finished (after power-up)
b2 access key CRC error
b3 invalid access key
b4 running from SD card
b5 File in SD card found
b6 target secure device in process
b7 keypad enabled
Byte-1
b0 key pressed
b1..b7 spare
Byte-2 spare
Byte-3 spare
no = GET_LAST_STATUS (12)
response:
Byte-0 Error number in the last execute transaction
Byte-1 targets connection mask
Byte-2 active targets mask
Byte-3 targets error mask
Byte-4..7 spare
no = GET_LAST_ERROR_NO (14)
Byte-0 last error number from MSP-GANG for any command
error numbers 1...255 - see error list numbers
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 );