AVR SD Safety Framework 1.0.0
Loading...
Searching...
No Matches
Clock Manager

Contains API prototypes and defines for the Clock Manager. More...

Files

file  midware_clock_manager.c
 Implements APIs for the Clock Manager.
file  midware_clock_manager.h
 Contains API prototypes and defines for the Clock Manager.
file  midware_clock_manager_diag.c
 Implements APIs for the Clock Manager Diagnostics.
file  midware_clock_manager_diag.h
 Contains API prototypes for the Clock Manager Diagnostics.

Data Structures

struct  cfmWindow_t
 Struct for configuring the Clock Frequency Measure window. More...

Enumerations

enum  clkFrq_t
 Type definitions for available High Frequency Oscillator output frequencies used for configuring the main clock. More...
enum  clkFrqDiv_t
 Type definitions for available pre-scaler division used for configuring the main clock. More...
enum  cfdSource_t
 Type definitions for available Clock Failure Detection (CFD) sources used for configuring the CFDs. More...
enum  cfdReference_t
 Type definitions for available Clock Failure Detection (CFD) references used for configuring the CFDs. More...
enum  cfmSource_t
 Type definitions for available Clock Frequency Measure (CFM) sources used for configuring the CFMs. More...
enum  cfmReference_t
 Type definitions for available Clock Frequency Measure (CFM) references used for configuring the CFMs. More...

Functions

errFlag_t MW_GetClearClockCfd0Error (void)
 Reads and clears the flag indicating a clock failure detected by CFD0.
errFlag_t MW_GetClearClockCfd1Error (void)
 Reads and clears the flag indicating a clock failure detected by CFD1.
errFlag_t MW_GetClearClockCfm0Error (void)
 Reads and clears the flag indicating a clock frequency error measured by CFM0.
errFlag_t MW_GetClearClockCfm1Error (void)
 Reads and clears the flag indicating a clock frequency error measured by CFM1.
void MW_ClearClockCfmDoneFlags (void)
 Clears the Clock Frequency Measure Done (CFMDn) flags indicating that a clock frequency measurement is done.
errFlag_t MW_SetMainClockFrequency (clkFrq_t frequency, clkFrqDiv_t divider)
 Initializes main clock with internal High Frequency Oscillator (OSCHF) as clock source.
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 reference.
void MW_StopCfd0 (void)
 Disables Clock Failure Detect 0 (CFD0).
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 reference.
void MW_StopCfd1 (void)
 Disables Clock Failure Detect 1 (CFD1).
errFlag_t MW_StartCfm0 (cfmSource_t src, cfmReference_t ref, cfmWindow_t window, bool useContinuous)
 Starts Clock Frequency Measure 0 (CFM0) to monitor the configured clock source with the configured reference.
void MW_StopCfm0 (void)
 Disables Clock Frequency Measure 0 (CFM0).
errFlag_t MW_StartCfm1 (cfmSource_t src, cfmReference_t ref, cfmWindow_t window, bool useContinuous)
 Starts Clock Frequency Measure 1 (CFM1) to monitor the configured clock source with the configured reference.
void MW_StopCfm1 (void)
 Disables Clock Frequency Measure 1 (CFM1).
void MW_EnableClockInterrupts (void)
 Enables all Clock Failure Detect (CFD) and Clock Frequency Measure (CFM) interrupts.
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

Contains API prototypes and defines for the Clock Manager.

The Clock Manager provides services to Tasks to ensure correct interaction with features of the CLKCTRL peripheral.

UML Class Diagrams

UML Activity Diagrams

Enumeration Type Documentation

◆ cfdReference_t

Type definitions for available Clock Failure Detection (CFD) references used for configuring the CFDs.

Note
Group configurations are shifted to reduce value range gaps, simplifying input validation.
Enumerator
CFD_REF_OSC32K 

OSC32K as reference

CFD_REF_ONEDIV32 

1MHz/32 as reference

CFD_REF_XOSC32K 

XOSC32K as reference

CFD_REF_MAX 

Reserved/invalid, used as sentinel value for CFD reference.

◆ cfdSource_t

Type definitions for available Clock Failure Detection (CFD) sources used for configuring the CFDs.

Note
Group configurations are shifted to reduce value range gaps, simplifying input validation.
Enumerator
CFD_SRC_MAINCLK 

