aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2015-06-22 16:18:44 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2015-06-22 16:18:44 +0900
commitb2986480794bc44a6e8435a819341d5f3afd2752 (patch)
treef8c72e513bbfd8d27564d1cd7bde3412beebf401 /board
parentfc26cf08894e25f1ae1109c530b382d70babaf06 (diff)
Kaz Kojima add STM32 Primer2 support
Diffstat (limited to 'board')
-rw-r--r--board/board-stm32-primer2.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/board/board-stm32-primer2.h b/board/board-stm32-primer2.h
new file mode 100644
index 0000000..4cc5e8a
--- /dev/null
+++ b/board/board-stm32-primer2.h
@@ -0,0 +1,39 @@
+#define FLASH_PAGE_SIZE 2048
+
+#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1
+#define STM32_PLLMUL_VALUE 6
+#define STM32_HSECLK 12000000
+
+#define GPIO_USB_CLEAR_TO_ENABLE 3
+#define GPIO_LED_CLEAR_TO_EMIT 0
+
+/*
+ * Port D setup.
+ * PD3 - Push pull output 50MHz (USB 1:ON 0:OFF)
+ * ------------------------ Default
+ * PDx - input with pull-up
+ */
+#define VAL_GPIO_ODR 0xFFFFFFFF
+#define VAL_GPIO_CRL 0x88883888 /* PD7...PD0 */
+#define VAL_GPIO_CRH 0x88888888 /* PD15...PD8 */
+
+/*
+ * Port E setup.
+ * PE0 - Push pull output (LED 1:ON 0:OFF)
+ * PE1 - Push pull output (LED 1:ON 0:OFF)
+ * ------------------------ Default
+ * PCx - input with pull-up
+ */
+#define VAL_GPIO_LED_ODR 0xFFFFFFFF
+#define VAL_GPIO_LED_CRL 0x88888833 /* PE7...PE0 */
+#define VAL_GPIO_LED_CRH 0x88888888 /* PE15...PE8 */
+
+#define GPIO_USB_BASE GPIOD_BASE
+#define GPIO_LED_BASE GPIOE_BASE
+
+#define RCC_ENR_IOP_EN \
+ (RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPDEN | RCC_APB2ENR_IOPEEN)
+#define RCC_RSTR_IOP_RST \
+ (RCC_APB2RSTR_IOPARST | RCC_APB2RSTR_IOPDRST | RCC_APB2RSTR_IOPERST)
+
+/* NeuG settings for ADC2 is default (PA0: Analog IN0, PA1: Analog IN1). */