47 const uint8_t noErrorFlagVal = (uint8_t)
NO_ERROR;
48 uint8_t combinedFlags = noErrorFlagVal;
53 const bool useRegProtect =
true;
54 const bool useRegLock =
false;
55 const bool useInstrMode =
false;
65 if (combinedFlags != noErrorFlagVal)
74 const uint8_t noErrorFlagVal = (uint8_t)
NO_ERROR;
75 uint8_t combinedFlags = noErrorFlagVal;
85 const bool useContinuousMode =
true;
89 combinedFlags |= (uint8_t)
MW_StartCfd0(cfdSource, cfdRef);
90 combinedFlags |= (uint8_t)
MW_StartCfm0(cfmSource, cfmRef, cfmWindow, useContinuousMode);
95 combinedFlags |= (uint8_t)
MW_StartCfd1(cfdSource, cfdRef);
100 combinedFlags |= (uint8_t)
MW_StartCfm1(cfmSource, cfmRef, cfmWindow, useContinuousMode);
105 if (combinedFlags != noErrorFlagVal)
117 DetermineErrChConfigs(&configs);
143 const uint8_t noErrorFlagVal = (uint8_t)
NO_ERROR;
144 uint8_t combinedFlags = noErrorFlagVal;
159 if (combinedFlags != noErrorFlagVal)
168 const uint8_t noErrorFlagVal = (uint8_t)
NO_ERROR;
169 uint8_t combinedFlags = noErrorFlagVal;
179 if (combinedFlags != noErrorFlagVal)
errCrit_t
Defines criticality levels used by EH_HandleError to determine the appropriate response for each repo...
Defines error flag type for indicating detected errors in Middleware services.
errFlag_t
Defines the error flag used by Middleware services to indicate error detection.
Defines for IDs associated with specific errors.
errId_t
Defines unique Error IDs for reporting system errors to EH_HandleError.
@ ERRID_DIAG_ERRCH_EVSYS1
@ ERRID_DIAG_ERRCH_EVSYS0
@ ERRID_DIAG_ERRCH_EEPROM
cfmReference_t
Type definitions for available Clock Frequency Measure (CFM) references used for configuring the CFMs...
errFlag_t MW_DiagClockCfd0Begin(void)
Starts error injection diagnostic to detect faults in the Clock Failure Detection 0 (CFD0) monitor.
cfdSource_t
Type definitions for available Clock Failure Detection (CFD) sources used for configuring the CFDs.
void MW_EnableClockInterrupts(void)
Enables all Clock Failure Detect (CFD) and Clock Frequency Measure (CFM) interrupts.
errFlag_t MW_DiagClockCfm1(void)
Performs error injection diagnostic to detect faults in the Clock Frequency Measure 1 (CFM1) monitor.
cfdReference_t
Type definitions for available Clock Failure Detection (CFD) references used for configuring the CFDs...
errFlag_t MW_StartCfd1(cfdSource_t src, cfdReference_t ref)
Starts Clock Failure Detect 1 (CFD1) to monitor the configured clock source with the configured refer...
cfmSource_t
Type definitions for available Clock Frequency Measure (CFM) sources used for configuring the CFMs.
errFlag_t MW_StartCfm0(cfmSource_t src, cfmReference_t ref, cfmWindow_t window, bool useContinuous)
Starts continuous Clock Frequency Measure 0 (CFM0) to monitor the configured clock source with the co...
errFlag_t MW_StartCfm1(cfmSource_t src, cfmReference_t ref, cfmWindow_t window, bool useContinuous)
Starts continuous Clock Frequency Measure 1 (CFM1) to monitor the configured clock source with the co...
errFlag_t MW_StartCfd0(cfdSource_t src, cfdReference_t ref)
Starts Clock Failure Detect 0 (CFD0) to monitor the configured clock source with the configured refer...
errFlag_t MW_DiagClockCfm0(void)
Performs error injection diagnostic to detect faults in the Clock Frequency Measure 0 (CFM0) monitor.
errFlag_t MW_DiagClockCfd1Begin(void)
Starts error injection diagnostic to detect faults in the Clock Failure Detection 1 (CFD1) monitor.
errFlag_t MW_SetMainClockFrequency(clkFrq_t frequency, clkFrqDiv_t divider)
Initializes main clock with internal High Frequency Oscillator (OSCHF) as clock source.
const errCrit_t errorIdCritLut[ERRID_MAX]
Configures the criticality of all Error IDs for handling in EH_HandleError.
void EH_HandleError(errFlag_t flag, errId_t id)
Handles error based on configured Error ID criticality if the error flag is set.
errFlag_t MW_DiagErrorChannelCfd1(void)
Performs error injection diagnostic to detect faults in the CFD1 error channel.
errFlag_t MW_ConfigErrorChannels(const errChConfigs_t *configs, uint8_t timeout)
Sets the error controller timeout duration and configures all error channels with the provided settin...
errFlag_t MW_DiagErrorChannelEvsys0(void)
Performs error injection diagnostic to detect faults in the EVSYS0 error channel.
errFlag_t MW_DiagErrorChannelSplim(void)
Performs error injection diagnostic to detect faults in the SPLIM error channel.
errFlag_t MW_DiagErrorChannelCfm1(void)
Performs error injection diagnostic to detect faults in the CFM1 error channel.
errFlag_t MW_DiagErrorChannelCfm0(void)
Performs error injection diagnostic to detect faults in the CFM0 error channel.
errFlag_t MW_DiagErrorChannelEeprom(void)
Performs error injection diagnostic to detect faults in the EEPROM error channel.
errFlag_t MW_DiagErrorChannelCfd0(void)
Performs error injection diagnostic to detect faults in the CFD0 error channel.
errFlag_t MW_DiagErrorChannelEvsys1(void)
Performs error injection diagnostic to detect faults in the EVSYS1 error channel.
@ ERRCH_SEVERITY_CRITICAL
@ ERRCH_SEVERITY_NONCRITICAL
@ ERRCH_SEVERITY_NOTIFICATION
errFlag_t MW_SetIntPriority(bool useRoundRobin, uint8_t altStartVect, uint8_t highPriorityVect)
Configures interrupt scheduling and priority scheme.
void MW_SetIntVectorLocation(bool expectAltLoc)
Configures whether the device should expect an alternative interrupt vector table location (see IVSEL...
errFlag_t MW_DiagNvmEepromEcc(void)
This function performs error injection diagnostic to detect faults in the NVMCTRL ECC checkers with E...
errFlag_t MW_SetRamStackLimit(uint16_t splimAddr, bool lockEnable)
Sets the Stack Pointer Limit value and optionally locks the value to prevent modification.
errFlag_t MW_DiagRamEcc(void)
This function performs error injection diagnostic to detect faults in the redundant RAMCTRL ECC check...
errFlag_t MW_DiagRamParity(void)
This function performs error injection diagnostic to detect faults in the RAM parity checker triggere...
errFlag_t MW_SetNvmEccAllOnes(eccAllOnes_t config)
Sets ECC all Ones (ECCALL1) scheme.
errFlag_t MW_DiagNvmParity(void)
This function performs error injection diagnostic to detect faults in the CPU and NVM bus parity chec...
errFlag_t MW_DiagNvmFlashEcc(void)
This function performs error injection diagnostic to detect faults in the NVMCTRL ECC checkers with F...
void MW_SetVmonSleep(bool enableInSleep, bool useFullPowerMode)
Configures Voltage Monitor (VMON) operation during Standby or Power-Down sleep.
errFlag_t MW_ConfigVlm(vlmThreshold_t threshold, vlmTrigger_t trigger)
Configures the Voltage Level Monitor (VLM) with the provided voltage threshold and trigger condition.
sleepMode_t
Type defines for available sleep modes.
errFlag_t MW_SetSleepMode(sleepMode_t sleepMode)
Sets the sleep mode to be used when entering Sleep.
void MW_EnablePowerInterrupts(void)
Enables power related interrupts, including VMON, VLM and sleep error related interrupts.
errFlag_t InitPower(void)
Private function, only exposed for unit testing and should not be called directly.
void RunStartupDiagParity(void)
Private function, only exposed for unit testing and should not be called directly.
void RunStartupDiagErrorCh(void)
Private function, only exposed for unit testing and should not be called directly.
errFlag_t InitClocks(void)
Private function, only exposed for unit testing and should not be called directly.
errFlag_t InitInterrupts(void)
Private function, only exposed for unit testing and should not be called directly.
errFlag_t InitWatchdogs(void)
Private function, only exposed for unit testing and should not be called directly.
errFlag_t InitErrorController(void)
Private function, only exposed for unit testing and should not be called directly.
void RunStartupDiagEcc(void)
Private function, only exposed for unit testing and should not be called directly.
void RunStartupDiagClock(void)
Private function, only exposed for unit testing and should not be called directly.
errFlag_t InitMemories(void)
Private function, only exposed for unit testing and should not be called directly.
#define DIAG_STARTUP_CFM1
Enables or disables execution of the CFM1 diagnostic in T_RunStartupDiagnostics.
#define DIAG_STARTUP_ERRCH_CFM0
Enables or disables execution of the CFM0 error channel diagnostic in T_RunStartupDiagnostics.
#define INIT_INT_LVL1
Configures which interrupt vector should have the level 1 (highest) priority.
#define INIT_CFM0_WIN_REF
Configures the reference value for the Clock Frequency Measure 0 (CFM0) window.
#define DIAG_STARTUP_CFD0
Enables or disables execution of the CFD0 diagnostic in T_RunStartupDiagnostics.
#define INIT_REDUNDANT_CFD
Enables or disables redundant CFD initialization.
#define INIT_REDUNDANT_CFM
Enables or disables redundant CFM initialization.
#define SWDT_OPEN_WINDOW
Configures the open window size used for the Synchronous Watchdog (SWDT).
#define INIT_INT_ROUND_ROBIN
Configures round robin schedule scheme for level 0 interrupts.
#define INIT_VMON_FULL_POWER_MODE
Configures the Voltage Regulator Monitor (VMON) power mode.
#define INIT_STACK_LIMIT_LOCK
Configures whether the Stack Pointer Limit (SPLIM) LOCK should be enabled or disabled.
#define INIT_CLOCK_FRQ
Configures the clock frequency for the device.
#define DIAG_STARTUP_ERRCH_SPLIM
Enables or disables execution of the SPLIM error channel diagnostic in T_RunStartupDiagnostics.
#define INIT_INT_LVL0_START
Configures the execution priority order of level 0 (normal priority) interrupt vectors.
#define DIAG_STARTUP_CFD1
Enables or disables execution of the CFD1 diagnostic in T_RunStartupDiagnostics.
#define INIT_FLOAT_NOTIFICATION
Configures whether all I/O pins should be floated (tri-stated) when an error controller channel,...
#define INIT_VMON_ALWAYS_ON
Configures whether the Voltage Regulator Monitor (VMON) is enabled in deep sleep modes.
#define DIAG_STARTUP_ERRCH_EVSYS1
Enables or disables execution of the EVSYS1 error channel diagnostic in T_RunStartupDiagnostics.
#define DIAG_STARTUP_ECC_EEPROM
Enables or disables execution of the EEPROM diagnostic in T_RunStartupDiagnostics.
#define DIAG_STARTUP_ERRCH_CFD0
Enables or disables execution of the CFD0 error channel diagnostic in T_RunStartupDiagnostics.
#define INIT_SWDT_DURATION
Configures the run-time duration between executing T_InitSafetySystem and the first T_HandleSyncWatch...
#define INIT_VLM_TRIGGER
Configures the Voltage Level Monitor trigger condition.
#define INIT_CLOCK_DIV
Configures the clock division for the device.
#define INIT_CFM0_WIN_HIGH
Configures the high value of the Clock Frequency Measure 0 (CFM0) window.
#define DIAG_STARTUP_ERRCH_CFM1
Enables or disables execution of the CFM1 error channel diagnostic in T_RunStartupDiagnostics.
#define INIT_ERRCTRL_TIMEOUT
Configures the ALARM and CONFIG state timeout period for the Error Controller.
#define DIAG_STARTUP_ERRCH_EEPROM
Enables or disables execution of the EEPROM error channel diagnostic in T_RunStartupDiagnostics.
#define DIAG_STARTUP_ERRCH_CFD1
Enables or disables execution of the CFD1 error channel diagnostic in T_RunStartupDiagnostics.
#define INIT_WDT_DURATION
Configures the timeout period, from executing T_InitSafetySystem to the first T_HandleWatchdog call,...
#define DIAG_STARTUP_CFM0
Enables or disables execution of the CFM0 diagnostic in T_RunStartupDiagnostics.
#define INIT_CFM0_WIN_LOW
Configures the low value of the Clock Frequency Measure 0 (CFM0) window.
#define INIT_FLOAT_NONCRITICAL
Configures whether all I/O pins should be floated (tri-stated) when an error controller channel,...
#define INIT_INT_ALT_VECTOR_LOC
Configures alternative interrupt vector location when using a bootloader.
#define INIT_NVM_ECC_ALL_ONES
Configures the "ECC all ones" scheme in Non-Volatile Memory.
#define INIT_STACK_LIMIT
Configures the max depth of the hardware call stack by setting the Stack Pointer limit address.
#define DIAG_STARTUP_ERRCH_EVSYS0
Enables or disables execution of the EVSYS0 error channel diagnostic in T_RunStartupDiagnostics.
#define INIT_VLM_THRESHOLD
Configures the Voltage Level Monitor threshold.
#define ENABLED
Used to enable optional Task features through macro configurations.
errFlag_t MW_SetWdtTimeout(wdtTimeout_t window, wdtTimeout_t period)
Configures and enables the Watchdog Timer in either Normal or Window mode.
void MW_EnableSwdt(bool useCcp, bool useLock, bool useInstrMode)
Enables the Synchronous Watchdog Timer with the provided configurations.
wdtTimeout_t
Defines available timeout configurations for the Watchdog Timer.
errFlag_t MW_SetSwdtResetValue(uint32_t resetVal)
Sets the Synchronous Watchdog Timer countdown reset value.
void MW_EnableSwdtInterrupts(void)
Enables all Synchronous Watchdog error interrupts.
errFlag_t MW_SetSwdtWindowValue(uint16_t window)
Sets the Synchronous Watchdog Timer open window value.
Contains API prototypes for the Clock Manager Diagnostics.
Contains API prototypes and defines for the Error Manager Diagnostics.
Contains API prototypes for the Memory Manager Diagnostics.
Struct for configuring the Clock Frequency Measure window.
Holds an error channel configuration for configuring the ERRCTRL.
Holds configurations for all error channels.
Contains private function prototypes for tasks_startup.h.