arm/stm32h7x3x_rcc.c: Add External Power Supply option to stm32h7x3x targets

This commit is contained in:
Alexis Guijarro 2024-07-25 02:18:18 +00:00 committed by Xiang Xiao
parent 08cdff2046
commit f05c85e622
2 changed files with 13 additions and 1 deletions

View File

@ -293,6 +293,12 @@ config STM32H7_PWR_DIRECT_SMPS_SUPPLY
depends on STM32H7_HAVE_SMPS
default n
config STM32H7_PWR_EXTERNAL_SOURCE_SUPPLY
bool "Use external source as power supply"
default n
---help---
Select this option for using an external power supply connected directly to the VCAP pin.
choice
prompt "STM32 H7 Power Supply Selection"
default STM32H7_PWR_DEFAULT_SUPPLY

View File

@ -148,12 +148,18 @@
# if defined(CONFIG_STM32H7_PWR_DIRECT_SMPS_SUPPLY)
# define STM32_PWR_CR3_SELECTION STM32_PWR_CR3_SDEN
# elif defined(CONFIG_STM32H7_PWR_EXTERNAL_SOURCE_SUPPLY)
# define STM32_PWR_CR3_SELECTION STM32_PWR_CR3_BYPASS
# else
# define STM32_PWR_CR3_SELECTION STM32_PWR_CR3_LDOEN
# endif
#else
# define STM32_PWR_CR3_MASK 0xffffffff
# define STM32_PWR_CR3_SELECTION (STM32_PWR_CR3_LDOEN | STM32_PWR_CR3_SCUEN)
# if defined(CONFIG_STM32H7_PWR_EXTERNAL_SOURCE_SUPPLY)
# define STM32_PWR_CR3_SELECTION (STM32_PWR_CR3_BYPASS | STM32_PWR_CR3_SCUEN)
# else
# define STM32_PWR_CR3_SELECTION (STM32_PWR_CR3_LDOEN | STM32_PWR_CR3_SCUEN)
# endif
#endif