2022-04-04 11:07:49 +08:00
|
|
|
from building import *
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
2023-06-15 04:33:01 +08:00
|
|
|
src = ['drv_common.c']
|
2022-09-30 23:07:52 +08:00
|
|
|
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'):
|
2023-01-09 10:14:23 +08:00
|
|
|
src += ['drv_dac.c']
|
2022-09-18 21:32:56 +08:00
|
|
|
|
2024-04-01 12:40:55 +08:00
|
|
|
if GetDepend('BSP_USING_I2C'):
|
|
|
|
src += ['drv_i2c.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']
|
2023-01-09 10:14:23 +08:00
|
|
|
|
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']
|
|
|
|
|
2024-05-01 01:40:58 +08:00
|
|
|
if GetDepend('BSP_USING_USBH'):
|
|
|
|
src += ['drv_usbh.c']
|
|
|
|
|
|
|
|
if GetDepend('BSP_USING_USBD'):
|
|
|
|
src += ['drv_usbd.c']
|
|
|
|
|
2024-07-25 17:40:56 +08:00
|
|
|
if GetDepend('BSP_USING_ETH'):
|
|
|
|
src += ['drv_eth.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']
|
2023-01-09 10:14:23 +08:00
|
|
|
|
2022-10-09 10:32:29 +08:00
|
|
|
if GetDepend('BSP_USING_CAN'):
|
2023-01-09 10:14:23 +08:00
|
|
|
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']
|
2023-01-09 10:14:23 +08:00
|
|
|
|
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')
|