2022-01-02 09:14:03 +08:00
|
|
|
import rtconfig
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
# get current directory
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
# The set of source files associated with this SConscript file.
|
|
|
|
|
|
|
|
src = Split('''
|
|
|
|
CMSIS/GD/GD32F20x/Source/system_gd32f20x.c
|
|
|
|
GD32F20x_standard_peripheral/Source/gd32f20x_gpio.c
|
|
|
|
GD32F20x_standard_peripheral/Source/gd32f20x_rcu.c
|
|
|
|
GD32F20x_standard_peripheral/Source/gd32f20x_exti.c
|
|
|
|
GD32F20x_standard_peripheral/Source/gd32f20x_misc.c
|
|
|
|
''')
|
2023-01-09 10:14:23 +08:00
|
|
|
|
2022-01-02 09:14:03 +08:00
|
|
|
if GetDepend(['RT_USING_SERIAL']):
|
|
|
|
src += ['GD32F20x_standard_peripheral/Source/gd32f20x_usart.c']
|
2023-01-09 10:14:23 +08:00
|
|
|
|
2022-01-02 09:14:03 +08:00
|
|
|
if GetDepend(['RT_USING_I2C']):
|
|
|
|
src += ['GD32F20x_standard_peripheral/Source/gd32f20x_i2c.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_SPI']):
|
|
|
|
src += ['GD32F20x_standard_peripheral/Source/gd32f20x_spi.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_CAN']):
|
|
|
|
src += ['GD32F20x_standard_peripheral/Source/gd32f20x_can.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_ETH']):
|
|
|
|
src += ['GD32F20x_standard_peripheral/Source/gd32f20x_enet.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_ADC']):
|
|
|
|
src += ['GD32F20x_standard_peripheral/Source/gd32f20x_adc.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_DAC']):
|
|
|
|
src += ['GD32F20x_standard_peripheral/Source/gd32f20x_dac.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_RTC']):
|
|
|
|
src += ['GD32F20x_standard_peripheral/Source/gd32f20x_rtc.c']
|
2022-07-25 10:18:15 +08:00
|
|
|
src += ['GD32F20x_standard_peripheral/Source/gd32f20x_pmu.c']
|
2022-01-02 09:14:03 +08:00
|
|
|
|
|
|
|
if GetDepend(['RT_USING_WDT']):
|
|
|
|
src += ['GD32F20x_standard_peripheral/Source/gd32f20x_wwdgt.c']
|
|
|
|
src += ['GD32F20x_standard_peripheral/Source/gd32f20x_fwdgt.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_SDIO']):
|
|
|
|
src += ['GD32F20x_standard_peripheral/Source/gd32f20x_sdio.c']
|
2023-01-09 10:14:23 +08:00
|
|
|
src += ['GD32F20x_standard_peripheral/Source/gd32f20x_dma.c']
|
2022-01-02 09:14:03 +08:00
|
|
|
|
|
|
|
path = [
|
|
|
|
cwd + '/CMSIS/GD/GD32F20x/Include',
|
|
|
|
cwd + '/CMSIS',
|
|
|
|
cwd + '/GD32F20x_standard_peripheral/Include',]
|
|
|
|
|
|
|
|
CPPDEFINES = ['USE_STDPERIPH_DRIVER']
|
|
|
|
|
|
|
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
|
|
|
|
|
|
|
Return('group')
|