PSOC E8XXGP Device Support Library
LVD (Low-Voltage-Detect)

General Description

The LVD driver provides an API to manage the Low Voltage Detection block.

The functions and other declarations used in this driver are in cy_lvd.h. You can include cy_pdl.h to get access to all functions and declarations in the PDL.

The LVD block provides a status of currently observed VDDD voltage and triggers an interrupt when the observed voltage crosses an adjusted threshold.

Configuration Considerations

To set up an LVD, configure the voltage threshold by the Cy_LVD_SetThreshold function, ensure that the LVD block itself and LVD interrupt are disabled (by the Cy_LVD_Disable and Cy_LVD_ClearInterruptMask functions correspondingly) before changing the threshold to prevent propagating a false interrupt. Then configure interrupts by the Cy_LVD_SetInterruptConfig function, do not forget to initialize an interrupt handler (the interrupt source number is srss_interrupt_IRQn). Then enable LVD by the Cy_LVD_Enable function, then wait for at least 20us to get the circuit stabilized and clear the possible false interrupts by the Cy_LVD_ClearInterrupt, and finally the LVD interrupt can be enabled by the Cy_LVD_SetInterruptMask function.

For example:

@ CY_LVD_THRESHOLD_3_15_V
Select LVD reference voltage: 3.15V.
Definition: cy_lvd.h:141
@ CY_LVD_INTR_BOTH
Select LVD interrupt: both edges.
Definition: cy_lvd.h:152
__STATIC_INLINE void Cy_LVD_ClearInterruptMask(void)
Disables LVD interrupts.
Definition: cy_lvd.h:384
__STATIC_INLINE void Cy_LVD_SetThreshold(cy_en_lvd_tripsel_t threshold)
Sets a threshold for monitoring the VDDD voltage.
Definition: cy_lvd.h:276
__STATIC_INLINE void Cy_LVD_SetInterruptMask(void)
Enables LVD interrupts.
Definition: cy_lvd.h:370
__STATIC_INLINE void Cy_LVD_Enable(void)
Enables the output of the LVD block when the VDDD voltage is at or below the threshold.
Definition: cy_lvd.h:243
__STATIC_INLINE void Cy_LVD_ClearInterrupt(void)
Clears LVD interrupt.
Definition: cy_lvd.h:324
__STATIC_INLINE void Cy_LVD_SetInterruptConfig(cy_en_lvd_intr_config_t lvdInterruptConfig)
Sets a configuration for LVD interrupt.
Definition: cy_lvd.h:417
void Cy_SysLib_DelayUs(uint16_t microseconds)
The function delays by the specified number of microseconds.
Definition: cy_syslib.c:119

Note that the LVD circuit is available only in Low Power and Ultra Low Power modes. If an LVD is required in Deep Sleep mode, then the device should be configured to periodically wake up from Deep Sleep using a Deep Sleep wakeup source. This makes sure a LVD check is performed during Low Power or Ultra Low Power modes.

More Information

See the LVD chapter of the device technical reference manual (TRM).

API Reference

 Macros
 
 Functions
 
 Enumerated Types