AVR SD Safety Framework 1.0.0
Loading...
Searching...
No Matches
midware_clock_manager.h File Reference

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

#include <stdbool.h>
#include <stdint.h>
#include <define_error_flags.h>
#include <xc.h>

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.

Detailed Description

Contains API prototypes and defines for the Clock Manager.

Version
1.0.0

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