Commit 55b5d9a0 authored by Etienne Carriere's avatar Etienne Carriere Committed by Erwan Gouriou
Browse files

lib: stm32wba: use reference count for backup domain accesses



Add LINKLAYER_PLAT_EnableBackupDomainAccess()  and
LINKLAYER_PLAT_DisableBackupDomainAccess() to use Zephyr resources
that use a reference counter for access requests, for enabling
and disabling access the BackupDomain resources.

Signed-off-by: default avatarEtienne Carriere <etienne.carriere@foss.st.com>
parent 41952fe9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -70,12 +70,20 @@ void LINKLAYER_PLAT_ClockInit(void)
	AHB5_SwitchedOff = 0;
	radio_sleep_timer_val = 0;

#ifdef __ZEPHYR__
	LINKLAYER_PLAT_EnableBackupDomainAccess();
#else
	LL_PWR_EnableBkUpAccess();
#endif

	/* Select LSE as Sleep CLK */
	__HAL_RCC_RADIOSLPTIM_CONFIG(RCC_RADIOSTCLKSOURCE_LSE);

#ifdef __ZEPHYR__
	LINKLAYER_PLAT_DisableBackupDomainAccess();
#else
	LL_PWR_DisableBkUpAccess();
#endif

	/* Enable AHB5ENR peripheral clock (bus CLK) */
	__HAL_RCC_RADIO_CLK_ENABLE();
+16 −0
Original line number Diff line number Diff line
@@ -29,6 +29,22 @@
  */
extern void LINKLAYER_PLAT_ClockInit(void);

#ifdef __ZEPHYR__
/**
 * @brief  Enable access to backup domain resources
 * @param  None
 * @retval None
 */
extern void LINKLAYER_PLAT_EnableBackupDomainAccess(void);

/**
 * @brief  Disable access to backup domain resources
 * @param  None
 * @retval None
 */
extern void LINKLAYER_PLAT_DisableBackupDomainAccess(void);
#endif /* __ZEPHYR__ */

/**
  * @brief  Link Layer active waiting loop.
  * @param  delay: delay in us