PSOC E8XXGP Device Support Library

General Description

Functions

cy_en_sysclk_status_t Cy_SysClk_ClkHfEnable (uint32_t clkHf)
 Enables the selected clkHf. More...
 
cy_en_sysclk_status_t Cy_SysClk_ClkHfEnable_Safe (uint32_t clkHf)
 Verifies if selected clkHf could be enabled and if yes than enables it. More...
 
bool Cy_SysClk_ClkHfIsEnabled (uint32_t clkHf)
 Reports the Enabled/Disabled status of clkHf. More...
 
cy_en_sysclk_status_t Cy_SysClk_ClkHfDisable (uint32_t clkHf)
 Disables the selected clkHf. More...
 
cy_en_sysclk_status_t Cy_SysClk_ClkHfSetSource (uint32_t clkHf, cy_en_clkhf_in_sources_t source)
 Selects the source of the selected clkHf. More...
 
cy_en_clkhf_in_sources_t Cy_SysClk_ClkHfGetSource (uint32_t clkHf)
 Reports the source of the selected clkHf. More...
 
cy_en_sysclk_status_t Cy_SysClk_ClkHfSetDivider (uint32_t clkHf, cy_en_clkhf_dividers_t divider)
 Sets the pre-divider for a clkHf. More...
 
cy_en_clkhf_dividers_t Cy_SysClk_ClkHfGetDivider (uint32_t clkHf)
 Reports the pre-divider value for a clkHf. More...
 
uint32_t Cy_SysClk_ClkHfGetFrequency (uint32_t clkHf)
 Reports the frequency of the selected clkHf. More...
 
cy_en_sysclk_status_t Cy_SysClk_ClkHfDirectSel (uint32_t clkHf, bool enable)
 Enable/Disable the direct source selection as IMO for CLK_HF[[n]]. More...
 
bool Cy_SysClk_IsClkHfDirectSelEnabled (uint32_t clkHf)
 Checks if direct source selection as IMO for CLK_HF[[n]] is enabled/disabled. More...
 
uint32_t Cy_SysClk_ClkHfGetMaskOnPath (cy_en_clkhf_in_sources_t clkPath)
 Get Mask value for the HF Clocks selected and enabled for clkPath as source e.g. More...
 
uint32_t Cy_SysClk_ClkHfAllGetMask (void)
 Get Mask value for the all HF Clocks e.g. More...
 
void Cy_SysClk_ClkHfEnableDividerWithMask (uint32_t clkHfMask, cy_en_clkhf_dividers_t divider)
 Divide all the enabled CLK_HF's with the divider value. More...
 
void Cy_SysClk_ClkHfEnableDirectMuxWithMask (uint32_t clkHfMask, bool enable)
 Enable/ Disable the clock path for the HF Clocks in clkHfMask in disable case ROOT path will be enabled in enable case ROOT path will be disabled. More...
 
uint32_t Cy_SysClk_ClkHfCsvGetRefFrequency (cy_en_clkhf_csv_ref_clk_t refClk)
 Get the clkHf csv reference clock frequency. More...
 
cy_en_sysclk_status_t Cy_SysClk_ClkHfCsvManualConfigure (const cy_stc_clkhf_csv_hf_config_t *hfConfig, const cy_stc_clkhf_csv_manual_config_t *csvConfig)
 Manually configures the clkHf csv based on user inputs. More...
 
cy_en_sysclk_status_t Cy_SysClk_ClkHfCsvConfigure (const cy_stc_clkhf_csv_hf_config_t *hfConfig, uint32_t accuracy)
 Configures clkhf csv. More...
 
void Cy_SysClk_ClkHfCsvAction (uint32_t clkHf, cy_en_clkhf_csv_action_t action)
 Configures the action taken when an anomaly is detected on the clkHf. More...
 
void Cy_SysClk_ClkHfCsvEnable (uint32_t clkHf)
 Enables the csv for the provided clkHf. More...
 
void Cy_SysClk_ClkHfCsvDisable (uint32_t clkHf)
 Disables the csv for the provided clkHf. More...
 
bool Cy_SysClk_IsClkHfCsvEnabled (uint32_t clkHf)
 Returns the enabled status of csv for the provided clkHf. More...
 

