SConscript 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. path += [os.path.join(cwd, 'Inc/Legacy')]
  7. CPPDEFINES = ['USE_HAL_DRIVER']
  8. src = [
  9. os.path.join(src_path, 'stm32h7xx_hal.c'),
  10. os.path.join(src_path, 'stm32h7xx_hal_cec.c'),
  11. os.path.join(src_path, 'stm32h7xx_hal_cortex.c'),
  12. os.path.join(src_path, 'stm32h7xx_hal_comp.c'),
  13. os.path.join(src_path, 'stm32h7xx_hal_crc.c'),
  14. os.path.join(src_path, 'stm32h7xx_hal_crc_ex.c'),
  15. os.path.join(src_path, 'stm32h7xx_hal_cryp.c'),
  16. os.path.join(src_path, 'stm32h7xx_hal_cryp_ex.c'),
  17. os.path.join(src_path, 'stm32h7xx_hal_dma.c'),
  18. os.path.join(src_path, 'stm32h7xx_hal_dma_ex.c'),
  19. os.path.join(src_path, 'stm32h7xx_hal_mdma.c'),
  20. os.path.join(src_path, 'stm32h7xx_hal_pwr.c'),
  21. os.path.join(src_path, 'stm32h7xx_hal_pwr_ex.c'),
  22. os.path.join(src_path, 'stm32h7xx_hal_rcc.c'),
  23. os.path.join(src_path, 'stm32h7xx_hal_rcc_ex.c'),
  24. os.path.join(src_path, 'stm32h7xx_hal_rng.c'),
  25. os.path.join(src_path, 'stm32h7xx_hal_sram.c'),
  26. os.path.join(src_path, 'stm32h7xx_hal_gpio.c'),
  27. ]
  28. if GetDepend(['RT_USING_SERIAL']) or GetDepend(['RT_USING_NANO', 'RT_USING_CONSOLE']):
  29. src += [os.path.join(src_path, 'stm32h7xx_hal_uart.c')]
  30. src += [os.path.join(src_path, 'stm32h7xx_hal_usart.c')]
  31. src += [os.path.join(src_path, 'stm32h7xx_hal_uart_ex.c')]
  32. if GetDepend(['RT_USING_I2C']):
  33. src += [os.path.join(src_path, 'stm32h7xx_hal_i2c.c')]
  34. src += [os.path.join(src_path, 'stm32h7xx_hal_i2c_ex.c')]
  35. if GetDepend(['RT_USING_SPI']):
  36. src += [os.path.join(src_path, 'stm32h7xx_hal_spi.c')]
  37. src += [os.path.join(src_path, 'stm32h7xx_hal_qspi.c')]
  38. if GetDepend(['RT_USING_USB']):
  39. # src += [os.path.join(src_path, 'stm32h7xx_hal_pccard.c')]
  40. src += [os.path.join(src_path, 'stm32h7xx_hal_pcd.c')]
  41. src += [os.path.join(src_path, 'stm32h7xx_hal_pcd_ex.c')]
  42. src += [os.path.join(src_path, 'stm32h7xx_hal_hcd.c')]
  43. src += [os.path.join(src_path, 'stm32h7xx_ll_usb.c')]
  44. if GetDepend(['RT_USING_CAN']):
  45. src += [os.path.join(src_path, 'stm32h7xx_hal_fdcan.c')]
  46. if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']):
  47. src += [os.path.join(src_path, 'stm32h7xx_hal_tim.c')]
  48. src += [os.path.join(src_path, 'stm32h7xx_hal_tim_ex.c')]
  49. src += [os.path.join(src_path, 'stm32h7xx_hal_lptim.c')]
  50. if GetDepend(['BSP_USING_ETH']) or GetDepend(['BSP_USING_ETH_H750']):
  51. if not GetDepend(['SOC_STM32H750_ARTPI']):
  52. src += [os.path.join(src_path, 'stm32h7xx_hal_eth.c')]
  53. src += [os.path.join(src_path, 'stm32h7xx_hal_eth_ex.c')]
  54. else :
  55. src += [os.path.join(src_path, 'Legacy/stm32h7xx_hal_eth.c')]
  56. src += [os.path.join(src_path, 'Legacy/stm32h7xx_hal_eth_ex.c')]
  57. if GetDepend(['RT_USING_ADC']):
  58. src += [os.path.join(src_path, 'stm32h7xx_hal_adc.c')]
  59. src += [os.path.join(src_path, 'stm32h7xx_hal_adc_ex.c')]
  60. if GetDepend(['RT_USING_DAC']):
  61. src += [os.path.join(src_path, 'stm32h7xx_hal_dac.c')]
  62. src += [os.path.join(src_path, 'stm32h7xx_hal_dac_ex.c')]
  63. if GetDepend(['RT_USING_RTC']):
  64. src += [os.path.join(src_path, 'stm32h7xx_hal_rtc.c')]
  65. src += [os.path.join(src_path, 'stm32h7xx_hal_rtc_ex.c')]
  66. if GetDepend(['RT_USING_WDT']):
  67. src += [os.path.join(src_path, 'stm32h7xx_hal_iwdg.c')]
  68. src += [os.path.join(src_path, 'stm32h7xx_hal_wwdg.c')]
  69. if GetDepend(['RT_USING_SDIO']):
  70. src += [os.path.join(src_path, 'stm32h7xx_ll_sdmmc.c')]
  71. src += [os.path.join(src_path, 'stm32h7xx_ll_delayblock.c')]
  72. src += [os.path.join(src_path, 'stm32h7xx_hal_sd.c')]
  73. if GetDepend(['RT_USING_AUDIO']):
  74. src += [os.path.join(src_path, 'stm32h7xx_hal_i2s.c')]
  75. src += [os.path.join(src_path, 'stm32h7xx_hal_i2s_ex.c')]
  76. src += [os.path.join(src_path, 'stm32h7xx_hal_sai.c')]
  77. src += [os.path.join(src_path, 'stm32h7xx_hal_sai_ex.c')]
  78. if GetDepend(['RT_USING_MTD_NOR']):
  79. src += [os.path.join(src_path, 'stm32h7xx_hal_nor.c')]
  80. if GetDepend(['RT_USING_MTD_NAND']):
  81. src += [os.path.join(src_path, 'stm32h7xx_hal_nand.c')]
  82. if GetDepend(['BSP_USING_SDRAM']):
  83. src += [os.path.join(src_path, 'stm32h7xx_ll_fmc.c')]
  84. src += [os.path.join(src_path, 'stm32h7xx_hal_sdram.c')]
  85. if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
  86. src += [os.path.join(src_path, 'stm32h7xx_hal_flash.c')]
  87. src += [os.path.join(src_path, 'stm32h7xx_hal_flash_ex.c')]
  88. if GetDepend(['BSP_USING_LTDC']):
  89. src += [os.path.join(src_path, 'stm32h7xx_hal_ltdc.c')]
  90. src += [os.path.join(src_path, 'stm32h7xx_hal_dma2d.c')]
  91. if GetDepend(['BSP_USING_DCMI']):
  92. src += [os.path.join(src_path, 'stm32h7xx_hal_dcmi.c')]
  93. group = DefineGroup('STM32H7-HAL', src, depend = ['PKG_USING_STM32H7_HAL_DRIVER'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  94. Return('group')