feat: Support for WS2812 RGB LEDs (#3909)
Co-authored-by: 3djc <lesitewebdejc@hotmail.com>
This commit is contained in:
@@ -62,3 +62,23 @@ void stm32_timer_disable_clock(TIM_TypeDef *TIMx)
|
||||
LL_APB1_GRP1_DisableClock(LL_APB1_GRP1_PERIPH_TIM14);
|
||||
}
|
||||
}
|
||||
|
||||
bool stm32_timer_is_clock_enabled(TIM_TypeDef *TIMx)
|
||||
{
|
||||
if (TIMx == TIM1) {
|
||||
return LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_TIM1) != 0;
|
||||
} else if (TIMx == TIM2) {
|
||||
return LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_TIM2) != 0;
|
||||
} else if (TIMx == TIM3) {
|
||||
return LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_TIM3) != 0;
|
||||
} else if (TIMx == TIM4) {
|
||||
return LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_TIM4) != 0;
|
||||
} else if (TIMx == TIM5) {
|
||||
return LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_TIM5) != 0;
|
||||
} else if (TIMx == TIM8) {
|
||||
return LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_TIM8) != 0;
|
||||
}
|
||||
|
||||
// not supported
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user