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