Function Documentation

◆ Cy_SysClk_ClkHfEnable()

cy_en_sysclk_status_t Cy_SysClk_ClkHfEnable ( uint32_t  clkHf)

Enables the selected clkHf.

Parameters
clkHfSelects which clkHf to enable.
Returns
cy_en_sysclk_status_t CY_PRA_STATUS_* - For the PSoC 64 devices there are possible situations when function returns the PRA error status code cy_en_pra_status_t instead of cy_en_sysclk_status_t. This is because for PSoC 64 devices the function uses the PRA driver to change the protected registers. Refer to cy_en_pra_status_t for more details.
Function Usage
/* Scenario: ECO needs to source HFCLK2 through Path 2. The ECO is
configured through its function calls. */
#define CLKPATH2 (2UL)
#define HFCLK2 (2UL)
uint32_t clkPathMuxFreq = 0UL; /* Variable to store the Clock Path Mux output frequency */
/* Set the clock path 2 mux to be sourced from ECO */
{
clkPathMuxFreq = Cy_SysClk_ClkPathMuxGetFrequency(CLKPATH2);
/* Now clkPathMuxFreq contains the Clock Path Mux output frequency */
}
else
{
/* Perform error handling */
}
/* Set the HFCLK2 source to clock path 2 and enable HFCLK2 */
/* Enable HFCLK2 */
(void)Cy_SysClk_ClkHfEnable(HFCLK2);
@ CY_SYSCLK_CLKHF_IN_CLKPATH2
clkHf input is Clock Path 2
Definition: cy_sysclk.h:2511
cy_en_sysclk_status_t Cy_SysClk_ClkHfSetSource(uint32_t clkHf, cy_en_clkhf_in_sources_t source)
Selects the source of the selected clkHf.
Definition: cy_sysclk_v2.c:3244
cy_en_sysclk_status_t Cy_SysClk_ClkHfEnable(uint32_t clkHf)
Enables the selected clkHf.
Definition: cy_sysclk_v2.c:3169
@ CY_SYSCLK_CLKPATH_IN_ECO
Select the ECO as the output of the path mux.
Definition: cy_sysclk.h:827
uint32_t Cy_SysClk_ClkPathMuxGetFrequency(uint32_t clkPath)
Returns the output frequency of the clock path mux.
Definition: cy_sysclk_v2.c:4728
cy_en_sysclk_status_t Cy_SysClk_ClkPathSetSource(uint32_t clkPath, cy_en_clkpath_in_sources_t source)
Configures the source for the specified clock path.
Definition: cy_sysclk_v2.c:4693
@ CY_SYSCLK_SUCCESS
Command completed with no errors.
Definition: cy_sysclk.h:497

◆ Cy_SysClk_ClkHfEnable_Safe()

cy_en_sysclk_status_t Cy_SysClk_ClkHfEnable_Safe ( uint32_t  clkHf)

Verifies if selected clkHf could be enabled and if yes than enables it.

Parameters
clkHfSelects which clkHf to enable.
Returns
cy_en_sysclk_status_t CY_PRA_STATUS_* - For the PSoC 64 devices there are possible situations when function returns the PRA error status code cy_en_pra_status_t instead of cy_en_sysclk_status_t. This is because for PSoC 64 devices the function uses the PRA driver to change the protected registers. Refer to cy_en_pra_status_t for more details.
Function Usage
/* Scenario: ECO needs to source HFCLK2 through Path 2. The ECO is
configured through its function calls. */
#define CLKPATH2 (2UL)
#define HFCLK2 (2UL)
uint32_t clkPathMuxFreq = 0UL; /* Variable to store the Clock Path Mux output frequency */
/* Set the clock path 2 mux to be sourced from ECO */
{
clkPathMuxFreq = Cy_SysClk_ClkPathMuxGetFrequency(CLKPATH2);
/* Now clkPathMuxFreq contains the Clock Path Mux output frequency */
}
else
{
/* Perform error handling */
}
/* Set the HFCLK2 source to clock path 2 and enable HFCLK2 */
/* Enable HFCLK2 */
(void)Cy_SysClk_ClkHfEnable(HFCLK2);

