| PDL for FM0+ Version1.0 Peripheral Driverl Library for FM0+

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Typedefs | Enumerations | Functions
C:/pdl_v10/library/driver/csv/csv.h File Reference
`#include "mcu.h"`
`#include "pdl_user.h"`
Include dependency graph for csv.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | stc_csv_status
| Structure of CSV status. More...
## Typedefs
typedef enum en_fcs_cr_div | en_fcs_cr_div_t
| Enumeration to define an index for each BT instance.
typedef struct stc_csv_status | stc_csv_status_t
| Structure of CSV status.
typedef void | fn_fcs_int_callback (void)
| FCS interrupt callback function type.
## Enumerations
enum | en_fcs_cr_div { FcsCrDiv256 = 5, FcsCrDiv512 = 6, FcsCrDiv1024 = 7 }
| Enumeration to define an index for each BT instance. More...
## Functions
void | Csv_EnableMainCsv (void)
| Enable CSV function for main clock.
void | Csv_DisableMainCsv (void)
| Disable CSV function for main clock.
void | Csv_EnableSubCsv (void)
| Enable CSV function for sub clock.
void | Csv_DisableSubCsv (void)
| The sub CSV function is disabled¡£
uint8_t | Csv_GetCsvFailCause (stc_csv_status_t *pstcCsvStatus)
| Get CSV status.
void | Csv_EnableFcs (void)
| The FCS function is enabled.
void | Csv_DisableFcs (void)
| The FCS function is disabled.
void | Csv_EnableFcsReset (void)
| The FCS reset is enabled.
void | Csv_DisableFcsReset (void)
| The FCS reset is disabled.
en_result_t | Csv_EnableFcsInt (fn_fcs_int_callback *pfnIntCallback)
| Enables FCS interrupts.
void | Csv_DisableFcsInt (void)
| Disables FCS interrupts.
void | Csv_ClrFcsIntFlag (void)
| Clears the FCS interrupt cause.
uint8_t | Csv_GetFcsIntFlag (void)
| Get Anomalous frequency detection interrupt status.
en_result_t | Csv_SetFcsCrDiv (en_fcs_cr_div_t enDiv)
| Set Dividor of CR frequency to be measured by FCS.
void | Csv_SetFcsDetectRange (uint16_t u16LowerVal, uint16_t u16UpperVal)
| Frequency lower detection window setting.
uint16_t | Csv_GetFcsDetectCount (void)
| Get the counter value of frequency detection using the main clock.
void | Csv_IrqHandler (void)
| CSV interrupt handler.

## Detailed Description

Headerfile for CSV functions

History:

- 2013-10-11 1.0 Edison Zhang First version.

Definition in file csv.h.

## Typedef Documentation

typedef enum en_fcs_cr_div en_fcs_cr_div_t

Enumeration to define an index for each BT instance.

typedef void fn_fcs_int_callback(void)

FCS interrupt callback function type.

Definition at line 158 of file csv.h.

typedef struct stc_csv_status stc_csv_status_t

Structure of CSV status.

## Enumeration Type Documentation

enum en_fcs_cr_div

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 135 of file csv.h.

## Function Documentation

void Csv_ClrFcsIntFlag | ( | void |  | ) |

Clears the FCS interrupt cause.

Definition at line 258 of file csv.c.

void Csv_DisableFcs | ( | void |  | ) |

The FCS function is disabled.

Definition at line 227 of file csv.c.

void Csv_DisableFcsInt | ( | void |  | ) |

Disables FCS interrupts.

Definition at line 121 of file csv.c.

References PDL_DEFAULT_INTERRUPT_LEVEL.

void Csv_DisableFcsReset | ( | void |  | ) |

The FCS reset is disabled.

Definition at line 248 of file csv.c.

void Csv_DisableMainCsv | ( | void |  | ) |

Disable CSV function for main clock.

Definition at line 149 of file csv.c.

void Csv_DisableSubCsv | ( | void |  | ) |

The sub CSV function is disabled¡£

Definition at line 171 of file csv.c.

void Csv_EnableFcs | ( | void |  | ) |

The FCS function is enabled.

Definition at line 217 of file csv.c.

en_result_t Csv_EnableFcsInt | ( | fn_fcs_int_callback * | pfnIntCallback | ) |

Enables FCS interrupts.

Definition at line 99 of file csv.c.

References ErrorInvalidParameter, m_pfnIntCallback, Ok, and PDL_IRQ_LEVEL_CSV.

void Csv_EnableFcsReset | ( | void |  | ) |

The FCS reset is enabled.

Definition at line 237 of file csv.c.

void Csv_EnableMainCsv | ( | void |  | ) |

Enable CSV function for main clock.

Note:
  The main CSV function is defaultly enabled after power-on reset

Definition at line 139 of file csv.c.

void Csv_EnableSubCsv | ( | void |  | ) |

Enable CSV function for sub clock.

Note:
  The sub CSV function is defaultly enabled after power-on reset

Definition at line 161 of file csv.c.

uint8_t Csv_GetCsvFailCause | ( | stc_csv_status_t * | pstcCsvStatus | ) |

Get CSV status.

Parameters:

  pstcCsvStatus | Pointer to status information structure of CSV

Return values:

  Ok | Get CSV status normally.

Definition at line 185 of file csv.c.

References stc_csv_status::bCsvMainClockStatus, stc_csv_status::bCsvSubClockStatus, FALSE, Ok, and TRUE.

uint16_t Csv_GetFcsDetectCount | ( | void |  | ) |

Get the counter value of frequency detection using the main clock.

Returns:
  Frequency detection counter value

Definition at line 327 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 272 of file csv.c.

void Csv_IrqHandler | ( | void |  | ) |

CSV interrupt handler.

Definition at line 88 of file csv.c.

References m_pfnIntCallback.

Referenced by CSV_IRQHandler().

Here is the caller graph for this function:

en_result_t Csv_SetFcsCrDiv | ( | en_fcs_cr_div_t | enDiv | ) |

Set Dividor of CR frequency to be measured by FCS.

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:

  Ok | Dividor of CR frequency set normally
  ErrorInvalidParameter | enDiv > FcsCrDiv1024

Definition at line 290 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 314 of file csv.c.