SConscript 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. Import('rtconfig')
  2. import os
  3. from building import *
  4. # Get current directory
  5. cwd = GetCurrentDir()
  6. CPPDEFINES = []
  7. # Update include path
  8. path = [
  9. os.path.join(cwd, 'debug_console'),
  10. os.path.join(cwd, 'touch'),
  11. os.path.join(cwd, 'usb'),
  12. os.path.join(cwd, 'dma_mgr'),
  13. ]
  14. # The set of source files associated with this SConscript file.
  15. src = []
  16. src += [os.path.join(cwd, 'debug_console', 'hpm_debug_console.c')]
  17. src += [os.path.join(cwd, 'dma_mgr', 'hpm_dma_mgr.c')]
  18. CPPDEFINES += ['USE_DMA_DECLARE_EXT_ISR_M=1']
  19. if GetDepend(['BSP_USING_TOUCH_GT9xx']):
  20. src += [os.path.join(cwd, 'touch', 'gt9xx', 'hpm_touch_gt9xx.c')]
  21. src += [os.path.join(cwd, 'touch', 'gt9xx', 'hpm_gt9xx.c')]
  22. path += [os.path.join(cwd, 'touch', 'gt9xx')]
  23. CPPDEFINES += ['CONFIG_TOUCH_GT9XX=1']
  24. if GetDepend(['BSP_USING_TOUCH_FT5406']):
  25. src += [os.path.join(cwd, 'touch', 'ft5406', 'hpm_touch_ft5406.c')]
  26. src += [os.path.join(cwd, 'touch', 'ft5406', 'hpm_ft5406.c')]
  27. path += [os.path.join(cwd, 'touch', 'ft5406')]
  28. CPPDEFINES += ['CONFIG_TOUCH_FT5406=1']
  29. if GetDepend(['BSP_USING_USB_DEVICE']):
  30. src += [os.path.join(cwd, 'usb', 'device', 'hpm_usb_device.c')]
  31. path += [os.path.join(cwd, 'usb', 'device')]
  32. if GetDepend(['BSP_USING_USB_HOST']):
  33. CPPDEFINES += ['USB_HOST_MCU_CORE=HPM_CORE0']
  34. if GetDepend(['BSP_USING_ETH0']):
  35. if GetDepend(['BSP_USING_ENET_PHY_DP83867']):
  36. src += [os.path.join(cwd, 'enet_phy/dp83867/hpm_dp83867.c')]
  37. path += [os.path.join(cwd, 'enet_phy')]
  38. path += [os.path.join(cwd, 'enet_phy/dp83867')]
  39. CPPDEFINES += ['__USE_DP83867=1']
  40. if GetDepend(['BSP_USING_ETH1']):
  41. if GetDepend(['BSP_USING_ENET_PHY_DP83848']):
  42. src += [os.path.join(cwd, 'enet_phy/dp83848/hpm_dp83848.c')]
  43. path += [os.path.join(cwd, 'enet_phy')]
  44. path += [os.path.join(cwd, 'enet_phy/dp83848')]
  45. CPPDEFINES += ['__USE_DP83848=1']
  46. if GetDepend(['BSP_USING_ETH0']):
  47. if GetDepend(['BSP_USING_ENET_PHY_RTL8211']):
  48. src += [os.path.join(cwd, 'enet_phy/rtl8211/hpm_rtl8211.c')]
  49. path += [os.path.join(cwd, 'enet_phy')]
  50. path += [os.path.join(cwd, 'enet_phy/rtl8211')]
  51. CPPDEFINES += ['__USE_RTL8211=1']
  52. if GetDepend(['BSP_USING_ENET_PHY_RTL8201']):
  53. src += [os.path.join(cwd, 'enet_phy/rtl8201/hpm_rtl8201.c')]
  54. path += [os.path.join(cwd, 'enet_phy')]
  55. path += [os.path.join(cwd, 'enet_phy/rtl8201')]
  56. CPPDEFINES += ['__USE_RTL8201=1']
  57. if GetDepend(['BSP_USING_ETH1']):
  58. if GetDepend(['BSP_USING_ENET_PHY_RTL8201']):
  59. src += [os.path.join(cwd, 'enet_phy/rtl8201/hpm_rtl8201.c')]
  60. path += [os.path.join(cwd, 'enet_phy')]
  61. path += [os.path.join(cwd, 'enet_phy/rtl8201')]
  62. CPPDEFINES += ['__USE_RTL8201=1']
  63. if GetDepend(['BSP_USING_ENET_PHY_LAN8720']):
  64. src += [os.path.join(cwd, 'enet_phy/lan8720/hpm_lan8720.c')]
  65. path += [os.path.join(cwd, 'enet_phy')]
  66. path += [os.path.join(cwd, 'enet_phy/lan8720')]
  67. CPPDEFINES += ['__USE_LAN8720=1']
  68. if GetDepend(['BSP_USING_TSW']):
  69. if GetDepend(['BSP_USING_TSW_PHY_RTL8211']):
  70. src += [os.path.join(cwd, 'tsw_phy/rtl8211/hpm_rtl8211.c')]
  71. path += [os.path.join(cwd, 'tsw_phy')]
  72. path += [os.path.join(cwd, 'tsw_phy/rtl8211')]
  73. CPPDEFINES += ['__USE_RTL8211=1']
  74. if GetDepend(['BSP_USING_CAMERA']):
  75. path += [os.path.join(cwd, 'camera')]
  76. if GetDepend(['BSP_USING_CAMERA_MT9M114']):
  77. src += [os.path.join(cwd, 'camera', 'mt9m114', 'hpm_mt9m114.c')]
  78. src += [os.path.join(cwd, 'camera', 'mt9m114', 'hpm_camera_mt9m114.c')]
  79. path += [os.path.join(cwd, 'camera', 'mt9m114')]
  80. CPPDEFINES += ['CONFIG_CAMERA_MT9M114=1']
  81. if GetDepend(['BSP_USING_CAMERA_OV5640']):
  82. src += [os.path.join(cwd, 'camera', 'ov5640', 'hpm_camera_ov5640.c')]
  83. src += [os.path.join(cwd, 'camera', 'ov5640', 'hpm_ov5640.c')]
  84. path += [os.path.join(cwd, 'camera', 'ov5640')]
  85. CPPDEFINES += ['CONFIG_CAMERA_OV5640=1']
  86. if GetDepend(['BSP_USING_CAMERA_OV7725']):
  87. src += [os.path.join(cwd, 'camera', 'ov7725', 'hpm_camera_ov7725.c')]
  88. src += [os.path.join(cwd, 'camera', 'ov7725', 'hpm_ov7725.c')]
  89. path += [os.path.join(cwd, 'camera', 'ov7725')]
  90. CPPDEFINES += ['CONFIG_CAMERA_OV7725=1']
  91. if GetDepend(['BSP_USING_PANEL']):
  92. path += [os.path.join(cwd, 'panel')]
  93. src += [os.path.join(cwd, 'panel', 'hpm_panel.c')]
  94. CPPDEFINES += ['CONFIG_HPM_PANEL']
  95. if GetDepend(['BSP_USEING_PANEL_RGB_TM070RDH13']):
  96. src += [os.path.join(cwd, 'panel', 'panels', 'tm070rdh13.c')]
  97. path += [os.path.join(cwd, 'panel', 'panels')]
  98. CPPDEFINES += ['PANEL_SIZE_WIDTH=800']
  99. CPPDEFINES += ['PANEL_SIZE_HEIGHT=480']
  100. CPPDEFINES += ['CONFIG_PANEL_RGB_TM070RDH13=1']
  101. if GetDepend(['BSP_USEING_PANEL_MIPI_MC10128007_31B']):
  102. src += [os.path.join(cwd, 'panel', 'panels', 'mc10128007_31b.c')]
  103. path += [os.path.join(cwd, 'panel', 'panels')]
  104. CPPDEFINES += ['PANEL_SIZE_WIDTH=800']
  105. CPPDEFINES += ['PANEL_SIZE_HEIGHT=1280']
  106. CPPDEFINES += ['CONFIG_PANEL_MIPI_MC10128007_31B=1']
  107. if GetDepend(['BSP_USEING_PANEL_LVDS_TM103XDGP01']):
  108. src += [os.path.join(cwd, 'panel', 'panels', 'tm103xdgp01.c')]
  109. path += [os.path.join(cwd, 'panel', 'panels')]
  110. CPPDEFINES += ['PANEL_SIZE_WIDTH=1920']
  111. CPPDEFINES += ['PANEL_SIZE_HEIGHT=720']
  112. CPPDEFINES += ['CONFIG_PANEL_LVDS_TM103XDGP01=1']
  113. if GetDepend(['BSP_USEING_PANEL_LVDS_CC10128007']):
  114. src += [os.path.join(cwd, 'panel', 'panels', 'cc10128007.c')]
  115. path += [os.path.join(cwd, 'panel', 'panels')]
  116. CPPDEFINES += ['PANEL_SIZE_WIDTH=800']
  117. CPPDEFINES += ['PANEL_SIZE_HEIGHT=1280']
  118. CPPDEFINES += ['CONFIG_PANEL_LVDS_CC10128007=1']
  119. group = DefineGroup('Libraries', src, depend=[''], CPPPATH=path, CPPDEFINES=CPPDEFINES)
  120. Return('group')