Skip to content

Commit ba37d59

Browse files
Kent Hallnashif
authored andcommitted
drivers: counter: Counter API implementation for STM32F4 Series (TIMER).
- Shim for counter API using LL_TIM driver. - Supports all general-purpose (TIMx) timers. Signed-off-by: Kent Hall <[email protected]>
1 parent aceed99 commit ba37d59

File tree

9 files changed

+749
-0
lines changed

9 files changed

+749
-0
lines changed

drivers/counter/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ zephyr_library_sources_ifdef(CONFIG_COUNTER_MCUX_LPC_RTC counter_mcux_lpc
1212
zephyr_library_sources_ifdef(CONFIG_COUNTER_NRF_TIMER counter_nrfx_timer.c)
1313
zephyr_library_sources_ifdef(CONFIG_COUNTER_NRF_RTC counter_nrfx_rtc.c)
1414
zephyr_library_sources_ifdef(CONFIG_COUNTER_RTC_STM32 counter_ll_stm32_rtc.c)
15+
zephyr_library_sources_ifdef(CONFIG_COUNTER_TIMER_STM32 counter_ll_stm32_timer.c)
1516
zephyr_library_sources_ifdef(CONFIG_COUNTER_SAM_TC counter_sam_tc.c)
1617
zephyr_library_sources_ifdef(CONFIG_COUNTER_SAM0_TC32 counter_sam0_tc32.c)
1718
zephyr_library_sources_ifdef(CONFIG_COUNTER_CMOS counter_cmos.c)

drivers/counter/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ source "drivers/counter/Kconfig.imx_epit"
3636

3737
source "drivers/counter/Kconfig.stm32_rtc"
3838

39+
source "drivers/counter/Kconfig.stm32_timer"
40+
3941
source "drivers/counter/Kconfig.sam"
4042

4143
source "drivers/counter/Kconfig.sam0"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2021 Kent Hall
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
DT_COMPAT_ST_STM32_COUNTER := st,stm32-counter
5+
6+
config COUNTER_TIMER_STM32
7+
bool "STM32 counter driver"
8+
default $(dt_compat_enabled,$(DT_COMPAT_ST_STM32_COUNTER))
9+
select USE_STM32_LL_TIM
10+
help
11+
Enable the counter driver for STM32 family of processors.

0 commit comments

Comments
 (0)