diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2015-07-29 17:06:17 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2015-07-29 17:06:17 +0900 |
commit | a9de53c36be5ca31974cbf3c7903ca5cf7f7fff2 (patch) | |
tree | 0ff6c70ab4d493e907d5f4f1e8ee8584580bde8b /board/board-st-dongle.h | |
parent | 83486efd5f7857e539c79ed9c947cec854468240 (diff) |
board update, adding ST Dongle
Diffstat (limited to 'board/board-st-dongle.h')
-rw-r--r-- | board/board-st-dongle.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/board/board-st-dongle.h b/board/board-st-dongle.h new file mode 100644 index 0000000..3ccf025 --- /dev/null +++ b/board/board-st-dongle.h @@ -0,0 +1,33 @@ +#define BOARD_NAME "ST Dongle" +/* echo -n "ST Dongle" | shasum -a 256 | sed -e 's/^.*\(........\) -$/\1/' */ +#define BOARD_ID 0x2cd4e471 + +#define STM32F10X_MD /* Medium-density device */ + +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HSECLK 8000000 + +#define GPIO_LED_BASE GPIOA_BASE +#define GPIO_LED_SET_TO_EMIT 9 +#define GPIO_USB_BASE GPIOA_BASE +#define GPIO_USB_SET_TO_ENABLE 15 +#undef GPIO_OTHER_BASE + +/* + * Port A setup. + * PA0 - input with pull-up. AN0 + * PA1 - input with pull-up. AN1 + * PA9 - Push pull output 50MHz (LED 1:ON 0:OFF) + * PA11 - Push Pull output 10MHz 0 default (until USB enabled) (USBDM) + * PA12 - Push Pull output 10MHz 0 default (until USB enabled) (USBDP) + * PA15 - Push pull output 50MHz (USB 1:ON 0:OFF) + * ------------------------ Default + * PAx - input with pull-up + */ +#define VAL_GPIO_LED_ODR 0xFFFFE7FF +#define VAL_GPIO_LED_CRL 0x88888888 /* PA7...PA0 */ +#define VAL_GPIO_LED_CRH 0x38811838 /* PA15...PA8 */ + +#define RCC_ENR_IOP_EN RCC_APB2ENR_IOPAEN +#define RCC_RSTR_IOP_RST RCC_APB2RSTR_IOPARST |