◆ Cy_SysClk_ClkHfIsEnabled()

bool Cy_SysClk_ClkHfIsEnabled ( uint32_t  clkHf)

Reports the Enabled/Disabled status of clkHf.

Note
This API is Secure Aware. On devices with ARM TrustZone enabled, it is safe to call on a Secure hardware resource from a Non-Secure CPU state. The involved PPC region is PROT_PERI0_SRSS_MAIN. See Secure Aware SysCLK for further details.
Parameters
clkHfSelects which clkHf to check.
Returns
Boolean status of clkHf: true - Enabled, false - Disabled.
Function Usage
/* Scenario: HFCLK1 is no longer required in the application and can be
switched off.
Note: HFCLK0 cannot be disabled */
#define HFCLK1 (1UL)
{
/* Disable HFCLK1 */
(void)Cy_SysClk_ClkHfDisable(HFCLK1);
}
bool Cy_SysClk_ClkHfIsEnabled(uint32_t clkHf)
Reports the Enabled/Disabled status of clkHf.
Definition: cy_sysclk_v2.c:3180
cy_en_sysclk_status_t Cy_SysClk_ClkHfDisable(uint32_t clkHf)
Disables the selected clkHf.
Definition: cy_sysclk_v2.c:3231

◆ Cy_SysClk_ClkHfDisable()

cy_en_sysclk_status_t Cy_SysClk_ClkHfDisable ( uint32_t  clkHf)

Disables the selected clkHf.

Parameters
clkHfSelects which clkHf to enable.
Returns
cy_en_sysclk_status_t
Note
clkHf[0] cannot be disabled.
Function Usage
/* Scenario: HFCLK1 is no longer required in the application and can be
switched off.
Note: HFCLK0 cannot be disabled */
#define HFCLK1 (1UL)
{
/* Disable HFCLK1 */
(void)Cy_SysClk_ClkHfDisable(HFCLK1);
}

◆ Cy_SysClk_ClkHfSetSource()

cy_en_sysclk_status_t Cy_SysClk_ClkHfSetSource ( uint32_t  clkHf,
cy_en_clkhf_in_sources_t  source 
)

Selects the source of the selected clkHf.

Parameters
clkHfselects which clkHf mux to configure.
sourcecy_en_clkhf_in_sources_t
Returns
cy_en_sysclk_status_t CY_PRA_STATUS_* - For the PSoC 64 devices there are possible situations when function returns the PRA error status code cy_en_pra_status_t instead of cy_en_sysclk_status_t. This is because for PSoC 64 devices the function uses the PRA driver to change the protected registers. Refer to cy_en_pra_status_t for more details.
Note
Call SystemCoreClockUpdate after this function calling if it affects the CLK_HF0 frequency.
Call Cy_SysLib_SetWaitStates before calling this function if CLK_HF0 frequency is increasing.
Call Cy_SysLib_SetWaitStates after calling this function if CLK_HF0 frequency is decreasing.
Function Usage
/* Scenario: HFCLK1 source may have been updated to Path 0 somewhere in the
application. Check if it was and change the source to Path 1. */
{
/* Set the HFCLK1 source to Path 1 clock */
}
@ CY_SYSCLK_CLKHF_IN_CLKPATH1
clkHf input is Clock Path 1
Definition: cy_sysclk.h:2510
@ CY_SYSCLK_CLKHF_IN_CLKPATH0
clkHf input is Clock Path 0
Definition: cy_sysclk.h:2509
cy_en_clkhf_in_sources_t Cy_SysClk_ClkHfGetSource(uint32_t clkHf)
Reports the source of the selected clkHf.
Definition: cy_sysclk_v2.c:3256
Note
Take into account the possible platform specific clkHf (and further clocking chain links) frequency limitations while using this API.
It takes four cycles of the originally selected clock to switch away from it. Do not disable the original clock during this time.

◆ Cy_SysClk_ClkHfGetSource()

cy_en_clkhf_in_sources_t Cy_SysClk_ClkHfGetSource ( uint32_t  clkHf)

Reports the source of the selected clkHf.

