![]() |
PDL for FM0+
Version1.0
Peripheral Driverl Library for FM0+
|
#include "wc.h"
Go to the source code of this file.
Functions | |
static void | Wc_InitNvic (void) |
Set NVIC Interrupt depending on ADC instance. | |
static void | Wc_DeInitNvic (void) |
Clear NVIC Interrupt depending on ADC instance. | |
void | Wc_IrqHandler (void) |
Watch counter interrupt function. | |
en_result_t | Wc_Pres_SelClk (stc_wc_pres_clk_t *pstcWcPresClk) |
Select the input clock an and set the division clock to be output. | |
en_result_t | Wc_Pres_EnableDiv () |
Enable oscillation of the division clock. | |
en_result_t | Wc_Pres_DisableDiv () |
Disable oscillation of the division clock. | |
en_stat_flag_t | Wc_GetDivStat () |
Get the operation status of the division counter. | |
en_result_t | Wc_Init (stc_wc_config_t *pstcWcConfig) |
Select the input clock and set the division clock to be output. | |
en_result_t | Wc_EnableCount (void) |
Enable WC operation. | |
en_result_t | Wc_DisableCount (void) |
Disable WC operation. | |
en_result_t | Wc_EnableInt (func_ptr_t pfnIntCallback) |
Enable WC underflow interrupt. | |
en_result_t | Wc_DisableInt (void) |
Disable WC underflow interrupt. | |
en_result_t | Wc_WriteReloadVal (uint8_t u8Val) |
Set the counter value of WC. | |
uint8_t | Wc_ReadCurCnt () |
Read the value in the 6-bit down counter. | |
en_result_t | Wc_ClearIntFlag () |
Clear WC underflow flag. | |
en_int_flag_t | Wc_GetIntFlag () |
Get WC underflow flag status. | |
en_stat_flag_t | Wc_GetOperationFlag () |
Get WC operation state. | |
Variables | |
static func_ptr_t | pWcfnIntCallback = NULL |
A detailed description is available at WC Module description
History:
Definition in file wc.c.
en_result_t Wc_ClearIntFlag | ( | void | ) |
Clear WC underflow flag.
The Function clear WCIF to 0 of WC
Ok | Clear WC underflow flag normally |
Definition at line 361 of file wc.c.
References Ok.
Referenced by Wc_IrqHandler().
static void Wc_DeInitNvic | ( | void | ) | [static] |
Clear NVIC Interrupt depending on ADC instance.
Definition at line 89 of file wc.c.
References PDL_DEFAULT_INTERRUPT_LEVEL.
Referenced by Wc_DisableInt().
en_result_t Wc_DisableCount | ( | void | ) |
en_result_t Wc_DisableInt | ( | void | ) |
Disable WC underflow interrupt.
The Function can clear WCIE of WC
Ok | Disable WC underflow interrupt normally |
Definition at line 308 of file wc.c.
References Ok, pWcfnIntCallback, and Wc_DeInitNvic().
en_result_t Wc_EnableCount | ( | void | ) |
en_result_t Wc_EnableInt | ( | func_ptr_t | pfnIntCallback | ) |
Enable WC underflow interrupt.
The Function can set WCIE of WC
[in] | pfnIntCallback | WC interrupt to be enabled |
Ok | Write data successfully done or started. |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 286 of file wc.c.
References ErrorInvalidParameter, Ok, pWcfnIntCallback, and Wc_InitNvic().
en_stat_flag_t Wc_GetDivStat | ( | void | ) |
en_int_flag_t Wc_GetIntFlag | ( | void | ) |
Get WC underflow flag status.
The Function get value WCIF of WC
PdlClr | WCIF is 0, WC underflow does not occur |
PdlSet | WCIF is 1, WC underflow occurs |
Definition at line 377 of file wc.c.
Referenced by Wc_IrqHandler().
en_stat_flag_t Wc_GetOperationFlag | ( | void | ) |
en_result_t Wc_Init | ( | stc_wc_config_t * | pstcWcConfig | ) |
Select the input clock and set the division clock to be output.
The Function can set SEL_OUT, SEL_IN of Watch counter prescaler (hereafter WCP)
[in] | pstcWcConfig | WC configuration |
Ok | Write data successfully done or started. |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 216 of file wc.c.
References stc_wc_config::enCntClk, ErrorInvalidParameter, Ok, stc_wc_config::u8ReloadValue, WcCntClkWcck0, WcCntClkWcck1, WcCntClkWcck2, and WcCntClkWcck3.
static void Wc_InitNvic | ( | void | ) | [static] |
Set NVIC Interrupt depending on ADC instance.
Definition at line 78 of file wc.c.
References PDL_IRQ_LEVEL_CLK_WC_RTC.
Referenced by Wc_EnableInt().
void Wc_IrqHandler | ( | void | ) |
Watch counter interrupt function.
Definition at line 99 of file wc.c.
References PdlSet, pWcfnIntCallback, Wc_ClearIntFlag(), and Wc_GetIntFlag().
Referenced by TIM_IRQHandler().
en_result_t Wc_Pres_DisableDiv | ( | void | ) |
en_result_t Wc_Pres_EnableDiv | ( | void | ) |
en_result_t Wc_Pres_SelClk | ( | stc_wc_pres_clk_t * | pstcWcPresClk | ) |
Select the input clock an and set the division clock to be output.
The Function can set SEL_OUT, SEL_IN of Watch counter prescaler (hereafter WCP)
[in] | pstcWcPresClk | WC prescaler clock configuration |
Ok | Write data successfully done or started. |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 126 of file wc.c.
References stc_wc_pres_clk::enInputClk, stc_wc_pres_clk::enOutputClk, ErrorInvalidParameter, Ok, WcPresInClkHighCr, WcPresInClkLowCr, WcPresInClkMainOsc, WcPresInClkSubOsc, WcPresOutClkArray0, WcPresOutClkArray1, WcPresOutClkArray2, WcPresOutClkArray3, WcPresOutClkArray4, WcPresOutClkArray5, and WcPresOutClkArray6.
uint8_t Wc_ReadCurCnt | ( | void | ) |
en_result_t Wc_WriteReloadVal | ( | uint8_t | u8Val | ) |
func_ptr_t pWcfnIntCallback = NULL [static] |
Definition at line 67 of file wc.c.
Referenced by Wc_DisableInt(), Wc_EnableInt(), and Wc_IrqHandler().