XJAPI_FindPioPin

Find a PIO pin that is defined in the pin mapping, returning its pin number.

XJAPI_ERROR XJAPI_FindPioPin(
    const char *pioPinName,
    unsigned int *pinNumber
);

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

pioPinName
The name of the PIO pin.
pinNumber
Receives the number of the PIO pin with the specified name. This value is 1 based, so has a range of 1 to 20 inclusive. If the function fails, pinNumber is set to 0.

Return value

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

XJAPI_ERROR_NOTFOUND
The PIO pin was not found.
XJAPI_ERROR_PARAMETER1
pioPinName is NULL.
XJAPI_ERROR_PARAMETER2
pinNumber is NULL.
XJAPI_ERROR_GENERAL
Some other error occurred, e.g. the hardware has not yet been initialised.

Notes

XJAPI_HardwareSetup must be called before this function.