hw_layer: ICU helper: fix clocks (#5659)
This commit is contained in:
parent
8852959aaa
commit
80a370088e
|
@ -32,32 +32,39 @@
|
|||
} \
|
||||
} while(0)
|
||||
|
||||
/*
|
||||
* TIMCLK1: Clock of timers connected to APB1
|
||||
* (Timers 2, 3, 4, 5, 6, 7, 12, 13, 14).
|
||||
* TIMCLK2: Clock of timers connected to APB2
|
||||
* (Timers 1, 8, 9, 10, 11).
|
||||
*/
|
||||
|
||||
#if (STM32_ICU_USE_TIM1 == TRUE)
|
||||
#define RETURN_ICU1(channel) RETURN_ICU_TRUE(&ICUD1, channel, GPIO_AF_TIM1, STM32_TIMCLK1)
|
||||
#define RETURN_ICU1(channel) RETURN_ICU_TRUE(&ICUD1, channel, GPIO_AF_TIM1, STM32_TIMCLK2)
|
||||
#else
|
||||
#define RETURN_ICU1(channel)
|
||||
#endif
|
||||
|
||||
#if (STM32_ICU_USE_TIM2 == TRUE)
|
||||
#define RETURN_ICU2(channel) RETURN_ICU_TRUE(&ICUD2, channel, GPIO_AF_TIM2, STM32_TIMCLK2)
|
||||
#define RETURN_ICU2(channel) RETURN_ICU_TRUE(&ICUD2, channel, GPIO_AF_TIM2, STM32_TIMCLK1)
|
||||
#else
|
||||
#define RETURN_ICU2(channel)
|
||||
#endif
|
||||
|
||||
#if (STM32_ICU_USE_TIM3 == TRUE)
|
||||
#define RETURN_ICU3(channel) RETURN_ICU_TRUE(&ICUD3, channel, GPIO_AF_TIM3, STM32_TIMCLK3)
|
||||
#define RETURN_ICU3(channel) RETURN_ICU_TRUE(&ICUD3, channel, GPIO_AF_TIM3, STM32_TIMCLK1)
|
||||
#else
|
||||
#define RETURN_ICU3(channel)
|
||||
#endif
|
||||
|
||||
#if (STM32_ICU_USE_TIM4 == TRUE)
|
||||
#define RETURN_ICU4(channel) RETURN_ICU_TRUE(&ICUD4, channel, GPIO_AF_TIM4, STM32_TIMCLK4)
|
||||
#define RETURN_ICU4(channel) RETURN_ICU_TRUE(&ICUD4, channel, GPIO_AF_TIM4, STM32_TIMCLK1)
|
||||
#else
|
||||
#define RETURN_ICU4(channel)
|
||||
#endif
|
||||
|
||||
#if (STM32_ICU_USE_TIM5 == TRUE)
|
||||
#define RETURN_ICU5(channel) RETURN_ICU_TRUE(&ICUD5, channel, GPIO_AF_TIM5, STM32_TIMCLK5)
|
||||
#define RETURN_ICU5(channel) RETURN_ICU_TRUE(&ICUD5, channel, GPIO_AF_TIM5, STM32_TIMCLK1)
|
||||
#else
|
||||
#define RETURN_ICU5(channel)
|
||||
#endif
|
||||
|
@ -67,43 +74,43 @@
|
|||
/* TIM7 is internal only */
|
||||
|
||||
#if (STM32_ICU_USE_TIM8 == TRUE)
|
||||
#define RETURN_ICU8(channel) RETURN_ICU_TRUE(&ICUD8, channel, GPIO_AF_TIM8, STM32_TIMCLK8)
|
||||
#define RETURN_ICU8(channel) RETURN_ICU_TRUE(&ICUD8, channel, GPIO_AF_TIM8, STM32_TIMCLK2)
|
||||
#else
|
||||
#define RETURN_ICU8(channel)
|
||||
#endif
|
||||
|
||||
#if (STM32_ICU_USE_TIM9 == TRUE)
|
||||
#define RETURN_ICU9(channel) RETURN_ICU_TRUE(&ICUD9, channel, GPIO_AF_TIM9, STM32_TIMCLK9)
|
||||
#define RETURN_ICU9(channel) RETURN_ICU_TRUE(&ICUD9, channel, GPIO_AF_TIM9, STM32_TIMCLK2)
|
||||
#else
|
||||
#define RETURN_ICU9(channel)
|
||||
#endif
|
||||
|
||||
#if (STM32_ICU_USE_TIM10 == TRUE)
|
||||
#define RETURN_ICU10(channel) RETURN_ICU_TRUE(&ICUD10, channel, GPIO_AF_TIM10, STM32_TIMCLK10)
|
||||
#define RETURN_ICU10(channel) RETURN_ICU_TRUE(&ICUD10, channel, GPIO_AF_TIM10, STM32_TIMCLK2)
|
||||
#else
|
||||
#define RETURN_ICU10(channel)
|
||||
#endif
|
||||
|
||||
#if (STM32_ICU_USE_TIM11 == TRUE)
|
||||
#define RETURN_ICU11(channel) RETURN_ICU_TRUE(&ICUD11, channel, GPIO_AF_TIM11, STM32_TIMCLK11)
|
||||
#define RETURN_ICU11(channel) RETURN_ICU_TRUE(&ICUD11, channel, GPIO_AF_TIM11, STM32_TIMCLK2)
|
||||
#else
|
||||
#define RETURN_ICU11(channel)
|
||||
#endif
|
||||
|
||||
#if (STM32_ICU_USE_TIM12 == TRUE)
|
||||
#define RETURN_ICU12(channel) RETURN_ICU_TRUE(&ICUD12, channel, GPIO_AF_TIM12, STM32_TIMCLK12)
|
||||
#define RETURN_ICU12(channel) RETURN_ICU_TRUE(&ICUD12, channel, GPIO_AF_TIM12, STM32_TIMCLK1)
|
||||
#else
|
||||
#define RETURN_ICU12(channel)
|
||||
#endif
|
||||
|
||||
#if (STM32_ICU_USE_TIM13 == TRUE)
|
||||
#define RETURN_ICU13(channel) RETURN_ICU_TRUE(&ICUD13, channel, GPIO_AF_TIM13, STM32_TIMCLK13)
|
||||
#define RETURN_ICU13(channel) RETURN_ICU_TRUE(&ICUD13, channel, GPIO_AF_TIM13, STM32_TIMCLK1)
|
||||
#else
|
||||
#define RETURN_ICU13(channel)
|
||||
#endif
|
||||
|
||||
#if (STM32_ICU_USE_TIM14 == TRUE)
|
||||
#define RETURN_ICU14(channel) RETURN_ICU_TRUE(&ICUD14, channel, GPIO_AF_TIM14, STM32_TIMCLK14)
|
||||
#define RETURN_ICU14(channel) RETURN_ICU_TRUE(&ICUD14, channel, GPIO_AF_TIM14, STM32_TIMCLK1)
|
||||
#else
|
||||
#define RETURN_ICU14(channel)
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue