aboutsummaryrefslogtreecommitdiffstats
path: root/wirish/stm32f2
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-06-05 17:50:18 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-06-07 03:38:29 -0400
commitadbbbc19369f64d64f72d9417a0bf0272d1ba497 (patch)
tree661f22f56bb1980fe5f914e55875635020d5e5e1 /wirish/stm32f2
parent221a3eb9aa5bb8318c4c2cafabd4cb4a9db2eea2 (diff)
downloadlibrambutan-adbbbc19369f64d64f72d9417a0bf0272d1ba497.tar.gz
librambutan-adbbbc19369f64d64f72d9417a0bf0272d1ba497.zip
STM32F2: Allow boards to override PLL configuration.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'wirish/stm32f2')
-rw-r--r--wirish/stm32f2/boards_setup.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/wirish/stm32f2/boards_setup.cpp b/wirish/stm32f2/boards_setup.cpp
index 876a65b..dd872d3 100644
--- a/wirish/stm32f2/boards_setup.cpp
+++ b/wirish/stm32f2/boards_setup.cpp
@@ -40,13 +40,27 @@
#include <libmaple/syscfg.h>
#include <libmaple/libmaple_types.h>
#include <wirish/wirish_types.h>
+#include <board/board.h>
-// PLL configuration for 25 MHz external oscillator --> 120 MHz SYSCLK.
-#define PLL_Q 5
-#define PLL_P 2
-#define PLL_N 240
-#define PLL_M 25
-static stm32f2_rcc_pll_data pll_data = {PLL_Q, PLL_P, PLL_N, PLL_M};
+// PLL config for 25 MHz external crystal --> 120 MHz SYSCLK, with
+// 48 MHz PLL48CK.
+#ifndef BOARD_PLL_Q
+#define BOARD_PLL_Q 5
+#endif
+#ifndef BOARD_PLL_P
+#define BOARD_PLL_P 2
+#endif
+#ifndef BOARD_PLL_N
+#define BOARD_PLL_N 240
+#endif
+#ifndef BOARD_PLL_M
+#define BOARD_PLL_M 25
+#endif
+
+static stm32f2_rcc_pll_data pll_data = {BOARD_PLL_Q,
+ BOARD_PLL_P,
+ BOARD_PLL_N,
+ BOARD_PLL_M};
namespace wirish {
namespace priv {