3.2.14.6 DIAG_GPIO_PeripheralMux

Returns the status of the IO_PORTS_PERIPHERAL_MUX diagnostic

This function performs the Peripheral Multiplex Test on a selected GPIO.

It performs the following operations:

1. Set the direction of the GPIO pin under test to output.

2. Set the direction of the secondary GPIO pin to input.

3. Drive the state of the GPIO pin under test to low.

4. After the write to an the output pin, compare the secondary input pin with what the main output pin was supposed to drive.

5. Set the appropriate bit in the PORT_PINCFG mux register to 1 to assign it as as a peripheral.

6. Drive the state of the GPIO pin under test to high, and verify this no longer works.

7. Restores the output pin back low, and the PORT_PINCFG mux register setting back to 0.

DIAG_TEST_STATUS 
DIAG_GPIO_PeripheralMux
(
     DIAG_GPIO_PORT_INDEX output_port, 
     DIAG_GPIO_PORT_PIN output_pin,
     DIAG_GPIO_PORT_INDEX input_port, 
     DIAG_GPIO_PORT_PIN input_pin
);

Diagnostic verifies the following faults do not exist

  • Unable to select the appropriate peripheral function on a pin

Operating Mode

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

Parameters

  • output_port - Name of the port which contains the output pin.

  • output_pin - GPIO pin under test.
  • input_port - Name of the port which contains the input pin.

  • input_pin - GPIO pin used for reading to verify the status of the output pin.

Returns

  • DIAG_STATUS