aboutsummaryrefslogtreecommitdiffstats
path: root/wirish
diff options
context:
space:
mode:
authorPerry Hung <iperry@alum.mit.edu>2010-08-04 04:29:02 -0400
committerPerry Hung <iperry@alum.mit.edu>2010-08-04 04:29:02 -0400
commit57df5396fe83d0bb7aa55a9f4cd3a9eb2e4a6116 (patch)
tree0c01fa11eac9b0b57f11b443e279cd14acbd87a4 /wirish
parent2bb8c3fbe39ad12bc4669d499228961ad25e0ace (diff)
downloadlibrambutan-57df5396fe83d0bb7aa55a9f4cd3a9eb2e4a6116.tar.gz
librambutan-57df5396fe83d0bb7aa55a9f4cd3a9eb2e4a6116.zip
New reset and clock control api
Diffstat (limited to 'wirish')
-rw-r--r--wirish/wirish.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/wirish/wirish.c b/wirish/wirish.c
index e166455..1938ec9 100644
--- a/wirish/wirish.c
+++ b/wirish/wirish.c
@@ -23,15 +23,22 @@
* ****************************************************************************/
/**
- * @brief Maple board bring up
+ * @brief generic maple board bring up:
+ *
+ * By default, we bring up all maple boards running on the stm32 to 72mhz,
+ * clocked off the PLL, driven by the 8MHz external crystal.
+ *
+ * AHB and APB2 are clocked at 72MHz
+ * APB1 is clocked at 36MHz
+ *
*/
#include "wirish.h"
-#include "rcc.h"
#include "systick.h"
#include "gpio.h"
#include "nvic.h"
#include "usb.h"
+#include "rcc.h"
#include "flash.h"
void init(void) {
@@ -39,7 +46,11 @@ void init(void) {
flash_enable_prefetch();
flash_set_latency(FLASH_WAIT_STATE_2);
- rcc_init();
+ /* initialize clocks */
+ rcc_clk_init(RCC_CLKSRC_PLL, RCC_PLLSRC_HSE, RCC_PLLMUL_9);
+ rcc_set_prescaler(RCC_PRESCALER_AHB, RCC_AHB_SYSCLK_DIV_1);
+ rcc_set_prescaler(RCC_PRESCALER_APB1, RCC_APB1_HCLK_DIV_2);
+ rcc_set_prescaler(RCC_PRESCALER_APB2, RCC_APB2_HCLK_DIV_1);
nvic_init();
systick_init();