Skip to content

Commit 90ed704

Browse files
committed
kinetis/pit: Update Kconfig, implement oneshot PIT
Implementation of the Kinetis' Periodic Interrupt Timer (PIT). The lower half driver is oneshot. Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
1 parent eb92f0f commit 90ed704

5 files changed

Lines changed: 466 additions & 6 deletions

File tree

arch/arm/src/kinetis/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,8 @@ if(CONFIG_ANALOG)
131131
endif()
132132
endif()
133133

134+
if(CONFIG_KINETIS_PIT)
135+
list(APPEND SRCS kinetis_oneshot_pit.c)
136+
endif()
137+
134138
target_sources(arch PRIVATE ${SRCS})

arch/arm/src/kinetis/Kconfig

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,51 @@ config KINETIS_TPM2
687687
---help---
688688
Support TPM module 2
689689

690+
691+
config KINETIS_PIT
692+
bool "Periodic Interrupt Timer (PIT)"
693+
default n
694+
select ONESHOT
695+
select ONESHOT_COUNT
696+
---help---
697+
Support for Periodic Interrupt Timer (PIT).
698+
699+
From the Reference Manual:
700+
701+
The PIT module is an array of timers that can be
702+
used to raise interrupts and trigger DMA channels.
703+
704+
Currently, PIT is used for oneshot lower half driver.
705+
706+
config KINETIS_PIT_CH0
707+
bool "Channel 0"
708+
default n
709+
depends on KINETIS_PIT
710+
---help---
711+
Enable Channel 0 of the Periodic Interrupt Timer (PIT).
712+
713+
config KINETIS_PIT_CH1
714+
bool "Channel 1"
715+
default n
716+
depends on KINETIS_PIT
717+
---help---
718+
Enable Channel 1 of the Periodic Interrupt Timer (PIT).
719+
720+
config KINETIS_PIT_CH2
721+
bool "Channel 2"
722+
default n
723+
depends on KINETIS_PIT
724+
---help---
725+
Enable Channel 2 of the Periodic Interrupt Timer (PIT).
726+
727+
config KINETIS_PIT_CH3
728+
bool "Channel 3"
729+
default n
730+
depends on KINETIS_PIT
731+
---help---
732+
Enable Channel 3 of the Periodic Interrupt Timer (PIT).
733+
734+
690735
config KINETIS_LPTMR0
691736
bool "Low power timer 0 (LPTMR0)"
692737
default n
@@ -783,12 +828,6 @@ config KINETIS_PDB
783828
---help---
784829
Support the Programmable Delay Block
785830

786-
config KINETIS_PIT
787-
bool "Programmable interval timer (PIT)"
788-
default n
789-
---help---
790-
Support Programmable Interval Timers
791-
792831
endmenu
793832

794833
menu "Kinetis FTM PWM Configuration"

arch/arm/src/kinetis/Make.defs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ ifneq ($(CONFIG_SCHED_TICKLESS),y)
3939
CHIP_CSRCS += kinetis_timerisr.c
4040
endif
4141

42+
ifeq ($(CONFIG_KINETIS_PIT),y)
43+
CHIP_CSRCS += kinetis_oneshot_pit.c
44+
endif
45+
4246
ifeq ($(CONFIG_BUILD_PROTECTED),y)
4347
CHIP_CSRCS += kinetis_userspace.c
4448
endif

0 commit comments

Comments
 (0)