SLAU358Q September 2011 – October 2019
The target device must be opened first if not open yet (see MSPGANG_Interactive_Open_Target_Device, Section 4.2.12).
MSPGANG_Interactive_ReadTargets reads the contents of the selected target devices (one to eight targets) simultaneously from the locations specified in the configuration memory (see configuration setup for details) and saves it in the internal data buffer (see DATA_BUFFERS dat; structure for details).
Syntax
LONG MSPGANG_Interactive_ReadTargets(BYTE mask)
Arguments
BYTE mask | Mask of the target devices that data should be read from |
Result
LONG | Error code |
Example
Get data from each of the 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
.........