MAINCLK as source

CFD_SRC_OSCHF 

OSCHF as source

CFD_SRC_OSC32K 

OSC32K as source

CFD_SRC_XOSCHF 

XOSCHF as source

CFD_SRC_XOSC32K 

XOSC32K as source

CFD_SRC_INVALID1 

Reserved value

CFD_SRC_INVALID2 

Reserved value

CFD_SRC_EVSYS 

EVSYS as source

CFD_SRC_MAX 

Reserved/invalid, used as sentinel value for CFD source.

◆ cfmReference_t

Type definitions for available Clock Frequency Measure (CFM) references used for configuring the CFMs.

Note
Group configurations are shifted to reduce value range gaps, simplifying input validation.
Enumerator
CFM_REF_OSCHF 

OSCHF as reference

CFM_REF_XOSCHF 

XOSCHF as reference

CFM_REF_XOSC32K 

XOSC32K as reference

CFM_REF_OSC32K 

OSC32K as reference

CFM_REF_MAX 

Reserved/invalid, used as sentinel value for CFM reference.

◆ cfmSource_t

Type definitions for available Clock Frequency Measure (CFM) sources used for configuring the CFMs.

Note
Group configurations are shifted to reduce value range gaps, simplifying input validation.
Enumerator
CFM_SRC_MAINCLK 

MAINCLK as source

CFM_SRC_OSCHF 

OSCHF as source

CFM_SRC_OSC32K 

OSC32K as source

CFM_SRC_XOSCHF 

XOSCHF as source

CFM_SRC_XOSC32K 

XOSC32K as source

CFM_SRC_EVSYS 

EVSYS as source

CFM_SRC_MAX 

Reserved/invalid, used as sentinel value for CFM source.

◆ clkFrq_t

enum clkFrq_t

Type definitions for available High Frequency Oscillator output frequencies used for configuring the main clock.

Note
Group configurations are shifted to reduce value range gaps, simplifying input validation.
Enumerator
CLK_FRQ_1_MHZ 

1 MHz

CLK_FRQ_2_MHZ 

2 MHz

CLK_FRQ_3_MHZ 

3 MHz

CLK_FRQ_4_MHZ 

4 MHz

CLK_FRQ_INVALID 

Reserved value

CLK_FRQ_8_MHZ 

8 MHz

CLK_FRQ_12_MHZ 

12 MHz

CLK_FRQ_16_MHZ 

16 MHz

CLK_FRQ_20_MHZ 

20 MHz

CLK_FRQ_MAX 

Reserved/invalid, used as sentinel value for clock frequency.

◆ clkFrqDiv_t

Type definitions for available pre-scaler division used for configuring the main clock.

Note
Group configurations are shifted to reduce value range gaps, simplifying input validation.
Enumerator
CLK_FRQ_DIV2 

Divide by 2

CLK_FRQ_DIV4 

Divide by 4

CLK_FRQ_DIV8 

Divide by 8

CLK_FRQ_DIV16 

Divide by 16

CLK_FRQ_DIV32 

Divide by 32

CLK_FRQ_DIV64 

Divide by 64

CLK_FRQ_DIV_INVALID1 

Reserved value

CLK_FRQ_DIV_INVALID2 

Reserved value

CLK_FRQ_DIV6 

Divide by 6

CLK_FRQ_DIV10 

Divide by 10

CLK_FRQ_DIV12 

Divide by 12

CLK_FRQ_DIV24 

Divide by 24

CLK_FRQ_DIV48 

Divide by 48

CLK_FRQ_DIV_OFF 

Disables clock division

CLK_FRQ_DIV_MAX 

Reserved/invalid, used as sentinel value for clock frequency divider.

Function Documentation

◆ MW_ClearClockCfmDoneFlags()

void MW_ClearClockCfmDoneFlags ( void )

Clears the Clock Frequency Measure Done (CFMDn) flags indicating that a clock frequency measurement is done.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_DiagClockCfd0Begin()

errFlag_t MW_DiagClockCfd0Begin ( void )

Starts error injection diagnostic to detect faults in the Clock Failure Detection 0 (CFD0) monitor.

This function starts a CFD0 monitor diagnostic. If this function returns NO_ERROR, the diagnostic must be completed by calling MW_DiagClockCfd0End after sufficient time has elapsed.

Warning

