3.2.14.1 DIAG_GPIO_InputComparison

Returns the status of the IO_PORTS_INPUT_COMPARISON diagnostic

This function performs the Input Comparison check on a selected GPIO.

It performs the following operations:

1. Sets the direction of both the primary as well as the secondary pins to input.

2. Compares the logic state of the main input pin with the logic state of the secondary input pin.

DIAG_TEST_STATUS 
DIAG_GPIO_InputComparison
(
     DIAG_GPIO_PORT_INDEX primary_port, 
     DIAG_GPIO_PORT_PIN primary_pin, 
     DIAG_GPIO_PORT_INDEX secondary_port, 
     DIAG_GPIO_PORT_PIN secondary_pin, 
     DIAG_GPIO_PIN_STATE state
 );

Diagnostic verifies the following faults do not exist

  • I/O pin stuck high
  • I/O pin stuck low
  • Input data value is not detected properly

Operating Mode

  • Interface can be used at POST and ‘On Demand’
Precondition
  • none

Parameters

  • primary_port - name of primary port
  • secondary_port - name of the secondary port
  • secondary_pin - name of secondary pin
  • state - state of pin

Returns

  • DIAG_STATUS