/* Selects the clock source to output on MCO pin (PA8) and the corresponding prescsaler.  */
void RCC_MCOConfig(uint8_t RCC_MCOSource, uint32_t RCC_MCOPrescaler)
/* Selects the clock source to output on MCO pin (PA8) and the corresponding prescsaler.  */
void RCC_MCOConfig(uint8_t RCC_MCOSource, uint32_t RCC_MCOPrescaler)
{
    uint32_t tmpreg = 0;
    assert_param(IS_RCC_MCO_SOURCE(RCC_MCOSource));
    assert_param(IS_RCC_MCO_PRESCALER(RCC_MCOPrescaler));
    tmpreg = RCC->CFGR;
    tmpreg &= ~(RCC_CFGR_MCO_PRE | RCC_CFGR_MCO | RCC_CFGR_PLLNODIV);
    tmpreg |= (RCC_MCOPrescaler | ((uint32_t)RCC_MCOSource << 24));
    RCC->CFGR = tmpreg;
}