Skip to content

Commit

Permalink
arm/stm32h7x3x_rcc.c: Add External Power Supply option to stm32h7x3x …
Browse files Browse the repository at this point in the history
…targets
  • Loading branch information
TOTON95 authored and xiaoxiang781216 committed Aug 14, 2024
1 parent 08cdff2 commit f05c85e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions arch/arm/src/stm32h7/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion arch/arm/src/stm32h7/stm32h7x3xx_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f05c85e

Please sign in to comment.