CLASSB_RST_IOTest

Function

CLASSB_TEST_STATUS CLASSB_RST_IOTest(CLASSB_PORT_INDEX port, CLASSB_PORT_PIN pin, CLASSB_PORT_PIN_STATE state);

Summary

This self-test can be used to perform plausibility checks on IO pins.

Description

This self-test checks whether a given IO pin is at the expected logic state. As the exact use of an IO pin is decide by the application, it is the responsibility of the caller to configure the IO pin direction and drive the pin to the expected state before calling this self-test.

Precondition

Before testing an output pin, call CLASSB_IO_InputSamplingEnable() function to enable input sampling for the IO pin.

Parameters

port - Index of the IO PORT. Defined by enum CLASSB_PORT_INDEX.

pin - Index of the pin on the given PORT. Defined by enum CLASSB_PORT_PIN.

state - Expected logic state of the IO pin. It can be PORT_PIN_LOW or PORT_PIN_HIGH.

Returns

CLASSB_TEST_STATUS - Status of the test.

Example

CLASSB_TEST_STATUS classb_test_status = CLASSB_TEST_NOT_EXECUTED;
// Perform test of an IO pin at run-time
classb_test_status = CLASSB_RST_IOTest(PORTB, PIN31, PORT_PIN_HIGH);

Remarks

This self-test can be used only during run-time.