Parameters
clkHfselects which clkHf to get the source of.
Returns
cy_en_clkhf_in_sources_t
Function Usage
/* Scenario: HFCLK1 source may have been updated to Path 0 somewhere in the
application. Check if it was and change the source to Path 1. */
{
/* Set the HFCLK1 source to Path 1 clock */
}

◆ Cy_SysClk_ClkHfSetDivider()

cy_en_sysclk_status_t Cy_SysClk_ClkHfSetDivider ( uint32_t  clkHf,
cy_en_clkhf_dividers_t  divider 
)

Sets the pre-divider for a clkHf.

Parameters
clkHfselects which clkHf divider to configure.
dividercy_en_clkhf_dividers_t
Returns
cy_en_sysclk_status_t CY_PRA_STATUS_* - For the PSoC 64 devices there are possible situations when function returns the PRA error status code cy_en_pra_status_t instead of cy_en_sysclk_status_t. This is because for PSoC 64 devices the function uses the PRA driver to change the protected registers. Refer to cy_en_pra_status_t for more details.
Note
Also call Cy_SysClk_ClkHfSetSource to set the clkHf source.
Call SystemCoreClockUpdate after this function calling if it affects the CLK_HF0 frequency.
Call Cy_SysLib_SetWaitStates before calling this function if CLK_HF0 frequency is increasing.
Call Cy_SysLib_SetWaitStates after calling this function if CLK_HF0 frequency is decreasing.
Take into account the possible platform specific clkHf (and further clocking chain links) frequency limitations while using this API.
This API is Secure Aware. On devices with ARM TrustZone enabled, it is safe to call on a Secure hardware resource from a Non-Secure CPU state. The involved PPC region is PROT_PERI0_SRSS_MAIN. See Secure Aware SysCLK for further details.
Function Usage
/* Scenario: Set HFCLK0 divider to 8, to reduce frequency and save power */
{
/* Set the HFCLK0 divider to 8 */
}
/* Check the HFCLK0 frequency */
uint32_t clkHf0freq = Cy_SysClk_ClkHfGetFrequency(0UL);
@ CY_SYSCLK_CLKHF_DIVIDE_BY_8
divide clkHf by 8
Definition: cy_sysclk.h:2548
cy_en_clkhf_dividers_t Cy_SysClk_ClkHfGetDivider(uint32_t clkHf)
Reports the pre-divider value for a clkHf.
Definition: cy_sysclk_v2.c:3318
cy_en_sysclk_status_t Cy_SysClk_ClkHfSetDivider(uint32_t clkHf, cy_en_clkhf_dividers_t divider)
Sets the pre-divider for a clkHf.
Definition: cy_sysclk_v2.c:3263
uint32_t Cy_SysClk_ClkHfGetFrequency(uint32_t clkHf)
Reports the frequency of the selected clkHf.
Definition: cy_sysclk_v2.c:3369

◆ Cy_SysClk_ClkHfGetDivider()

cy_en_clkhf_dividers_t Cy_SysClk_ClkHfGetDivider ( uint32_t  clkHf)

Reports the pre-divider value for a clkHf.

Note
This API is Secure Aware. On devices with ARM TrustZone enabled, it is safe to call on a Secure hardware resource from a Non-Secure CPU state. The involved PPC region is PROT_PERI0_SRSS_MAIN. See Secure Aware SysCLK for further details.
Parameters
clkHfselects which clkHf to check divider of.
Returns
cy_en_clkhf_dividers_t
Function Usage
/* Scenario: Set HFCLK0 divider to 8, to reduce frequency and save power */
{
/* Set the HFCLK0 divider to 8 */
}
/* Check the HFCLK0 frequency */
uint32_t clkHf0freq = Cy_SysClk_ClkHfGetFrequency(0UL);

◆ Cy_SysClk_ClkHfGetFrequency()

uint32_t Cy_SysClk_ClkHfGetFrequency ( uint32_t  clkHf)

Reports the frequency of the selected clkHf.

