drivers: timers: Add LPTIM support for STM32WBA
Add LPTIM support for STM32WBA Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
This commit is contained in:
parent
8432081f51
commit
3359259a69
1 changed files with 8 additions and 3 deletions
|
@ -343,6 +343,8 @@ static int sys_clock_driver_init(void)
|
|||
LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_LPTIM1);
|
||||
#elif defined(LL_APB3_GRP1_PERIPH_LPTIM1)
|
||||
LL_SRDAMR_GRP1_EnableAutonomousClock(LL_SRDAMR_GRP1_PERIPH_LPTIM1AMEN);
|
||||
#elif defined(LL_APB7_GRP1_PERIPH_LPTIM1)
|
||||
LL_APB7_GRP1_ReleaseReset(LL_APB7_GRP1_PERIPH_LPTIM1);
|
||||
#endif
|
||||
|
||||
/* Enable LPTIM clock source */
|
||||
|
@ -413,7 +415,8 @@ static int sys_clock_driver_init(void)
|
|||
LL_LPTIM_SetClockSource(LPTIM, LL_LPTIM_CLK_SOURCE_INTERNAL);
|
||||
/* the LPTIM clock freq is affected by the prescaler */
|
||||
LL_LPTIM_SetPrescaler(LPTIM, (__CLZ(__RBIT(LPTIM_CLOCK_RATIO)) << LPTIM_CFGR_PRESC_Pos));
|
||||
#ifdef CONFIG_SOC_SERIES_STM32U5X
|
||||
#if defined(CONFIG_SOC_SERIES_STM32U5X) || \
|
||||
defined(CONFIG_SOC_SERIES_STM32WBAX)
|
||||
LL_LPTIM_OC_SetPolarity(LPTIM, LL_LPTIM_CHANNEL_CH1,
|
||||
LL_LPTIM_OUTPUT_POLARITY_REGULAR);
|
||||
#else
|
||||
|
@ -425,7 +428,8 @@ static int sys_clock_driver_init(void)
|
|||
/* counting start is initiated by software */
|
||||
LL_LPTIM_TrigSw(LPTIM);
|
||||
|
||||
#ifdef CONFIG_SOC_SERIES_STM32U5X
|
||||
#if defined(CONFIG_SOC_SERIES_STM32U5X) || \
|
||||
defined(CONFIG_SOC_SERIES_STM32WBAX)
|
||||
/* Enable the LPTIM before proceeding with configuration */
|
||||
LL_LPTIM_Enable(LPTIM);
|
||||
|
||||
|
@ -451,7 +455,8 @@ static int sys_clock_driver_init(void)
|
|||
|
||||
accumulated_lptim_cnt = 0;
|
||||
|
||||
#ifndef CONFIG_SOC_SERIES_STM32U5X
|
||||
#if !defined(CONFIG_SOC_SERIES_STM32U5X) && \
|
||||
!defined(CONFIG_SOC_SERIES_STM32WBAX)
|
||||
/* Enable the LPTIM counter */
|
||||
LL_LPTIM_Enable(LPTIM);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue