![]() |
PDL for FM0+
Version1.0
Peripheral Driverl Library for FM0+
|
Go to the source code of this file.
Data Structures | |
struct | stc_wc_pres_clk |
Structure to configure watch counter prescaler. More... | |
struct | stc_wc_config |
Structure to configure the watch counter. More... | |
Typedefs | |
typedef enum en_input_clk | en_input_clk_t |
Enumeration to define source clock of watch counter precaler. | |
typedef enum en_output_clk | en_output_clk_t |
Enumeration to define output clock of watch counter precaler. | |
typedef struct stc_wc_pres_clk | stc_wc_pres_clk_t |
Structure to configure watch counter prescaler. | |
typedef enum en_wc_cnt_clk | en_wc_cnt_clk_t |
Enumeration to set the clock of watch counter. | |
typedef struct stc_wc_config | stc_wc_config_t |
Structure to configure the watch counter. | |
Enumerations | |
enum | en_input_clk { WcPresInClkSubOsc = 0, WcPresInClkMainOsc, WcPresInClkHighCr, WcPresInClkLowCr } |
Enumeration to define source clock of watch counter precaler. More... | |
enum | en_output_clk { WcPresOutClkArray0 = 0, WcPresOutClkArray1, WcPresOutClkArray2, WcPresOutClkArray3, WcPresOutClkArray4, WcPresOutClkArray5, WcPresOutClkArray6 } |
Enumeration to define output clock of watch counter precaler. More... | |
enum | en_wc_cnt_clk { WcCntClkWcck0 = 0, WcCntClkWcck1, WcCntClkWcck2, WcCntClkWcck3 } |
Enumeration to set the clock of watch counter. More... | |
Functions | |
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 (void) |
Enable oscillation of the division clock. | |
en_result_t | Wc_Pres_DisableDiv (void) |
Disable oscillation of the division clock. | |
en_stat_flag_t | Wc_GetDivStat (void) |
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 (void) |
Read the value in the 6-bit down counter. | |
en_result_t | Wc_ClearIntFlag (void) |
Clear WC underflow flag. | |
en_int_flag_t | Wc_GetIntFlag (void) |
Get WC underflow flag status. | |
en_stat_flag_t | Wc_GetOperationFlag (void) |
Get WC operation state. | |
void | Wc_IrqHandler (void) |
Watch counter interrupt function. |
Headerfile for WC functions
History:
Definition in file wc.h.
typedef enum en_input_clk en_input_clk_t |
Enumeration to define source clock of watch counter precaler.
typedef enum en_output_clk en_output_clk_t |
Enumeration to define output clock of watch counter precaler.
typedef enum en_wc_cnt_clk en_wc_cnt_clk_t |
Enumeration to set the clock of watch counter.
typedef struct stc_wc_config stc_wc_config_t |
Structure to configure the watch counter.
typedef struct stc_wc_pres_clk stc_wc_pres_clk_t |
Structure to configure watch counter prescaler.
enum en_input_clk |
Enumeration to define source clock of watch counter precaler.
enum en_output_clk |
Enumeration to define output clock of watch counter precaler.
enum en_wc_cnt_clk |
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().
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.
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 | ) |