XJAPI_ReadPinVoltage

Measures the voltage on an XJLink pin.

XJAPI_ERROR XJAPI_ReadPinVoltage(
    unsigned int pinNumber,
    unsigned int *voltageMilliVolts
);

Version

This function was added in XJTAG version 3.2.8 and so requires that XJAPI_VERSION be defined to be greater than or equal to 0x030208.

Arguments

pinNumber
The pin number on the XJLink to read. This value is 1 based, so has a range of 1 to 20 inclusive.
voltageMilliVolts
Receives the measured voltage in mV. If the function fails, voltageMilliVolts is set to 0.

Return value

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

XJAPI_ERROR_PARAMETER1
pinNumber is not in the range 1 to 20.
XJAPI_ERROR_PARAMETER2
voltageMilliVolts is NULL.
XJAPI_ERROR_GENERAL
Some other error occurred, e.g. the hardware has not yet been initialised, or there was an error making the measurement.

Notes

XJAPI_HardwareSetup must be called before this function.