2022-04-04 11:07:49 +08:00
|
|
|
from building import *
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
2022-09-30 23:07:52 +08:00
|
|
|
src = []
|
|
|
|
path = [cwd]
|
2022-04-04 11:07:49 +08:00
|
|
|
|
2022-08-23 14:13:33 +08:00
|
|
|
if GetDepend('SOC_RISCV_FAMILY_CH32'):
|
2022-04-04 11:07:49 +08:00
|
|
|
|
2022-09-30 23:07:52 +08:00
|
|
|
if GetDepend('BSP_USING_GPIO'):
|
2022-04-04 11:07:49 +08:00
|
|
|
src += ['drv_gpio.c']
|
|
|
|
|
2022-09-30 23:07:52 +08:00
|
|
|
if GetDepend('BSP_USING_UART'):
|
2022-04-04 11:07:49 +08:00
|
|
|
src += ['drv_usart.c']
|
|
|
|
|
2022-09-30 23:07:52 +08:00
|
|
|
if GetDepend('BSP_USING_ADC'):
|
2022-09-17 10:50:57 +08:00
|
|
|
src += ['drv_adc.c']
|
2022-04-04 11:07:49 +08:00
|
|
|
|
2022-10-12 09:35:37 +08:00
|
|
|
if GetDepend('BSP_USING_DAC'):
|
2022-09-18 21:32:56 +08:00
|
|
|
src += ['drv_dac.c']
|
|
|
|
|
2022-10-12 09:35:37 +08:00
|
|
|
if GetDepend('BSP_USING_SOFT_I2C'):
|
2022-09-30 23:07:52 +08:00
|
|
|
src += ['drv_soft_i2c.c']
|
2022-10-19 12:23:25 +08:00
|
|
|
|
|
|
|
if GetDepend('BSP_USING_SPI'):
|
|
|
|
src += ['drv_soft_spi.c','drv_spi.c']
|
2022-09-19 22:33:55 +08:00
|
|
|
|
2022-09-30 23:07:52 +08:00
|
|
|
if GetDepend('BSP_USING_RTC'):
|
2022-09-22 17:12:30 +08:00
|
|
|
src += ['drv_rtc.c']
|
|
|
|
|
2022-09-30 23:07:52 +08:00
|
|
|
if GetDepend('BSP_USING_IWDT'):
|
2022-09-29 09:09:53 +08:00
|
|
|
src += ['drv_iwdt.c']
|
2022-10-09 10:32:29 +08:00
|
|
|
|
|
|
|
if GetDepend('BSP_USING_CAN'):
|
|
|
|
src += ['drv_can.c']
|
2022-09-29 09:09:53 +08:00
|
|
|
|
2022-10-17 08:14:08 +08:00
|
|
|
if GetDepend('BSP_USING_PWM'):
|
|
|
|
src += ['drv_pwm.c']
|
2022-10-22 08:12:17 +08:00
|
|
|
|
|
|
|
if GetDepend('BSP_USING_HWTIMER'):
|
|
|
|
src += ['drv_hwtimer.c']
|
2022-10-17 08:14:08 +08:00
|
|
|
|
2022-04-04 11:07:49 +08:00
|
|
|
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
|
|
|
|
|
|
|
|
Return('group')
|