summaryrefslogtreecommitdiff
path: root/bsp/wch/arm/Libraries/ch32_drivers/SConscript
blob: bb4def6cabc47f355223876ed462782d3c38171c (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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']


if  GetDepend('SOC_ARM_SERIES_CH32F203'):

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

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

    if GetDepend(['RT_USING_SPI', 'BSP_USING_SPI']):
        src += ['drv_spi_ch32f20x.c']

    if GetDepend(['RT_USING_I2C', 'BSP_USING_HWI2C']):
        src += ['drv_hwi2c_ch32f20x.c']

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

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

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

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

    if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
        src += ['drv_flash_ch32f20x.c']

src += ['drv_common.c']

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

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

Return('group')