1from building import *
2
3cwd = GetCurrentDir()
4src = ['drv_common.c']
5path =  [cwd]
6
7if  GetDepend('SOC_RISCV_FAMILY_CH32'):
8
9    if GetDepend('BSP_USING_GPIO'):
10        src += ['drv_gpio.c']
11
12    if GetDepend('BSP_USING_UART'):
13        if GetDepend('RT_USING_SERIAL_V2'):
14            src += ['drv_usart_v2.c']
15        else:
16            src += ['drv_usart.c']
17
18    if GetDepend('BSP_USING_ADC'):
19        src += ['drv_adc.c']
20
21    if GetDepend('BSP_USING_DAC'):
22        src += ['drv_dac.c']
23
24    if GetDepend('BSP_USING_I2C'):
25        src += ['drv_i2c.c']
26
27    if GetDepend('BSP_USING_SOFT_I2C'):
28        src += ['drv_soft_i2c.c']
29
30    if GetDepend('BSP_USING_SPI'):
31        src += ['drv_soft_spi.c','drv_spi.c']
32
33    if GetDepend('BSP_USING_RTC'):
34        src += ['drv_rtc.c']
35
36    if GetDepend('BSP_USING_USBH'):
37        src += ['drv_usbh.c']
38
39    if GetDepend('BSP_USING_USBD'):
40        src += ['drv_usbd.c']
41
42    if GetDepend('BSP_USING_ETH'):
43        src += ['drv_eth.c']
44
45    if GetDepend('BSP_USING_IWDT'):
46        src += ['drv_iwdt.c']
47
48    if GetDepend('BSP_USING_CAN'):
49        src += ['drv_can.c']
50
51    if GetDepend('BSP_USING_PWM'):
52        src += ['drv_pwm.c']
53
54    if GetDepend('BSP_USING_HWTIMER'):
55        src += ['drv_hwtimer.c']
56
57    if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
58        src += ['drv_flash.c']
59
60group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
61
62Return('group')
63