Skip to content

Commit

Permalink
bsp: cvitek: Add timer driver
Browse files Browse the repository at this point in the history
Signed-off-by: Shicheng Chu <[email protected]>
  • Loading branch information
Z8MAN8 authored and mysterywolf committed Aug 25, 2024
1 parent 077e688 commit 742dae7
Show file tree
Hide file tree
Showing 5 changed files with 510 additions and 0 deletions.
26 changes: 26 additions & 0 deletions bsp/cvitek/c906_little/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,32 @@ menu "General Drivers Configuration"
default n
endif

menuconfig BSP_USING_TIMER
bool "Enable TIMER"
default n
select RT_USING_HWTIMER
if BSP_USING_TIMER
config BSP_USING_TIMER4
bool "Enable TIMER4"
default n

config BSP_USING_TIMER5
bool "Enable TIMER5"
default n

config BSP_USING_TIMER6
bool "Enable TIMER6"
default n

config BSP_USING_TIMER7
bool "Enable TIMER7"
default n

config BSP_TIMER_IRQ_BASE
int
default 55
endif

menuconfig BSP_USING_PWM
bool "Using PWM"
select RT_USING_PWM
Expand Down
42 changes: 42 additions & 0 deletions bsp/cvitek/cv18xx_risc-v/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,48 @@ menu "General Drivers Configuration"
default n
endif

menuconfig BSP_USING_TIMER
bool "Enable TIMER"
default n
select RT_USING_HWTIMER
if BSP_USING_TIMER
config BSP_USING_TIMER0
bool "Enable TIMER0"
default n

config BSP_USING_TIMER1
bool "Enable TIMER1"
default n

config BSP_USING_TIMER2
bool "Enable TIMER2"
default n

config BSP_USING_TIMER3
bool "Enable TIMER3"
default n

config BSP_USING_TIMER4
bool "Enable TIMER4"
default n

config BSP_USING_TIMER5
bool "Enable TIMER5"
default n

config BSP_USING_TIMER6
bool "Enable TIMER6"
default n

config BSP_USING_TIMER7
bool "Enable TIMER7"
default n

config BSP_TIMER_IRQ_BASE
int
default 79
endif

menuconfig BSP_USING_PWM
bool "Using PWM"
select RT_USING_PWM
Expand Down
3 changes: 3 additions & 0 deletions bsp/cvitek/drivers/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ CPPDEFINES += ['-DCONFIG_64BIT']
if GetDepend('BSP_USING_RTC'):
src += ['drv_rtc.c']

if GetDepend('BSP_USING_TIMER'):
src += ['drv_timer.c']

group = DefineGroup('drivers', src, depend = [''], CPPDEFINES = CPPDEFINES, CPPPATH = CPPPATH)

Return('group')
Loading

0 comments on commit 742dae7

Please sign in to comment.