The diagnostic configures OSC32K as the CFD0 reference clock. The CFD requires 10 reference clock cycles to complete one measurement period, but a previous measurement period may need to complete before the injected fault is detected. The calling function must therefore ensure that at least 20 OSC32K clock cycles elapse before calling MW_DiagClockCfd0End, because a missing CFD0 error flag may mean either that the measurement is not yet complete or that the injected fault was not detected.

Warning
This function backs up the current CFD0 configuration, CFD0 Error Channel configuration and CFD0 interrupt enable state, then applies temporary diagnostic configurations. Until

MW_DiagClockCfd0End is called, the CFD0 interrupt remains disabled and clock faults that CFD0 was configured to monitor before the diagnostic may not be detected. The original configurations are restored by MW_DiagClockCfd0End.

Note

This function disables global interrupts during its execution to ensure atomic execution and that accidental interrupts are not triggered by initiating the error injection.

Note

Error injection is not initiated if the Error Controller is not in NORMAL state, the CFD0 Error Channel is already set or a CFD0 diagnostic is already ongoing.

Return values
ERRORError injection did not start.
NO_ERRORCFD0 diagnostic successfully started.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_DiagClockCfd0End()

errFlag_t MW_DiagClockCfd0End ( void )

Completes error injection diagnostic to detect faults in the Clock Failure Detection 0 (CFD0) monitor.

This function completes the CFD0 monitor diagnostic started by MW_DiagClockCfd0Begin. It evaluates whether the injected fault set both the CFD0 error flag and CFD0 Error Channel status, then restores the original CFD0 configuration, CFD0 Error Channel configuration and CFD0 interrupt enable state.

Warning

This function must only be called after at least 20 OSC32K clock cycles have elapsed since MW_DiagClockCfd0Begin. Calling this function too early may cause the diagnostic to report ERROR because the injected fault has not yet been detected.

Note

This function disables global interrupts during its execution to ensure atomic execution and that accidental interrupts are not triggered by finishing the error injection.

Note

If no CFD0 diagnostic is ongoing, this function does nothing and returns ERROR to avoid modifying the CFD0 configuration or CFD0 Error Channel configuration.

Return values
ERRORFault detected in the CFD0 monitor or diagnostic was not started.
NO_ERRORNo fault detected in the CFD0 monitor.
Here is the call graph for this function:

◆ MW_DiagClockCfd1Begin()

errFlag_t MW_DiagClockCfd1Begin ( void )

Starts error injection diagnostic to detect faults in the Clock Failure Detection 1 (CFD1) monitor.

This function starts a CFD1 monitor diagnostic. If this function returns NO_ERROR, the diagnostic must be completed by calling MW_DiagClockCfd1End after sufficient time has elapsed.

Warning

The diagnostic configures OSC32K as the CFD1 reference clock. The CFD requires 10 reference clock cycles to complete one measurement period, but a previous measurement period may need to complete before the injected fault is detected. The calling function must therefore ensure that at least 20 OSC32K clock cycles elapse before calling MW_DiagClockCfd1End, because a missing CFD1 error flag may mean either that the measurement is not yet complete or that the injected fault was not detected.

Warning
This function backs up the current CFD1 configuration, CFD1 Error Channel configuration and CFD1 interrupt enable state, then applies temporary diagnostic configurations. Until

MW_DiagClockCfd1End is called, the CFD1 interrupt remains disabled and clock faults that CFD1 was configured to monitor before the diagnostic may not be detected. The original configurations are restored by MW_DiagClockCfd1End.

Note

This function disables global interrupts during its execution to ensure atomic execution and that accidental interrupts are not triggered by initiating the error injection.

Note

Error injection is not initiated if the Error Controller is not in NORMAL state, the CFD1 Error Channel is already set or a CFD1 diagnostic is already ongoing.

Return values
ERRORError injection did not start.
NO_ERRORCFD1 diagnostic successfully started.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_DiagClockCfd1End()

errFlag_t MW_DiagClockCfd1End ( void )

Completes error injection diagnostic to detect faults in the Clock Failure Detection 1 (CFD1) monitor.

This function completes the CFD1 monitor diagnostic started by MW_DiagClockCfd1Begin. It evaluates whether the injected fault set both the CFD1 error flag and CFD1 Error Channel status, then restores the original CFD1 configuration, CFD1 Error Channel configuration and CFD1 interrupt enable state.

