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 exeeds the range, either interrupt or reset will occurs.
More...
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 exeeds the range, either interrupt or reset will occurs.
Provided functions of CSV module:
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 dividor 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().
Enumeration to define an index for each BT instance.
| typedef void fn_fcs_int_callback(void) |
FCS interrupt callback function type.
Definition at line 146 of file csv.h.
Enumeration to define an index for each BT instance.
| Enumerator |
|---|
| FcsCrDiv256 |
1/256 frequency of high-speed CR oscillation
|
| FcsCrDiv512 |
1/512 frequency of high-speed CR oscillation
|
| FcsCrDiv1024 |
1/1024 frequency of high-speed CR oscillation
|
Definition at line 123 of file csv.h.
| void Csv_ClrFcsIntFlag |
( |
void |
| ) |
|
Clears the FCS interrupt cause.
Definition at line 260 of file csv.c.
| void Csv_DisableFcs |
( |
void |
| ) |
|
The FCS function is disabled.
Definition at line 229 of file csv.c.
| void Csv_DisableFcsInt |
( |
void |
| ) |
|
| void Csv_DisableFcsReset |
( |
void |
| ) |
|
The FCS reset is disabled.
Definition at line 250 of file csv.c.
| void Csv_DisableMainCsv |
( |
void |
| ) |
|
The main CSV function is disabled.
Definition at line 153 of file csv.c.
| void Csv_DisableSubCsv |
( |
void |
| ) |
|
The sub CSV function is disabled¡£
Definition at line 173 of file csv.c.
| void Csv_EnableFcs |
( |
void |
| ) |
|
The FCS function is enabled.
Definition at line 219 of file csv.c.
| void Csv_EnableFcsReset |
( |
void |
| ) |
|
The FCS reset is enabled.
Definition at line 239 of file csv.c.
| void Csv_EnableMainCsv |
( |
void |
| ) |
|
The main CSV function is enabled.
Definition at line 143 of file csv.c.
| void Csv_EnableSubCsv |
( |
void |
| ) |
|
The sub CSV function is enabled.
Definition at line 163 of file csv.c.
| uint16_t Csv_GetFcsDetectCount |
( |
void |
| ) |
|
Get the counter value of frequency detection using the main clock.
- Returns
- Frequency detection counter value
Definition at line 328 of file csv.c.
| uint8_t Csv_GetFcsIntFlag |
( |
void |
| ) |
|
Get Anomalous frequency detection interrupt status.
- Returns
- interrupt status
- Return values
-
| 0 | No FCS interrupt has been asserted. |
| 1 | An FCS interrupt has been asserted. |
Definition at line 274 of file csv.c.
| void Csv_IrqHandler |
( |
void |
| ) |
|
FCS count cycle setting.
- Parameters
-
| enDiv |
- FcsCrDiv256 1/256 frequency of high-speed CR oscillation
- FcsCrDiv512 1/512 frequency of high-speed CR oscillation
- FcsCrDiv1024 1/1024 frequency of high-speed CR oscillation
|
- Return values
-
Definition at line 291 of file csv.c.
References ErrorInvalidParameter, FcsCrDiv1024, FcsCrDiv256, FcsCrDiv512, and Ok.
| void Csv_SetFcsDetectRange |
( |
uint16_t |
u16LowerVal, |
|
|
uint16_t |
u16UpperVal |
|
) |
| |
Frequency lower detection window setting.
- Parameters
-
| u16LowerVal | Lower value |
| u16UpperVal | limit value |
Definition at line 315 of file csv.c.