SConscript 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. from building import *
  2. import os
  3. cwd = GetCurrentDir()
  4. path = [os.path.join(cwd, 'Inc')]
  5. src_path = os.path.join(cwd, 'Src')
  6. CPPDEFINES = ['USE_HAL_DRIVER']
  7. src = [
  8. os.path.join(src_path, 'stm32l0xx_hal.c'),
  9. os.path.join(src_path, 'stm32l0xx_hal_comp.c'),
  10. os.path.join(src_path, 'stm32l0xx_hal_cortex.c'),
  11. os.path.join(src_path, 'stm32l0xx_hal_crc.c'),
  12. os.path.join(src_path, 'stm32l0xx_hal_crc_ex.c'),
  13. os.path.join(src_path, 'stm32l0xx_hal_cryp.c'),
  14. os.path.join(src_path, 'stm32l0xx_hal_cryp_ex.c'),
  15. os.path.join(src_path, 'stm32l0xx_hal_dma.c'),
  16. os.path.join(src_path, 'stm32l0xx_hal_pwr.c'),
  17. os.path.join(src_path, 'stm32l0xx_hal_pwr_ex.c'),
  18. os.path.join(src_path, 'stm32l0xx_hal_rcc.c'),
  19. os.path.join(src_path, 'stm32l0xx_hal_rcc_ex.c'),
  20. os.path.join(src_path, 'stm32l0xx_hal_rng.c'),
  21. os.path.join(src_path, 'stm32l0xx_hal_gpio.c'),
  22. ]
  23. if GetDepend(['RT_USING_SERIAL']) or GetDepend(['RT_USING_NANO', 'RT_USING_CONSOLE']):
  24. src += [os.path.join(src_path, 'stm32l0xx_hal_uart.c')]
  25. src += [os.path.join(src_path, 'stm32l0xx_hal_uart_ex.c')]
  26. src += [os.path.join(src_path, 'stm32l0xx_hal_usart.c')]
  27. if GetDepend(['RT_USING_I2C']):
  28. src += [os.path.join(src_path, 'stm32l0xx_hal_i2c.c')]
  29. src += [os.path.join(src_path, 'stm32l0xx_hal_i2c_ex.c')]
  30. if GetDepend(['RT_USING_SPI']):
  31. src += [os.path.join(src_path, 'stm32l0xx_hal_spi.c')]
  32. src += [os.path.join(src_path, 'stm32l0xx_hal_spi_ex.c')]
  33. src += [os.path.join(src_path, 'stm32l0xx_hal_qspi.c')]
  34. if GetDepend(['RT_USING_USB']):
  35. src += [os.path.join(src_path, 'stm32l0xx_hal_hcd.c')]
  36. src += [os.path.join(src_path, 'stm32l0xx_hal_pcd.c')]
  37. src += [os.path.join(src_path, 'stm32l0xx_hal_pcd_ex.c')]
  38. src += [os.path.join(src_path, 'stm32l0xx_ll_usb.c')]
  39. if GetDepend(['RT_USING_CAN']):
  40. src += [os.path.join(src_path, 'stm32l0xx_hal_can.c')]
  41. if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']):
  42. src += [os.path.join(src_path, 'stm32l0xx_hal_lptim.c')]
  43. src += [os.path.join(src_path, 'stm32l0xx_hal_tim.c')]
  44. src += [os.path.join(src_path, 'stm32l0xx_hal_tim_ex.c')]
  45. if GetDepend(['RT_USING_ADC']):
  46. src += [os.path.join(src_path, 'stm32l0xx_hal_adc.c')]
  47. src += [os.path.join(src_path, 'stm32l0xx_hal_adc_ex.c')]
  48. if GetDepend(['RT_USING_RTC']):
  49. src += [os.path.join(src_path, 'stm32l0xx_hal_rtc.c')]
  50. src += [os.path.join(src_path, 'stm32l0xx_hal_rtc_ex.c')]
  51. if GetDepend(['RT_USING_WDT']):
  52. src += [os.path.join(src_path, 'stm32l0xx_hal_iwdg.c')]
  53. src += [os.path.join(src_path, 'stm32l0xx_hal_wwdg.c')]
  54. if GetDepend(['RT_USING_SDIO']):
  55. src += [os.path.join(src_path, 'stm32l0xx_hal_sd.c')]
  56. src += [os.path.join(src_path, 'stm32l0xx_hal_sd_ex.c')]
  57. if GetDepend(['RT_USING_AUDIO']):
  58. src += [os.path.join(src_path, 'stm32l0xx_hal_sai.c')]
  59. src += [os.path.join(src_path, 'stm32l0xx_hal_sai_ex.c')]
  60. if GetDepend(['RT_USING_MTD_NOR']):
  61. src += [os.path.join(src_path, 'stm32l0xx_hal_nor.c')]
  62. if GetDepend(['RT_USING_MTD_NAND']):
  63. src += [os.path.join(src_path, 'stm32l0xx_hal_nand.c')]
  64. if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
  65. src += [os.path.join(src_path, 'stm32l0xx_hal_flash.c')]
  66. src += [os.path.join(src_path, 'stm32l0xx_hal_flash_ex.c')]
  67. src += [os.path.join(src_path, 'stm32l0xx_hal_flash_ramfunc.c')]
  68. group = DefineGroup('STM32L0-HAL', src, depend = ['PKG_USING_STM32L0_HAL_DRIVER'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  69. Return('group')