SConscript 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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, 'stm32l5xx_hal.c'),
  9. os.path.join(src_path, 'stm32l5xx_hal_comp.c'),
  10. os.path.join(src_path, 'stm32l5xx_hal_cortex.c'),
  11. os.path.join(src_path, 'stm32l5xx_hal_crc.c'),
  12. os.path.join(src_path, 'stm32l5xx_hal_crc_ex.c'),
  13. os.path.join(src_path, 'stm32l5xx_hal_cryp.c'),
  14. os.path.join(src_path, 'stm32l5xx_hal_cryp_ex.c'),
  15. os.path.join(src_path, 'stm32l5xx_hal_dma.c'),
  16. os.path.join(src_path, 'stm32l5xx_hal_dma_ex.c'),
  17. os.path.join(src_path, 'stm32l5xx_hal_exti.c'),
  18. os.path.join(src_path, 'stm32l5xx_hal_pwr.c'),
  19. os.path.join(src_path, 'stm32l5xx_hal_pwr_ex.c'),
  20. os.path.join(src_path, 'stm32l5xx_hal_rcc.c'),
  21. os.path.join(src_path, 'stm32l5xx_hal_rcc_ex.c'),
  22. os.path.join(src_path, 'stm32l5xx_hal_rng.c'),
  23. os.path.join(src_path, 'stm32l5xx_hal_gpio.c'),
  24. ]
  25. if GetDepend(['RT_USING_SERIAL']) or GetDepend(['RT_USING_NANO', 'RT_USING_CONSOLE']):
  26. src += [os.path.join(src_path, 'stm32l5xx_hal_uart.c')]
  27. src += [os.path.join(src_path, 'stm32l5xx_hal_uart_ex.c')]
  28. src += [os.path.join(src_path, 'stm32l5xx_hal_usart.c')]
  29. src += [os.path.join(src_path, 'stm32l5xx_hal_usart_ex.c')]
  30. if GetDepend(['RT_USING_I2C']):
  31. src += [os.path.join(src_path, 'stm32l5xx_hal_i2c.c')]
  32. src += [os.path.join(src_path, 'stm32l5xx_hal_i2c_ex.c')]
  33. if GetDepend(['RT_USING_SPI']):
  34. src += [os.path.join(src_path, 'stm32l5xx_hal_spi.c')]
  35. src += [os.path.join(src_path, 'stm32l5xx_hal_spi_ex.c')]
  36. src += [os.path.join(src_path, 'stm32l5xx_hal_qspi.c')]
  37. if GetDepend(['RT_USING_USB']):
  38. src += [os.path.join(src_path, 'stm32l5xx_hal_hcd.c')]
  39. src += [os.path.join(src_path, 'stm32l5xx_hal_pcd.c')]
  40. src += [os.path.join(src_path, 'stm32l5xx_hal_pcd_ex.c')]
  41. src += [os.path.join(src_path, 'stm32l5xx_ll_usb.c')]
  42. if GetDepend(['RT_USING_CAN']):
  43. src += [os.path.join(src_path, 'stm32l5xx_hal_can.c')]
  44. if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']):
  45. src += [os.path.join(src_path, 'stm32l5xx_hal_lptim.c')]
  46. src += [os.path.join(src_path, 'stm32l5xx_hal_tim.c')]
  47. src += [os.path.join(src_path, 'stm32l5xx_hal_tim_ex.c')]
  48. if GetDepend(['RT_USING_ADC']):
  49. src += [os.path.join(src_path, 'stm32l5xx_hal_adc.c')]
  50. src += [os.path.join(src_path, 'stm32l5xx_hal_adc_ex.c')]
  51. if GetDepend(['RT_USING_DAC']):
  52. src += [os.path.join(src_path, 'stm32l5xx_hal_dac.c')]
  53. src += [os.path.join(src_path, 'stm32l5xx_hal_dac_ex.c')]
  54. if GetDepend(['RT_USING_RTC']):
  55. src += [os.path.join(src_path, 'stm32l5xx_hal_rtc.c')]
  56. src += [os.path.join(src_path, 'stm32l5xx_hal_rtc_ex.c')]
  57. if GetDepend(['RT_USING_WDT']):
  58. src += [os.path.join(src_path, 'stm32l5xx_hal_iwdg.c')]
  59. src += [os.path.join(src_path, 'stm32l5xx_hal_wwdg.c')]
  60. if GetDepend(['RT_USING_SDIO']):
  61. src += [os.path.join(src_path, 'stm32l5xx_hal_sd.c')]
  62. src += [os.path.join(src_path, 'stm32l5xx_hal_sd_ex.c')]
  63. src += [os.path.join(src_path, 'stm32l5xx_ll_sdmmc.c')]
  64. if GetDepend(['RT_USING_AUDIO']):
  65. src += [os.path.join(src_path, 'stm32l5xx_hal_sai.c')]
  66. src += [os.path.join(src_path, 'stm32l5xx_hal_sai_ex.c')]
  67. if GetDepend(['RT_USING_MTD_NOR']):
  68. src += [os.path.join(src_path, 'stm32l5xx_hal_nor.c')]
  69. if GetDepend(['RT_USING_MTD_NAND']):
  70. src += [os.path.join(src_path, 'stm32l5xx_hal_nand.c')]
  71. if GetDepend(['RT_USING_PM']):
  72. src += [os.path.join(src_path, 'stm32l5xx_hal_lptim.c')]
  73. if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
  74. src += [os.path.join(src_path, 'stm32l5xx_hal_flash.c')]
  75. src += [os.path.join(src_path, 'stm32l5xx_hal_flash_ex.c')]
  76. src += [os.path.join(src_path, 'stm32l5xx_hal_flash_ramfunc.c')]
  77. if GetDepend(['BSP_USING_FMC']):
  78. src += [os.path.join(src_path, 'stm32l5xx_ll_fmc.c')]
  79. if GetDepend(['BSP_USING_GFXMMU']):
  80. src += [os.path.join(src_path, 'stm32l5xx_hal_gfxmmu.c')]
  81. if GetDepend(['BSP_USING_DSI']):
  82. src += [os.path.join(src_path, 'stm32l5xx_hal_dsi.c')]
  83. src += [os.path.join(src_path, 'stm32l5xx_hal_dma2d.c')]
  84. src += [os.path.join(src_path, 'stm32l5xx_ll_dma2d.c')]
  85. src += [os.path.join(src_path, 'stm32l5xx_hal_ltdc.c')]
  86. src += [os.path.join(src_path, 'stm32l5xx_hal_ltdc_ex.c')]
  87. if GetDepend(['BSP_USING_SRAM']):
  88. src += [os.path.join(src_path, 'stm32l5xx_hal_sram.c')]
  89. group = DefineGroup('STM32L5-HAL', src, depend = ['PKG_USING_STM32L5_HAL_DRIVER'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  90. Return('group')