summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornspsck <teng.jiang94@gmail.com>2023-11-17 12:48:53 +0100
committerDamien George <damien@micropython.org>2024-08-22 12:29:09 +1000
commit20a95b249a439b4dc57da0c2beccac35ec45db76 (patch)
tree3b44100d6719c8a5594ff1613816989458fa8b1f
parentbd4aaa7333edf53a17c31c96ae731202fec4b0f9 (diff)
stm32/system_stm32: Allow selection of OSPI clock source.
Added a #if-block to `system_stm32.c` to check whether `MICROPY_HW_RCC_OSPI_CLKSOURCE` is defined. If that is the case, the clock source for the OSPI will be changed to the specified source. Signed-off-by: nspsck <teng.jiang94@gmail.com>
-rw-r--r--ports/stm32/system_stm32.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/stm32/system_stm32.c b/ports/stm32/system_stm32.c
index 2cff36c3a..b76a41e97 100644
--- a/ports/stm32/system_stm32.c
+++ b/ports/stm32/system_stm32.c
@@ -461,6 +461,11 @@ MP_WEAK void SystemClock_Config(void) {
PeriphClkInitStruct.QspiClockSelection = MICROPY_HW_RCC_QSPI_CLKSOURCE;
#endif
+ #if defined(MICROPY_HW_RCC_OSPI_CLKSOURCE)
+ PeriphClkInitStruct.PeriphClockSelection |= RCC_PERIPHCLK_OSPI;
+ PeriphClkInitStruct.OspiClockSelection = MICROPY_HW_RCC_OSPI_CLKSOURCE;
+ #endif
+
#if defined(MICROPY_HW_RCC_SPI123_CLKSOURCE)
PeriphClkInitStruct.PeriphClockSelection |= RCC_PERIPHCLK_SPI123;
PeriphClkInitStruct.Spi123ClockSelection = MICROPY_HW_RCC_SPI123_CLKSOURCE;