DIAG_ClockLineFreq()

diag_clock_line_status_t DIAG_ClockLineFreq (uint32_t sysclock, uint8_t linefreq, uint8_t tolerance)

The Clock Test Using Line Frequency implements the independent-time-slot-monitoring H.2.18.10.4 defined in the IEC60370 standard. It verifies the reliability of the system clock (i.e., the system clock should neither be too fast nor too slow). This test uses the AC line frequency to verify proper CPU clock operation. The AC line frequency is measured by using a zero-cross-detection circuit that is connected to the input of the Timer1 Gate Module.

Parameters:
in sysclock

- CPU system clock frequency value

in linefreq

- Reference line frequency value

in tolerance

- Limit for deviation frequency value

Returns:

DIAG_CLOCK_TEST_PASS - Success, DIAG_CLOCK_TEST_FAIL - Failure, DIAG_CLOCK_TEST_IN_PROGRESS - In-Progress, DIAG_CLOCK_TEST_COMPLETE - Complete, DIAG_INVALID_INPUT_TOLERANCE - Invalid, DIAG_INVALID_LINE_FREQ - Invalid,