Skip to content

Commit 8525e08

Browse files
unicornxRbb666
authored andcommitted
bsp: k230: add hwtimer support
K230 support 6 general hardware timers and 3 stc timers. This patch only implement drivers for general hw timers. Signed-off-by: Chen Wang <[email protected]>
1 parent fe13089 commit 8525e08

File tree

7 files changed

+636
-0
lines changed

7 files changed

+636
-0
lines changed

bsp/k230/.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,6 +1497,7 @@ CONFIG_BSP_USING_SDIO0=y
14971497
# CONFIG_BSP_SDIO0_1V8 is not set
14981498
# CONFIG_BSP_USING_SDIO1 is not set
14991499
CONFIG_BSP_SD_MNT_DEVNAME="sd0p1"
1500+
# CONFIG_BSP_USING_TIMERS is not set
15001501
# CONFIG_BSP_USING_WDT is not set
15011502
# CONFIG_BSP_UTEST_DRIVERS is not set
15021503
# end of Drivers Configuration

bsp/k230/board/Kconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,37 @@ menu "Drivers Configuration"
3939
default "sd0p1"
4040
endif
4141

42+
menuconfig BSP_USING_TIMERS
43+
bool "Enable Hardware Timers"
44+
select RT_USING_HWTIMER
45+
default n
46+
47+
if BSP_USING_TIMERS
48+
config BSP_USING_TIMER0
49+
bool "Enable Timer0"
50+
default n
51+
52+
config BSP_USING_TIMER1
53+
bool "Enable Timer1"
54+
default n
55+
56+
config BSP_USING_TIMER2
57+
bool "Enable Timer2"
58+
default n
59+
60+
config BSP_USING_TIMER3
61+
bool "Enable Timer3"
62+
default n
63+
64+
config BSP_USING_TIMER4
65+
bool "Enable Timer4"
66+
default n
67+
68+
config BSP_USING_TIMER5
69+
bool "Enable Timer5"
70+
default n
71+
endif
72+
4273
menuconfig BSP_USING_WDT
4374
bool "Enable Watchdog Timer"
4475
select RT_USING_WDT
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# RT-Thread building script for component
2+
3+
from building import *
4+
5+
cwd = GetCurrentDir()
6+
src = Glob('*.c')
7+
CPPPATH = [cwd]
8+
9+
group = DefineGroup('TIMER', src, depend = ['BSP_USING_TIMERS'], CPPPATH = CPPPATH)
10+
11+
objs = [group]
12+
13+
list = os.listdir(cwd)
14+
15+
for item in list:
16+
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
17+
objs = objs + SConscript(os.path.join(item, 'SConscript'))
18+
19+
Return('objs')

0 commit comments

Comments
 (0)