Parameters
clkHfSelects the clkHf
Returns
The frequency, in Hz.
Note
The reported frequency may be zero, which indicates unknown. This happens if the source input is dsi_out or clk_altlf.
Calculates the HF frequency irrespective of whether HF is enabled or not.
This API is Secure Aware. On devices with ARM TrustZone enabled, it is safe to call on a Secure hardware resource from a Non-Secure CPU state. The involved PPC regions are PROT_PERI0_SRSS_MAIN/PROT_PERI0_SRSS_GENERAL. Both PROT_PERI0_SRSS_MAIN/PROT_PERI0_SRSS_GENERAL should be either secure or non-secure. See Secure Aware SysCLK for further details.
Function Usage
/* Scenario: Set HFCLK0 divider to 8, to reduce frequency and save power */
{
/* Set the HFCLK0 divider to 8 */
}
/* Check the HFCLK0 frequency */
uint32_t clkHf0freq = Cy_SysClk_ClkHfGetFrequency(0UL);

◆ Cy_SysClk_ClkHfDirectSel()

cy_en_sysclk_status_t Cy_SysClk_ClkHfDirectSel ( uint32_t  clkHf,
bool  enable 
)

Enable/Disable the direct source selection as IMO for CLK_HF[[n]].

Parameters
clkHfSelects the clkHf
enableTrue - Selects IMO/IHO (depending which is present on the device), False - Selects Root Mux
Returns
cy_en_sysclk_status_t CY_SYSCLK_BAD_PARAM - If clkhf is incorrect. CY_SYSCLK_SUCCESS - If successfully Enabled/Disabled.

◆ Cy_SysClk_IsClkHfDirectSelEnabled()

bool Cy_SysClk_IsClkHfDirectSelEnabled ( uint32_t  clkHf)

Checks if direct source selection as IMO for CLK_HF[[n]] is enabled/disabled.

Parameters
clkHfSelects the clkHf
Returns
True - IMO/IHO selected, False - Root Mux is selected.

◆ Cy_SysClk_ClkHfGetMaskOnPath()

uint32_t Cy_SysClk_ClkHfGetMaskOnPath ( cy_en_clkhf_in_sources_t  clkPath)

Get Mask value for the HF Clocks selected and enabled for clkPath as source e.g.

Mask return will have Bit 0 set if HFCLK0 is enabled and source is clkPath

Parameters
clkPathclock path
Returns
mask of CLKHF for which clock path is set

◆ Cy_SysClk_ClkHfAllGetMask()

uint32_t Cy_SysClk_ClkHfAllGetMask ( void  )

Get Mask value for the all HF Clocks e.g.

Mask return will have Bit 0 set if HFCLK0 is enabled

Returns
mask of CLKHF

◆ Cy_SysClk_ClkHfEnableDividerWithMask()

void Cy_SysClk_ClkHfEnableDividerWithMask ( uint32_t  clkHfMask,
cy_en_clkhf_dividers_t  divider 
)

Divide all the enabled CLK_HF's with the divider value.

Parameters
clkHfMaskCLKHF mask for of the Clocks
dividerDivider Value cy_en_clkhf_dividers_t

◆ Cy_SysClk_ClkHfEnableDirectMuxWithMask()

void Cy_SysClk_ClkHfEnableDirectMuxWithMask ( uint32_t  clkHfMask,
bool  enable 
)

Enable/ Disable the clock path for the HF Clocks in clkHfMask in disable case ROOT path will be enabled in enable case ROOT path will be disabled.

Parameters
clkHfMaskCLKHF mask for of the Clocks
enableto enable or disable direct path

◆ Cy_SysClk_ClkHfCsvGetRefFrequency()

uint32_t Cy_SysClk_ClkHfCsvGetRefFrequency ( cy_en_clkhf_csv_ref_clk_t  refClk)

Get the clkHf csv reference clock frequency.