Warning

This function must only be called after at least 20 OSC32K clock cycles have elapsed since MW_DiagClockCfd1Begin. Calling this function too early may cause the diagnostic to report ERROR because the injected fault has not yet been detected.

Note

This function disables global interrupts during its execution to ensure atomic execution and that accidental interrupts are not triggered by finishing the error injection.

Note

If no CFD1 diagnostic is ongoing, this function does nothing and returns ERROR to avoid modifying the CFD1 configuration or CFD1 Error Channel configuration.

Return values
ERRORFault detected in the CFD1 monitor or diagnostic was not started.
NO_ERRORNo fault detected in the CFD1 monitor.
Here is the call graph for this function:

◆ MW_DiagClockCfm0()

errFlag_t MW_DiagClockCfm0 ( void )

Performs error injection diagnostic to detect faults in the Clock Frequency Measure 0 (CFM0) monitor.

This function performs a CFM0 monitor diagnostic by running measurements with different window configurations and evaluating the responses. The CFM0 Done flag must be set after the expected time has elapsed for each measurement. The diagnostic performs three checks:

  • Inside the window, expecting no CFM0 error flag or Error Channel status.
  • Above the window, expecting both the CFM0 error flag and Error Channel status.
  • Below the window, expecting both the CFM0 error flag and Error Channel status.
Warning

This function backs up the current CFM0 configuration and CFM0 Error Channel configuration, then applies temporary diagnostic configurations. Normal CFM0 faults may be masked during execution. The original configurations are restored before this function returns.

Note

This function disables global interrupts during its execution to ensure atomic execution and that accidental interrupts are not triggered by initiating the error injection.

Note

If the CFM0 reference clock stops while CPU execution continues, the CFM0 Done flag is not set. The diagnostic treats this as a failed measurement after a bounded delay, restores the saved configuration, and returns ERROR.

Note

The diagnostic is not started if the Error Controller is not in NORMAL state or the CFM0 Error Channel is already set.

Return values
ERRORFault detected in the CFM0 monitor or diagnostic did not start.
NO_ERRORNo fault detected in the CFM0 monitor.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_DiagClockCfm1()

errFlag_t MW_DiagClockCfm1 ( void )

Performs error injection diagnostic to detect faults in the Clock Frequency Measure 1 (CFM1) monitor.

This function performs a CFM1 monitor diagnostic by running measurements with different window configurations and evaluating the responses. The CFM1 Done flag must be set after the expected time has elapsed for each measurement. The diagnostic performs three checks:

  • Inside the window, expecting no CFM1 error flag or Error Channel status.
  • Above the window, expecting both the CFM1 error flag and Error Channel status.
  • Below the window, expecting both the CFM1 error flag and Error Channel status.
Warning

This function backs up the current CFM1 configuration and CFM1 Error Channel configuration, then applies temporary diagnostic configurations. Normal CFM1 faults may be masked during execution. The original configurations are restored before this function returns.

Note

This function disables global interrupts during its execution to ensure atomic execution and that accidental interrupts are not triggered by initiating the error injection.

Note

If the CFM1 reference clock stops while CPU execution continues, the CFM1 Done flag is not set. The diagnostic treats this as a failed measurement after a bounded delay, restores the saved configuration, and returns ERROR.

Note

The diagnostic is not started if the Error Controller is not in NORMAL state or the CFM1 Error Channel is already set.

Return values
ERRORFault detected in the CFM1 monitor or diagnostic did not start.
NO_ERRORNo fault detected in the CFM1 monitor.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_EnableClockInterrupts()

void MW_EnableClockInterrupts ( void )

Enables all Clock Failure Detect (CFD) and Clock Frequency Measure (CFM) interrupts.

This function enables the Clock Frequency Measurement Error Detected interrupts for CFM0 and CFM1 and Clock Failure Detected interrupts for CFD0 and CFD1.

Note
The Clock Frequency Measurement Done interrupt is not enabled by default and is expected to be enabled by the application if needed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_GetClearClockCfd0Error()

errFlag_t MW_GetClearClockCfd0Error ( void )

Reads and clears the flag indicating a clock failure detected by CFD0.

This function checks whether the CFD0 interrupt flag has been set or not. If set, clears the flag and returns ERROR.

