Add board/board-blue-pill-g.h.

This commit is contained in:
NIIBE Yutaka
2018-04-26 10:00:07 +09:00
parent 05382581e8
commit 32d0b8200d
7 changed files with 96 additions and 16 deletions

View File

@@ -6,7 +6,12 @@ extern int chx_allow_sleep;
#define STM32_PLLSRC STM32_PLLSRC_HSE
#define STM32_PLLMUL ((STM32_PLLMUL_VALUE - 2) << 18)
#ifndef STM32_ADCPRE
#define STM32_ADCPRE STM32_ADCPRE_DIV6
#endif
#ifndef STM32_USBPRE
#define STM32_USBPRE STM32_USBPRE_DIV1P5
#endif
static void
configure_clock (int high)
@@ -16,16 +21,16 @@ configure_clock (int high)
if (high)
{
cfg = STM32_MCO_NOCLOCK | STM32_USBPRE_DIV1P5
cfg = STM32_MCO_NOCLOCK | STM32_USBPRE
| STM32_PLLMUL | STM32_PLLXTPRE | STM32_PLLSRC
| STM32_ADCPRE_DIV6 | STM32_PPRE2_DIV1
| STM32_ADCPRE | STM32_PPRE2_DIV1
| STM32_PPRE1_DIV2 | STM32_HPRE_DIV1;
cfg_sw = RCC_CFGR_SW_PLL;
}
else
{
cfg = STM32_MCO_NOCLOCK | STM32_USBPRE_DIV1P5
cfg = STM32_MCO_NOCLOCK | STM32_USBPRE
| STM32_PLLMUL | STM32_PLLXTPRE | STM32_PLLSRC
| STM32_ADCPRE_DIV8 | STM32_PPRE2_DIV16
| STM32_PPRE1_DIV16 | STM32_HPRE_DIV8;