Parameters
refClkReference clock source.
Returns
cy_en_sysclk_status_t.
Function Usage
/* Scenario: Generate clkhf csv using the below hfConfig, csvConfig configuration.*/
bool manualConfig = 1UL;
/* Configure faults using sysFault API */
/* CSV Config. */
if (manualConfig)
{
cy_stc_clkhf_csv_hf_config_t hfConfig = {1, 4}; // clkhf instance 1, ref clock IHO.
cy_stc_clkhf_csv_manual_config_t csvConfig = {198, 195, 205, 208}; // Start time, lower limit, upper limit, period.
Cy_SysClk_ClkHfCsvManualConfigure(&hfConfig , &csvConfig);
Cy_SysClk_ClkHfCsvAction(1, 0); // clkhf instance 1, Action as Fault
Cy_SysClk_ClkHfCsvEnable(1); // Enable clkhf csv instance 1
}
else
{
// Auto config
cy_stc_clkhf_csv_hf_config_t hfConfig = {1, 4}; // clkhf instance 1, ref clock IMO.
Cy_SysClk_ClkHfCsvConfigure(&hfConfig, 1); // Accuracy 1%
Cy_SysClk_ClkHfCsvAction(1, 0); // clkhf instance 1, Action as Fault
Cy_SysClk_ClkHfCsvEnable(1); // Enable clkhf csv instance 1
}
void Cy_SysClk_ClkHfCsvAction(uint32_t clkHf, cy_en_clkhf_csv_action_t action)
Configures the action taken when an anomaly is detected on the clkHf.
Definition: cy_sysclk_v2.c:3667
void Cy_SysClk_ClkHfCsvDisable(uint32_t clkHf)
Disables the csv for the provided clkHf.
Definition: cy_sysclk_v2.c:3681
void Cy_SysClk_ClkHfCsvEnable(uint32_t clkHf)
Enables the csv for the provided clkHf.
Definition: cy_sysclk_v2.c:3674
cy_en_sysclk_status_t Cy_SysClk_ClkHfCsvManualConfigure(const cy_stc_clkhf_csv_hf_config_t *hfConfig, const cy_stc_clkhf_csv_manual_config_t *csvConfig)
Manually configures the clkHf csv based on user inputs.
Definition: cy_sysclk_v2.c:3596
bool Cy_SysClk_IsClkHfCsvEnabled(uint32_t clkHf)
Returns the enabled status of csv for the provided clkHf.
Definition: cy_sysclk_v2.c:3688
cy_en_sysclk_status_t Cy_SysClk_ClkHfCsvConfigure(const cy_stc_clkhf_csv_hf_config_t *hfConfig, uint32_t accuracy)
Configures clkhf csv.
Definition: cy_sysclk_v2.c:3632
This structure is used to select the HF clock and reference clock for csv configuration.
Definition: cy_sysclk.h:2618
This structure is used to manually configure the clock supervisor for clkHf.
Definition: cy_sysclk.h:2607

◆ Cy_SysClk_ClkHfCsvManualConfigure()

cy_en_sysclk_status_t Cy_SysClk_ClkHfCsvManualConfigure ( const cy_stc_clkhf_csv_hf_config_t hfConfig,
const cy_stc_clkhf_csv_manual_config_t csvConfig 
)

Manually configures the clkHf csv based on user inputs.

Parameters
hfConfigSelects the clkHf, reference clock for csv operation.
csvConfigSelects the csv configuration required.
Returns
The frequency in Hz.
Function Usage
/* Scenario: Generate clkhf csv using the below hfConfig, csvConfig configuration.*/
bool manualConfig = 1UL;
/* Configure faults using sysFault API */
/* CSV Config. */
if (manualConfig)
{
cy_stc_clkhf_csv_hf_config_t hfConfig = {1, 4}; // clkhf instance 1, ref clock IHO.
cy_stc_clkhf_csv_manual_config_t csvConfig = {198, 195, 205, 208}; // Start time, lower limit, upper limit, period.
Cy_SysClk_ClkHfCsvManualConfigure(&hfConfig , &csvConfig);
Cy_SysClk_ClkHfCsvAction(1, 0); // clkhf instance 1, Action as Fault
Cy_SysClk_ClkHfCsvEnable(1); // Enable clkhf csv instance 1
}
else
{
// Auto config
cy_stc_clkhf_csv_hf_config_t hfConfig = {1, 4}; // clkhf instance 1, ref clock IMO.
Cy_SysClk_ClkHfCsvConfigure(&hfConfig, 1); // Accuracy 1%
Cy_SysClk_ClkHfCsvAction(1, 0); // clkhf instance 1, Action as Fault
Cy_SysClk_ClkHfCsvEnable(1); // Enable clkhf csv instance 1
}

