XJAPI_Scan

Execute a JTAG scan cycle.

XJAPI_ERROR XJAPI_Scan(
    XJAPI_SCAN_TYPE scanType,
    unsigned int   length,
    unsigned int * tdiData,
    unsigned int * tdoData
);

Arguments

scanType
Either XJAPI_SCAN_DR or XJAPI_SCAN_IR to indicate the register to scan.
length
The length of the chain to send (in bits)
tdiData
The data to send from the host to the chain. The data is packed into 32 bit words, with the least-significant bit of the first word clocked into the chain first.
tdoData
The data returned from the chain back to the host. The data is packed into 32 bit words, with the first bit out of the chain in the least-significant bit of the first word.

Return value

An XJAPI_ERROR value indicating whether the function call was successful or not.

Notes

After this function has been called, then the TAP controller will be left in the state specified by XJAPI_SetEndState function or IDLE if no end state has been specified.

This function can only be used once the hardware has been initialised with XJAPI_HardwareSetup.

The XJAPI_ScanMultiple function is able to use XJAPI_SCAN_CLOCK to toggle TCK as one of its scan types. To achieve this without performing any other scans, use XJAPI_ClockChain.

Example

XJAPI_ERROR ec;
const int DEVICECOUNT = 2;
unsigned int tdiData[DEVICECOUNT] = { 0, };
unsigned int idCodes[DEVICECOUNT];

ec = XJAPI_TmsReset();
if (ec != XJAPI_SUCCESS) {
    // handle error
    ...
}

// Scan out the idcodes
ec = XJAPI_Scan(XJAPI_SCAN_DR, 32 * DEVICECOUNT, tdiData, idCodes);
if (ec != XJAPI_SUCCESS) {
    // handle error
    ...
}