Return values
ERRORClock failure detected by CFD0.
NO_ERRORClock failure not detected by CFD0.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_GetClearClockCfd1Error()

errFlag_t MW_GetClearClockCfd1Error ( void )

Reads and clears the flag indicating a clock failure detected by CFD1.

This function checks whether the CFD1 interrupt flag has been set or not. If set, clears the flag and returns ERROR.

Return values
ERRORClock failure detected by CFD1.
NO_ERRORClock failure not detected by CFD1.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_GetClearClockCfm0Error()

errFlag_t MW_GetClearClockCfm0Error ( void )

Reads and clears the flag indicating a clock frequency error measured by CFM0.

This function checks whether the CFM0 interrupt flag has been set or not. If set, clears the flag and returns ERROR.

Return values
ERRORClock frequency error measured by CFM0.
NO_ERRORNo clock frequency error measured by CFM0.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_GetClearClockCfm1Error()

errFlag_t MW_GetClearClockCfm1Error ( void )

Reads and clears the flag indicating a clock frequency error measured by CFM1.

This function checks whether the CFM1 interrupt flag has been set or not. If set, clears the flag and returns ERROR.

Return values
ERRORClock frequency error measured by CFM1.
NO_ERRORNo clock frequency error measured by CFM1.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_IsDiagCfd0Ongoing()

bool MW_IsDiagCfd0Ongoing ( void )

Checks whether the CFD0 error injection diagnostic is ongoing.

This function returns whether the CFD0 diagnostic has been successfully started by MW_DiagClockCfd0Begin and has not yet been ended by MW_DiagClockCfd0End.

Note
A true return value only indicates that the diagnostic has been started and not yet ended. It does not indicate whether the injected fault has been detected. The calling function must ensure that the timing requirement in MW_DiagClockCfd0Begin is met before calling

MW_DiagClockCfd0End.

Return values
trueThe CFD0 diagnostic has been started and not yet ended.
falseThe CFD0 diagnostic is not ongoing.

◆ MW_IsDiagCfd1Ongoing()

bool MW_IsDiagCfd1Ongoing ( void )

Checks whether the CFD1 error injection diagnostic is ongoing.

This function returns whether the CFD1 diagnostic has been successfully started by MW_DiagClockCfd1Begin and has not yet been ended by MW_DiagClockCfd1End.

Note
A true return value only indicates that the diagnostic has been started and not yet ended. It does not indicate whether the injected fault has been detected. The calling function must ensure that the timing requirement in MW_DiagClockCfd1Begin is met before calling

MW_DiagClockCfd1End.

Return values
trueThe CFD1 diagnostic has been started and not yet ended.
falseThe CFD1 diagnostic is not ongoing.

◆ MW_SetMainClockFrequency()

errFlag_t MW_SetMainClockFrequency ( clkFrq_t frequency,
clkFrqDiv_t divider )

Initializes main clock with internal High Frequency Oscillator (OSCHF) as clock source.

Warning

This function always configures the main clock to use the High Frequency Oscillator (OSCHF) as the clock source.

Parameters
frequencyThe OSCHF main clock frequency to use.
dividerThe division factor to divide the selected frequency by.
Return values
ERRORInvalid frequency or division selected, main clock not configured.
NO_ERRORAll inputs are valid, clock configured correctly.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_StartCfd0()

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 reference.

Note

The CFD expects the MW_EnableClockInterrupts to be run before any error can be reported through an interrupt. Regardless of interrupt configuration, a CFD error will always be reported to the error controller.

Warning

If the CFD0 is already enabled, an error can be reported during re-configuration. To prevent this, call MW_StopCfd0 first.

Parameters
srcThe clock source to be monitored by CFD0.
refThe clock reference to be used by CFD0.
Return values
ERRORInvalid clock source or reference selected, CFD0 not configured.
NO_ERRORAll inputs are valid, CFD0 configured correctly.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_StartCfd1()

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 reference.

Note

The CFD expects the MW_EnableClockInterrupts to be run before any error can be reported through an interrupt. Regardless of interrupt configuration, a CFD error will always be reported to the error controller.

Warning

If the CFD1 is already enabled, an error can be reported during re-configuration. To prevent this, call MW_StopCfd1 first.

