3.1.3.1 DIAG_CLK_Frequency()

diag_result_t DIAG_CLK_Frequency (void )

Checks the stability and reliability of the oscillation at the expected system clock frequency.

The frequency of the system clock is measured and evaluated against a target with a tolerance. This is done by measuring a Timer/Counter (TC) with the system clock source against the Periodic Interrupt Timer (PIT) with an independent clock source.

The PIT interrupt is scheduled periodically and a TC is configured with a period value of 0xFFFF. The Real-Time Clock (RTC) interrupt compares the absolute difference between the count in the TC and a predefined reference. If it is greater than expected, diag_clk_frequency_error is set.
Parameters:
None.
Returns:

DIAG_PASS - Success  

DIAG_FAIL - Failure  

DIAG_INVALID_ARG - Invalid  

DIAG_UNDEFINED - Undefined