Skip to content

Commit 55b5d9a

Browse files
etienne-lmserwango
authored andcommitted
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: Etienne Carriere <[email protected]>
1 parent 41952fe commit 55b5d9a

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

lib/stm32wba/BLE_TransparentMode/STM32_WPAN/Target/linklayer_plat.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,20 @@ void LINKLAYER_PLAT_ClockInit(void)
7070
AHB5_SwitchedOff = 0;
7171
radio_sleep_timer_val = 0;
7272

73+
#ifdef __ZEPHYR__
74+
LINKLAYER_PLAT_EnableBackupDomainAccess();
75+
#else
7376
LL_PWR_EnableBkUpAccess();
77+
#endif
7478

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

82+
#ifdef __ZEPHYR__
83+
LINKLAYER_PLAT_DisableBackupDomainAccess();
84+
#else
7885
LL_PWR_DisableBkUpAccess();
86+
#endif
7987

8088
/* Enable AHB5ENR peripheral clock (bus CLK) */
8189
__HAL_RCC_RADIO_CLK_ENABLE();

lib/stm32wba/STM32_WPAN/link_layer/ll_sys/inc/linklayer_plat.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@
2929
*/
3030
extern void LINKLAYER_PLAT_ClockInit(void);
3131

32+
#ifdef __ZEPHYR__
33+
/**
34+
* @brief Enable access to backup domain resources
35+
* @param None
36+
* @retval None
37+
*/
38+
extern void LINKLAYER_PLAT_EnableBackupDomainAccess(void);
39+
40+
/**
41+
* @brief Disable access to backup domain resources
42+
* @param None
43+
* @retval None
44+
*/
45+
extern void LINKLAYER_PLAT_DisableBackupDomainAccess(void);
46+
#endif /* __ZEPHYR__ */
47+
3248
/**
3349
* @brief Link Layer active waiting loop.
3450
* @param delay: delay in us

0 commit comments

Comments
 (0)