4.4 CFD - Clock Failure Detection

4.4.1 Introduction

The MCC Melody Clock Failure Detection (CFD) PLIB Driver (Peripheral Library) generates API to support CFD-specific peripheral functionality on ATmega target MCU's.

The Clock Failure Detection (CFD) feature detects a failed oscillator or clock source by checking for edges on the selected oscillator/clock. If no edges are detected within a specific time, a CFD condition is issued and triggers an interrupt or forces the device to switch to a stable internal clock source.

4.4.2 Supported Device Families

ATmega32xx

4.4.3 Required header files:

#include "mcc_generated_files/system/cfd.h"

4.4.4 Module Documentation

4.4.4.1 CFD

This file contains the API prototypes for the Clock Failure Detection (CFD) driver.

4.4.4.1.1 Module description

This file contains the API prototypes for the Clock Failure Detection (CFD) driver.

Version: CFD Driver Version 1.0.0

4.4.4.1.2 Function Documentation

CFD_DisableInterrupt()

void CFD_DisableInterrupt (void )

Disables the clock failure detection interrupt of the CFD module.

Parameters:
None.
Returns:

None.

CFD_EnableInterrupt()

void CFD_EnableInterrupt (void )

Enables the clock failure detection interrupt of the CFD module.

Parameters:
None.
Returns:

None.

CFD_GetInterruptFlagStatus()

bool CFD_GetInterruptFlagStatus (void )

Checks the Interrupt flag status of the CFD module.

Parameters:
None.
Return values:
True

- Clock failure is detected.

False

- No clock failure is detected.

CFD_Initialize()

int8_t CFD_Initialize (void )

Initializes the CFD module.

Parameters:
None.
Return values:
0

- CFD initialization was successful.

1

- CFD initialization was not successful.

4.4.5 File Documentation

4.4.5.1 source/cfd.c File Reference

This file contains the API implementation for the CFD module driver.

#include <avr/io.h>
#include "../cfd.h"

4.4.5.1.2 Detailed Description

This file contains the API implementation for the CFD module driver.

CFD Generated Driver File

Version: CFD Driver Version 1.0.0

4.4.5.2 source/cfd.h File Reference

#include "../system/utils/compiler.h"
#include <stdint.h>
#include <stdbool.h>

4.4.5.2.2 Detailed Description

CFD Generated Driver API Header File