◆ Cy_SysClk_ClkHfCsvConfigure()

cy_en_sysclk_status_t Cy_SysClk_ClkHfCsvConfigure ( const cy_stc_clkhf_csv_hf_config_t hfConfig,
uint32_t  accuracy 
)

Configures clkhf csv.

The configuration formula used is: Lower_limit = Target - Required accuracy/2 Upper_limit = Target + Required accuracy/2 Period = Target / (Reference frequency / Monitor frequency) Start_time = (Period +3) * (Reference frequency / Monitor frequency) - Upper_limit

Parameters
hfConfigSelects the clkHf, reference clock for csv operation.
accuracyRequired accuracy.
Returns
cy_en_sysclk_status_t.
Function Usage
/* Scenario: Generate clkhf csv using the below hfConfig, csvConfig configuration.*/
bool manualConfig = 1UL;
/* Configure faults using sysFault API */
/* CSV Config. */
if (manualConfig)
{
cy_stc_clkhf_csv_hf_config_t hfConfig = {1, 4}; // clkhf instance 1, ref clock IHO.
cy_stc_clkhf_csv_manual_config_t csvConfig = {198, 195, 205, 208}; // Start time, lower limit, upper limit, period.
Cy_SysClk_ClkHfCsvManualConfigure(&hfConfig , &csvConfig);
Cy_SysClk_ClkHfCsvAction(1, 0); // clkhf instance 1, Action as Fault
Cy_SysClk_ClkHfCsvEnable(1); // Enable clkhf csv instance 1
}
else
{
// Auto config
cy_stc_clkhf_csv_hf_config_t hfConfig = {1, 4}; // clkhf instance 1, ref clock IMO.
Cy_SysClk_ClkHfCsvConfigure(&hfConfig, 1); // Accuracy 1%
Cy_SysClk_ClkHfCsvAction(1, 0); // clkhf instance 1, Action as Fault
Cy_SysClk_ClkHfCsvEnable(1); // Enable clkhf csv instance 1
}

◆ Cy_SysClk_ClkHfCsvAction()

void Cy_SysClk_ClkHfCsvAction ( uint32_t  clkHf,
cy_en_clkhf_csv_action_t  action 
)

Configures the action taken when an anomaly is detected on the clkHf.

Parameters
clkHfSelects the clkHf.
actionAction to be taken when anomaly is detected cy_en_clkhf_csv_action_t
Function Usage
/* Scenario: Generate clkhf csv using the below hfConfig, csvConfig configuration.*/
bool manualConfig = 1UL;
/* Configure faults using sysFault API */
/* CSV Config. */
if (manualConfig)
{
cy_stc_clkhf_csv_hf_config_t hfConfig = {1, 4}; // clkhf instance 1, ref clock IHO.
cy_stc_clkhf_csv_manual_config_t csvConfig = {198, 195, 205, 208}; // Start time, lower limit, upper limit, period.
Cy_SysClk_ClkHfCsvManualConfigure(&hfConfig , &csvConfig);
Cy_SysClk_ClkHfCsvAction(1, 0); // clkhf instance 1, Action as Fault
Cy_SysClk_ClkHfCsvEnable(1); // Enable clkhf csv instance 1
}
else
{
// Auto config
cy_stc_clkhf_csv_hf_config_t hfConfig = {1, 4}; // clkhf instance 1, ref clock IMO.
Cy_SysClk_ClkHfCsvConfigure(&hfConfig, 1); // Accuracy 1%
Cy_SysClk_ClkHfCsvAction(1, 0); // clkhf instance 1, Action as Fault
Cy_SysClk_ClkHfCsvEnable(1); // Enable clkhf csv instance 1
}

◆ Cy_SysClk_ClkHfCsvEnable()

void Cy_SysClk_ClkHfCsvEnable ( uint32_t  clkHf)

Enables the csv for the provided clkHf.

