/* Selects HSE as System clock source and configure HCLK, PCLK2 and PCLK1 prescalers.  */
static void SystemClockHSE(void)
/* Selects HSE as System clock source and configure HCLK, PCLK2 and PCLK1 prescalers.  */
static void SystemClockHSE(void)
{
    uint32_t i;
    RCM->CTRL1_B.HSEEN= BIT_SET;
    for (i = 0; i < HSE_STARTUP_TIMEOUT; i++)
    {
        if (RCM->CTRL1_B.HSERDYFLG)
        {
            break;
        }
    }
    if (RCM->CTRL1_B.HSERDYFLG)
    {
        FMC->CTRL1_B.PBEN = BIT_SET;
        FMC->CTRL1_B.WS = 0;
        RCM->CFG1_B.AHBPSC= 0X00;
        RCM->CFG1_B.APB1PSC = 0X00;
        RCM->CFG1_B.SCLKSEL = 1;
        while (RCM->CFG1_B.SCLKSWSTS!= 0x01);
    }
}