Question
PVD (Programmable Voltage Detector) interrupt not working
Hello,
I am using NUCLEO-STM32G071RB hardware. I configure to detect PVD (falling edge) but it looks like it doesn't detect any interrupt.
/**
* @brief Configures the PVD resources.
* @param None
* @retval None
*/
void PVD_Config(void)
{
/*##-1- Enable Power Clock #################################################*/
/* Enable Power Clock */
__HAL_RCC_PWR_CLK_ENABLE();
/*##-2- Configure the NVIC for PVD #########################################*/
HAL_NVIC_SetPriority(PVD_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(PVD_IRQn);
/* Configure the PVD Level to 3 and generate an interrupt on rising and falling
edges(PVD detection level set to 2.5V, refer to the electrical characteristics
of you device datasheet for more details) */
sConfigPVD.PVDLevel = PWR_PVDLEVEL_3;
sConfigPVD.Mode = PWR_PVD_MODE_IT_RISING_FALLING;
HAL_PWR_ConfigPVD(&sConfigPVD);
/* Enable the PVD Output */
HAL_PWR_EnablePVD();
}
/**
* @brief PWR PVD interrupt falling callback
* @param none
* @retval none
*/
void HAL_PWREx_PVD_Falling_Callback(void)
{
/* Turn On LED4 as voltage is above threshold */
BSP_LED_On(LED4);
/* Set uwToggleOn global variable to one to disable toggle */
uwToggleOn = 1u;
}