SConscript 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import rtconfig
  2. from building import *
  3. # get current directory
  4. cwd = GetCurrentDir()
  5. # The set of source files associated with this SConscript file.
  6. src = Split('''
  7. GD32E51x_standard_peripheral/Source/gd32e51x_gpio.c
  8. GD32E51x_standard_peripheral/Source/gd32e51x_rcu.c
  9. GD32E51x_standard_peripheral/Source/gd32e51x_exti.c
  10. GD32E51x_standard_peripheral/Source/gd32e51x_misc.c
  11. GD32E51x_standard_peripheral/Source/gd32e51x_dbg.c
  12. ''')
  13. if GetDepend(['RT_USING_SERIAL']):
  14. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_usart.c']
  15. if GetDepend(['RT_USING_I2C']):
  16. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_i2c.c']
  17. if GetDepend(['RT_USING_SPI']):
  18. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_spi.c']
  19. if GetDepend(['RT_USING_CAN']):
  20. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_can.c']
  21. if GetDepend(['BSP_USING_ETH']):
  22. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_enet.c']
  23. if GetDepend(['RT_USING_ADC']):
  24. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_adc.c']
  25. if GetDepend(['RT_USING_DAC']):
  26. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_dac.c']
  27. if GetDepend(['RT_USING_RTC']):
  28. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_rtc.c']
  29. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_pmu.c']
  30. if GetDepend(['RT_USING_WDT']):
  31. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_wwdgt.c']
  32. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_fwdgt.c']
  33. if GetDepend(['RT_USING_SDIO']):
  34. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_sdio.c']
  35. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_dma.c']
  36. if GetDepend(['RT_USING_PWM']):
  37. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_timer.c']
  38. if GetDepend(['BSP_USING_ONCHIP_FLASH']):
  39. src += ['GD32E51x_standard_peripheral/Source/gd32e51x_fmc.c']
  40. path = [cwd + '/GD32E51x_standard_peripheral/Include']
  41. CPPDEFINES = ['USE_STDPERIPH_DRIVER']
  42. group = DefineGroup('Libraries', src, depend = ['SOC_SERIES_GD32E51x'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  43. Return('group')