Low Power features control Functions¶
-
group
group_sar_functions_lp
Functions
-
cy_en_sar_status_t
Cy_SAR_ScanCountEnable
(const SAR_Type *base) Enables the Scanning Counter.
Suitable for PASS_V2.
- Function Usage
/* Scenario: SAR is going to be used in Deep Sleep Mode */ Cy_SAR_SelectClock(SAR0, CY_SAR_CLK_DEEPSLEEP); /* Scenario: And also SAR will take several samples at one Timer trigger. * Presuming the Scan Counter is configured here using Cy_SAR_CommonInit(). */ if (CY_SAR_SUCCESS != Cy_SAR_ScanCountEnable(SAR0)) { /* insert error handling */ } /* Scenario: All these low power features are not needed more */ Cy_SAR_ScanCountDisable(SAR0); Cy_SAR_SelectClock(SAR0, CY_SAR_CLK_PERI);
- Parameters
base – Pointer to the structure of SAR instance registers.
- Returns
The status:
CY_SAR_BAD_PARAM - either the feature is not supported by this IP version or the injection channel is triggered and not tailgating.
CY_SAR_SUCCESS - the SAR Scanning Counter feature is successfully enabled.
-
__STATIC_INLINE void Cy_SAR_ScanCountDisable (const SAR_Type *base)
Disables the Scanning Counter.
- Function Usage
/* Scenario: SAR is going to be used in Deep Sleep Mode */ Cy_SAR_SelectClock(SAR0, CY_SAR_CLK_DEEPSLEEP); /* Scenario: And also SAR will take several samples at one Timer trigger. * Presuming the Scan Counter is configured here using Cy_SAR_CommonInit(). */ if (CY_SAR_SUCCESS != Cy_SAR_ScanCountEnable(SAR0)) { /* insert error handling */ } /* Scenario: All these low power features are not needed more */ Cy_SAR_ScanCountDisable(SAR0); Cy_SAR_SelectClock(SAR0, CY_SAR_CLK_PERI);
- Parameters
base – Pointer to the structure of SAR instance registers.
-
__STATIC_INLINE void Cy_SAR_SelectClock (const SAR_Type *base, cy_en_sar_clock_source_t clock)
Switch the SAR input clock source.
Suitable for PASS_V2 only. In case of CY_SAR_CLK_DEEPSLEEP it enables SAR operation in Deep Sleep mode.
- Function Usage
/* Scenario: SAR is going to be used in Deep Sleep Mode */ Cy_SAR_SelectClock(SAR0, CY_SAR_CLK_DEEPSLEEP); /* Scenario: And also SAR will take several samples at one Timer trigger. * Presuming the Scan Counter is configured here using Cy_SAR_CommonInit(). */ if (CY_SAR_SUCCESS != Cy_SAR_ScanCountEnable(SAR0)) { /* insert error handling */ } /* Scenario: All these low power features are not needed more */ Cy_SAR_ScanCountDisable(SAR0); Cy_SAR_SelectClock(SAR0, CY_SAR_CLK_PERI);
- Parameters
base – Pointer to the structure of SAR instance registers.
clock – The SAR clock source cy_en_sar_clock_source_t.
-
cy_en_sar_status_t