AVR SD Safety Framework 1.0.0
Loading...
Searching...
No Matches
midware_clock_manager_diag.c File Reference

Implements APIs for the Clock Manager Diagnostics. More...

#include <stdbool.h>
#include <stdint.h>
#include <define_error_flags.h>
#include <driver_clkctrl.h>
#include <driver_errctrl.h>
#include <midware_clock_manager_diag.h>
#include <midware_shared_diag_private.h>
#include <xc.h>

Macros

#define CRITICAL_CH_CONFIG   ((uint8_t)ERRCTRL_FLOAT_bm | (uint8_t)ERRCTRL_ERRLVL_CRITICAL_gc)
 Default to maximum criticality and float I/O in case of erroneously restoring with default backup values.
#define CFD_CTRLA_RESET_CONFIG   0U
 Default reset value of CFD CTRLA register in case of erroneously restoring with default backup values.
#define CFM_DIAG_REF_CYCLES   8U
 Datasheet CFM test reference count, expected result is 8 +/- 2 cycles.
#define CFM_DIAG_INSIDE_WIN_LOW   5U
 Low window limit when measured count is expected inside the window.
#define CFM_DIAG_INSIDE_WIN_HIGH   11U
 High window limit when measured count is expected inside the window.
#define CFM_DIAG_ABOVE_WIN_LOW   2U
 Low window limit when measured count is expected above the window.
#define CFM_DIAG_ABOVE_WIN_HIGH   5U
 High window limit when measured count is expected above the window.
#define CFM_DIAG_BELOW_WIN_LOW   12U
 Low window limit when measured count is expected below the window.
#define CFM_DIAG_BELOW_WIN_HIGH   15U
 High window limit when measured count is expected below the window.

Functions

errFlag_t MW_DiagClockCfd0Begin (void)
 Starts error injection diagnostic to detect faults in the Clock Failure Detection 0 (CFD0) monitor.
errFlag_t MW_DiagClockCfd0End (void)
 Completes error injection diagnostic to detect faults in the Clock Failure Detection 0 (CFD0) monitor.
bool MW_IsDiagCfd0Ongoing (void)
 Checks whether the CFD0 error injection diagnostic is ongoing.
errFlag_t MW_DiagClockCfd1Begin (void)
 Starts error injection diagnostic to detect faults in the Clock Failure Detection 1 (CFD1) monitor.
errFlag_t MW_DiagClockCfd1End (void)
 Completes error injection diagnostic to detect faults in the Clock Failure Detection 1 (CFD1) monitor.
bool MW_IsDiagCfd1Ongoing (void)
 Checks whether the CFD1 error injection diagnostic is ongoing.
errFlag_t MW_DiagClockCfm0 (void)
 Performs error injection diagnostic to detect faults in the Clock Frequency Measure 0 (CFM0) monitor.
errFlag_t MW_DiagClockCfm1 (void)
 Performs error injection diagnostic to detect faults in the Clock Frequency Measure 1 (CFM1) monitor.

Detailed Description

Implements APIs for the Clock Manager Diagnostics.

Macro Definition Documentation

◆ CFD_CTRLA_RESET_CONFIG

#define CFD_CTRLA_RESET_CONFIG   0U

Default reset value of CFD CTRLA register in case of erroneously restoring with default backup values.

◆ CFM_DIAG_ABOVE_WIN_HIGH

#define CFM_DIAG_ABOVE_WIN_HIGH   5U

High window limit when measured count is expected above the window.

◆ CFM_DIAG_ABOVE_WIN_LOW

#define CFM_DIAG_ABOVE_WIN_LOW   2U

Low window limit when measured count is expected above the window.

◆ CFM_DIAG_BELOW_WIN_HIGH

#define CFM_DIAG_BELOW_WIN_HIGH   15U

High window limit when measured count is expected below the window.

◆ CFM_DIAG_BELOW_WIN_LOW

#define CFM_DIAG_BELOW_WIN_LOW   12U

Low window limit when measured count is expected below the window.

◆ CFM_DIAG_INSIDE_WIN_HIGH

#define CFM_DIAG_INSIDE_WIN_HIGH   11U

High window limit when measured count is expected inside the window.

◆ CFM_DIAG_INSIDE_WIN_LOW

#define CFM_DIAG_INSIDE_WIN_LOW   5U

Low window limit when measured count is expected inside the window.

◆ CFM_DIAG_REF_CYCLES

#define CFM_DIAG_REF_CYCLES   8U

Datasheet CFM test reference count, expected result is 8 +/- 2 cycles.

◆ CRITICAL_CH_CONFIG

#define CRITICAL_CH_CONFIG   ((uint8_t)ERRCTRL_FLOAT_bm | (uint8_t)ERRCTRL_ERRLVL_CRITICAL_gc)

Default to maximum criticality and float I/O in case of erroneously restoring with default backup values.