Added functions for DSI clock source selection

This commit is contained in:
Titus von Boxberg 2017-07-18 19:14:46 +02:00
parent 4f0238339e
commit a4e97d5daf
2 changed files with 39 additions and 0 deletions

View File

@ -243,6 +243,26 @@ void stm32_rcc_enablelsi(void);
void stm32_rcc_disablelsi(void);
#if defined(CONFIG_STM32F7_STM32F76XX) || defined(CONFIG_STM32F7_STM32F77XX)
/****************************************************************************
* Name: stm32f7x9_rcc_dsisrcphy
*
* Description:
* Set DSI clock source to DSI PHY
*
****************************************************************************/
void stm32f7x9_rcc_dsisrcphy(void);
/****************************************************************************
* Name: stm32f7x9_rcc_dsisrcpllr
*
* Description:
* Set DSI clock source to PLLR
*
****************************************************************************/
void stm32f7x9_rcc_dsisrcpllr(void);
#endif
#undef EXTERN
#if defined(__cplusplus)
}

View File

@ -985,3 +985,22 @@ static inline void rcc_enableperipherals(void)
/****************************************************************************
* Public Functions
****************************************************************************/
void stm32f7x9_rcc_dsisrcphy(void)
{
uint32_t regval;
regval = getreg32(STM32_RCC_DCKCFGR2);
regval &= ~(RCC_DCKCFGR2_DSISEL_MASK);
regval |= (RCC_DCKCFGR2_DSISEL_PHY);
putreg32(regval, STM32_RCC_DCKCFGR2);
}
void stm32f7x9_rcc_dsisrcpllr(void)
{
uint32_t regval;
regval = getreg32(STM32_RCC_DCKCFGR2);
regval &= ~RCC_DCKCFGR2_DSISEL_MASK;
regval |= RCC_DCKCFGR2_DSISEL_SYSCLK;
putreg32(regval, STM32_RCC_DCKCFGR2);
}