summaryrefslogtreecommitdiff
path: root/bsp/wch/arm/Libraries/ch32_drivers/SConscript
blob: fece8366d726263da9e4d4109d9090bbf16ea2a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Import('RTT_ROOT')
Import('rtconfig')
from building import *

cwd = GetCurrentDir()

# add the general drivers.
src = Split("""
""")


if  GetDepend('SOC_ARM_SERIES_CH32F103'):

    if GetDepend('RT_USING_PIN'):
        src += ['drv_gpio_ch32f10x.c']

    if GetDepend(['RT_USING_SERIAL', 'BSP_USING_UART']):
        src += ['drv_uart_ch32f10x.c']

    if GetDepend(['RT_USING_SPI', 'BSP_USING_SPI']):
	    src += ['drv_spi_ch32f10x.c']
    
    if GetDepend(['RT_USING_I2C', 'BSP_USING_HWI2C']):
        src += ['drv_hwi2c_ch32f10x.c']

    if GetDepend(['RT_USING_RTC', 'BSP_USING_RTC']):
        src += ['drv_rtc_ch32f10x.c']

    if GetDepend(['RT_USING_WDT', 'BSP_USING_IWDT']):
        src += ['drv_iwdt_ch32f10x.c']

    if GetDepend(['RT_USING_HWTIMER', 'BSP_USING_HWTIMER']):
        src += ['drv_hwtimer_ch32f10x.c']

    if GetDepend(['RT_USING_PWM', 'BSP_USING_PWM']):
        src += ['drv_pwm_ch32f10x.c']

src += ['drv_common.c']

path =  [cwd]
path += [cwd + '/config']

group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)

Return('group')