Skip to content

Commit

Permalink
drivers: hci: stm32_ipm: Add possibility to work on LSI
Browse files Browse the repository at this point in the history
Use CLOCK_STM32_LSE as switch for the RF low speed clock source

Signed-off-by: Pavlo Hamov <[email protected]>
  • Loading branch information
Pavlo Hamov authored and galak committed Oct 18, 2019
1 parent 1c4626d commit 535bfeb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/bluetooth/hci/ipm_stm32wb.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ static void start_ble_rf(void)
LL_RCC_ReleaseBackupDomainReset();
}

#ifdef CONFIG_CLOCK_STM32_LSE
/* Select LSE clock */
LL_RCC_LSE_Enable();
while (!LL_RCC_LSE_IsReady()) {
Expand All @@ -338,6 +339,16 @@ static void start_ble_rf(void)

/* Switch OFF LSI */
LL_RCC_LSI1_Disable();
#else
LL_RCC_LSI2_Enable();
while (!LL_RCC_LSI2_IsReady()) {
}

/* Select wakeup source of BLE RF */
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSI);
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSI);
#endif

/* Set RNG on HSI48 */
LL_RCC_HSI48_Enable();
while (!LL_RCC_HSI48_IsReady()) {
Expand Down

0 comments on commit 535bfeb

Please sign in to comment.