Parameters
clkHfSelects the clkHf.
Function Usage
/* Scenario: Generate clkhf csv using the below hfConfig, csvConfig configuration.*/
bool manualConfig = 1UL;
/* Configure faults using sysFault API */
/* CSV Config. */
if (manualConfig)
{
cy_stc_clkhf_csv_hf_config_t hfConfig = {1, 4}; // clkhf instance 1, ref clock IHO.
cy_stc_clkhf_csv_manual_config_t csvConfig = {198, 195, 205, 208}; // Start time, lower limit, upper limit, period.
Cy_SysClk_ClkHfCsvManualConfigure(&hfConfig , &csvConfig);
Cy_SysClk_ClkHfCsvAction(1, 0); // clkhf instance 1, Action as Fault
Cy_SysClk_ClkHfCsvEnable(1); // Enable clkhf csv instance 1
}
else
{
// Auto config
cy_stc_clkhf_csv_hf_config_t hfConfig = {1, 4}; // clkhf instance 1, ref clock IMO.
Cy_SysClk_ClkHfCsvConfigure(&hfConfig, 1); // Accuracy 1%
Cy_SysClk_ClkHfCsvAction(1, 0); // clkhf instance 1, Action as Fault
Cy_SysClk_ClkHfCsvEnable(1); // Enable clkhf csv instance 1
}

◆ Cy_SysClk_ClkHfCsvDisable()

void Cy_SysClk_ClkHfCsvDisable ( uint32_t  clkHf)

Disables the csv for the provided clkHf.

Parameters
clkHfSelects the clkHf.
Function Usage
/* Scenario: Generate clkhf csv using the below hfConfig, csvConfig configuration.*/
bool manualConfig = 1UL;
/* Configure faults using sysFault API */
/* CSV Config. */
if (manualConfig)
{
cy_stc_clkhf_csv_hf_config_t hfConfig = {1, 4}; // clkhf instance 1, ref clock IHO.
cy_stc_clkhf_csv_manual_config_t csvConfig = {198, 195, 205, 208}; // Start time, lower limit, upper limit, period.
Cy_SysClk_ClkHfCsvManualConfigure(&hfConfig , &csvConfig);
Cy_SysClk_ClkHfCsvAction(1, 0); // clkhf instance 1, Action as Fault
Cy_SysClk_ClkHfCsvEnable(1); // Enable clkhf csv instance 1
}
else
{
// Auto config
cy_stc_clkhf_csv_hf_config_t hfConfig = {1, 4}; // clkhf instance 1, ref clock IMO.
Cy_SysClk_ClkHfCsvConfigure(&hfConfig, 1); // Accuracy 1%
Cy_SysClk_ClkHfCsvAction(1, 0); // clkhf instance 1, Action as Fault
Cy_SysClk_ClkHfCsvEnable(1); // Enable clkhf csv instance 1
}

◆ Cy_SysClk_IsClkHfCsvEnabled()

bool Cy_SysClk_IsClkHfCsvEnabled ( uint32_t  clkHf)

Returns the enabled status of csv for the provided clkHf.

Parameters
clkHfSelects the clkHf.
Returns
cy_en_sysclk_status_t.
Function Usage
/* Scenario: Generate clkhf csv using the below hfConfig, csvConfig configuration.*/
bool manualConfig = 1UL;
/* Configure faults using sysFault API */
/* CSV Config. */
if (manualConfig)
{
cy_stc_clkhf_csv_hf_config_t hfConfig = {1, 4}; // clkhf instance 1, ref clock IHO.
cy_stc_clkhf_csv_manual_config_t csvConfig = {198, 195, 205, 208}; // Start time, lower limit, upper limit, period.
Cy_SysClk_ClkHfCsvManualConfigure(&hfConfig , &csvConfig);
Cy_SysClk_ClkHfCsvAction(1, 0); // clkhf instance 1, Action as Fault
Cy_SysClk_ClkHfCsvEnable(1); // Enable clkhf csv instance 1
}
else
{
// Auto config
cy_stc_clkhf_csv_hf_config_t hfConfig = {1, 4}; // clkhf instance 1, ref clock IMO.
Cy_SysClk_ClkHfCsvConfigure(&hfConfig, 1); // Accuracy 1%
Cy_SysClk_ClkHfCsvAction(1, 0); // clkhf instance 1, Action as Fault
Cy_SysClk_ClkHfCsvEnable(1); // Enable clkhf csv instance 1
}