Parameters
srcThe clock source to be monitored by CFD1.
refThe clock reference to be used by CFD1.
Return values
ERRORInvalid clock source or reference selected, CFD1 not configured.
NO_ERRORAll inputs are valid, CFD1 configured correctly.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_StartCfm0()

errFlag_t MW_StartCfm0 ( cfmSource_t src,
cfmReference_t ref,
cfmWindow_t window,
bool useContinuous )

Starts Clock Frequency Measure 0 (CFM0) to monitor the configured clock source with the configured reference.

Note

The CFM expects the MW_EnableClockInterrupts to be run before any error can be reported through an interrupt. Regardless of interrupt configuration, a CFM error will always be reported to the error controller.

Warning

If the CFM0 is already enabled, an error can be reported during re-configuration. To prevent this, call MW_StopCfm0 first.

Parameters
srcThe clock source to be monitored by CFM0.
refThe clock reference to be used by CFM0.
windowThe window configuration for the measurement.
useContinuousSelects between continuous mode (true) and one-shot mode (false).
Return values
ERRORInvalid clock source or reference selected, CFM0 not configured.
NO_ERRORAll inputs are valid, CFM0 configured correctly.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_StartCfm1()

errFlag_t MW_StartCfm1 ( cfmSource_t src,
cfmReference_t ref,
cfmWindow_t window,
bool useContinuous )

Starts Clock Frequency Measure 1 (CFM1) to monitor the configured clock source with the configured reference.

Note

The CFM expects the MW_EnableClockInterrupts to be run before any error can be reported through an interrupt. Regardless of interrupt configuration, a CFM error will always be reported to the error controller.

Warning

If the CFM1 is already enabled, an error can be reported during re-configuration. To prevent this, call MW_StopCfm1 first.

Parameters
srcThe clock source to be monitored by CFM1.
refThe clock reference to be used by CFM1.
windowThe window configuration for the measurement.
useContinuousSelects between continuous mode (true) and one-shot mode (false).
Return values
ERRORInvalid clock source or reference selected, CFM1 not configured.
NO_ERRORAll inputs are valid, CFM1 configured correctly.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_StopCfd0()

void MW_StopCfd0 ( void )

Disables Clock Failure Detect 0 (CFD0).

This function disables CFD0 without changing its configuration. It is intended to be used before reconfiguration of CFD0 or entering Standby or Power-Down sleep modes.

During transitions into or out of sleep, the monitored clock source may be disabled or not yet stable. If CFD0 remains enabled during these transitions, a clock failure may be reported. Disabling CFD0 avoids spurious error reporting related to clock transitions.

Note
The Clock Failure Detected interrupt configuration is not modified.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_StopCfd1()

void MW_StopCfd1 ( void )

Disables Clock Failure Detect 1 (CFD1).

This function disables CFD1 without changing its configuration. It is intended to be used before reconfiguration of CFD1 or entering Standby or Power-Down sleep modes.

During transitions into or out of sleep, the monitored clock source may be disabled or not yet stable. If CFD1 remains enabled during these transitions, a clock failure may be reported. Disabling CFD1 avoids spurious error reporting related to clock transitions.

Note
The Clock Failure Detected interrupt configuration is not modified.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_StopCfm0()

void MW_StopCfm0 ( void )

Disables Clock Frequency Measure 0 (CFM0).

This function disables CFM0 without changing its configuration. It is intended to be used before reconfiguration of CFM0 or entering Standby or Power-Down sleep modes.

During transitions into or out of sleep, the monitored clock source may be disabled or not yet stable. If CFM0 remains enabled during these transitions, a clock frequency measurement error may be reported. Disabling CFM0 avoids spurious error reporting related to clock transitions.

Note
The Clock Frequency Measurement Error interrupt configuration is not modified.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MW_StopCfm1()

void MW_StopCfm1 ( void )

Disables Clock Frequency Measure 1 (CFM1).

This function disables CFM1 without changing its configuration. It is intended to be used before reconfiguration of CFM1 or entering Standby or Power-Down sleep modes.

During transitions into or out of sleep, the monitored clock source may be disabled or not yet stable. If CFM1 remains enabled during these transitions, a clock frequency measurement error may be reported. Disabling CFM1 avoids spurious error reporting related to clock transitions.

Note
The Clock Frequency Measurement Error interrupt configuration is not modified.
Here is the call graph for this function:
Here is the caller graph for this function: