[HAL][LL][PWR] Update to support 'USB supply enable' feature for STM32G0B0 devices
diff --git a/Inc/stm32g0xx_hal_pwr_ex.h b/Inc/stm32g0xx_hal_pwr_ex.h index 432158d..7a33498 100644 --- a/Inc/stm32g0xx_hal_pwr_ex.h +++ b/Inc/stm32g0xx_hal_pwr_ex.h
@@ -592,13 +592,14 @@ /* Power voltage monitoring configuration functions ***************************/ void HAL_PWREx_EnableVddIO2(void); void HAL_PWREx_DisableVddIO2(void); -void HAL_PWREx_EnableVddUSB(void); -void HAL_PWREx_DisableVddUSB(void); void HAL_PWREx_EnablePVMUSB(void); void HAL_PWREx_DisablePVMUSB(void); HAL_StatusTypeDef HAL_PWREx_ConfigPVM(PWR_PVMTypeDef *sConfigPVM); #endif /* PWR_PVM_SUPPORT */ - +#if defined(PWR_CR2_USV) +void HAL_PWREx_EnableVddUSB(void); +void HAL_PWREx_DisableVddUSB(void); +#endif /* PWR_CR2_USV */ /* Low Power modes configuration functions ************************************/ void HAL_PWREx_EnableLowPowerRunMode(void); HAL_StatusTypeDef HAL_PWREx_DisableLowPowerRunMode(void);
diff --git a/Inc/stm32g0xx_ll_pwr.h b/Inc/stm32g0xx_ll_pwr.h index f739042..0708967 100644 --- a/Inc/stm32g0xx_ll_pwr.h +++ b/Inc/stm32g0xx_ll_pwr.h
@@ -482,7 +482,9 @@ { return ((READ_BIT(PWR->CR2, PWR_CR2_IOSV) == (PWR_CR2_IOSV)) ? 1UL : 0UL); } +#endif /* STM32G0C1xx || STM32G0B1xx */ +#if defined(PWR_CR2_USV) /** * @brief Enable VDDUSB supply * @rmtoll CR2 USV LL_PWR_EnableVddUSB @@ -512,7 +514,7 @@ { return ((READ_BIT(PWR->CR2, PWR_CR2_USV) == (PWR_CR2_USV)) ? 1UL : 0UL); } -#endif /* STM32G0C1xx || STM32G0B1xx */ +#endif /* PWR_CR2_USV */ #if defined (PWR_PVM_SUPPORT) /**
diff --git a/Src/stm32g0xx_hal_pwr_ex.c b/Src/stm32g0xx_hal_pwr_ex.c index 4d9c89b..96ac916 100644 --- a/Src/stm32g0xx_hal_pwr_ex.c +++ b/Src/stm32g0xx_hal_pwr_ex.c
@@ -246,7 +246,7 @@ } #endif /* PWR_PVD_SUPPORT */ -#if defined(PWR_PVM_SUPPORT) +#if defined(PWR_CR2_USV) /** * @brief Enable VDDUSB supply. * @note Remove VDDUSB electrical and logical isolation, once VDDUSB supply is present. @@ -265,7 +265,7 @@ { CLEAR_BIT(PWR->CR2, PWR_CR2_USV); } -#endif /* PWR_PVM_SUPPORT */ +#endif /* PWR_CR2_USV */ #if defined(PWR_CR2_IOSV) /**