PDL for FM0+  Version1.0
Peripheral Driverl Library for FM0+
Clock Supervisor Functions (CSV)

Provided functions of CSV module:

What is CSV?

The CSV module includes CSV and FCS function. CSV uses the high and low CR to monitor main and sub clock, if the abnormal state is detected, a reset occurs. FCS uses high-speed CR to monitor the main clock, a range can be set in advance. If the monitor cycle exceeds the range, either interrupt or reset will occurs.

How to use CSV module with the APIs provided?

First, Enable the CSV function with Csv_EnableMainCsv() or Csv_EnableSubCsv()

When the abnormal status is detected, a CSV reset occurs, then read the the CSV failure cause by Csv_GetCsvFailCause().

Disable the CSV function with Csv_DisableMainCsv() or Csv_DisableSubCsv()

How to use FCS module with the APIs provided?

First, set the CR divider with Csv_SetFcsCrDiv() and set the expected range of main clok cycle with Csv_SetFcsDetectRange().

Second, enable the FCS interrupt with Csv_EnableFcsInt() or enable FCS reset with Csv_EnableFcsReset().

Then start FCS function with Csv_EnableFcs().

When abnormal frequency is detected, an interrupt occurs when FCS interrupt is enabled, then read the interrupt flag by Csv_GetFcsIntFlag() and clear the interrupt flag by Csv_ClrFcsIntFlag().

When abnormal frequency is detected, a reset issues when FCS reset is enabled.

When abnormal frequency is detected, current main clock cycle can be read by Csv_GetFcsDetectCount().

Disable FCS by Csv_DisableFcs(), disable FCS reset by Csv_DisableFcsReset() and disable FCS interrupt by Csv_DisableFcsInt().