2022-09-06 12:48:16 +08:00
|
|
|
Import('rtconfig')
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
#get current directory
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
# Update include path
|
2024-08-12 16:48:39 +08:00
|
|
|
path = [ cwd + '/arch', cwd + "/drivers/inc", cwd + '/soc/' + rtconfig.SOC_FAMILY + '/' + '/ip']
|
2022-09-06 12:48:16 +08:00
|
|
|
|
|
|
|
# The set of source files associated with this SConscript file.
|
|
|
|
src = []
|
|
|
|
|
2024-05-31 19:46:47 +08:00
|
|
|
CPPDEFINES=[]
|
|
|
|
|
2022-09-06 12:48:16 +08:00
|
|
|
src += ['drivers/src/hpm_pmp_drv.c']
|
2023-08-15 18:41:20 +08:00
|
|
|
src += ['drivers/src/hpm_pcfg_drv.c']
|
2022-09-06 12:48:16 +08:00
|
|
|
|
2024-08-12 16:48:39 +08:00
|
|
|
if rtconfig.SOC_FAMILY == "HPM6700":
|
|
|
|
src += ['drivers/src/hpm_pllctl_drv.c']
|
|
|
|
else:
|
|
|
|
src += ['drivers/src/hpm_pllctlv2_drv.c']
|
|
|
|
|
|
|
|
if rtconfig.SOC_FAMILY == "HPM6700" or rtconfig.SOC_FAMILY == "HPM6300" or rtconfig.SOC_FAMILY == "HPM6200":
|
2024-05-31 19:46:47 +08:00
|
|
|
src += ['drivers/src/hpm_dma_drv.c']
|
|
|
|
else:
|
|
|
|
src += ['drivers/src/hpm_dmav2_drv.c']
|
|
|
|
CPPDEFINES = ['HPMSOC_HAS_HPMSDK_DMAV2']
|
2022-09-06 12:48:16 +08:00
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_GPIO']):
|
|
|
|
src += ['drivers/src/hpm_gpio_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_UART']):
|
|
|
|
src += ['drivers/src/hpm_uart_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_I2C']):
|
|
|
|
src += ['drivers/src/hpm_i2c_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_SPI']):
|
|
|
|
src += ['drivers/src/hpm_spi_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_RTC']):
|
|
|
|
src += ['drivers/src/hpm_rtc_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_WDG']):
|
|
|
|
src += ['drivers/src/hpm_wdg_drv.c']
|
|
|
|
|
2024-05-31 19:46:47 +08:00
|
|
|
if GetDepend(['BSP_USING_EWDG']):
|
|
|
|
src += ['drivers/src/hpm_ewdg_drv.c']
|
|
|
|
|
2022-09-06 12:48:16 +08:00
|
|
|
if GetDepend(['BSP_USING_ADC']):
|
2023-01-09 10:14:23 +08:00
|
|
|
if GetDepend(['BSP_USING_ADC12']):
|
2023-08-15 18:41:20 +08:00
|
|
|
src += ['drivers/src/hpm_adc12_drv.c']
|
2023-01-09 10:14:23 +08:00
|
|
|
if GetDepend(['BSP_USING_ADC16']):
|
2023-08-15 18:41:20 +08:00
|
|
|
src += ['drivers/src/hpm_adc16_drv.c']
|
2022-09-06 12:48:16 +08:00
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_CAN']):
|
|
|
|
src += ['drivers/src/hpm_can_drv.c']
|
|
|
|
|
2023-08-15 18:41:20 +08:00
|
|
|
if GetDepend(['BSP_USING_MCAN']):
|
|
|
|
src += ['drivers/src/hpm_mcan_drv.c']
|
|
|
|
|
2022-09-06 12:48:16 +08:00
|
|
|
if GetDepend(['BSP_USING_ETH']):
|
|
|
|
src += ['drivers/src/hpm_enet_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_DMA']):
|
|
|
|
src += ['drivers/src/hpm_dma_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_SDXC']):
|
|
|
|
src += ['drivers/src/hpm_sdxc_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_LCD']):
|
|
|
|
src += ['drivers/src/hpm_lcdc_drv.c']
|
|
|
|
|
2024-05-31 19:46:47 +08:00
|
|
|
if GetDepend(['BSP_USING_GPTMR']) or GetDepend('HPM_USING_VECTOR_PREEMPTED_MODE'):
|
2022-09-06 12:48:16 +08:00
|
|
|
src += ['drivers/src/hpm_gptmr_drv.c']
|
|
|
|
|
2023-08-15 18:41:20 +08:00
|
|
|
if GetDepend(['BSP_USING_FEMC']):
|
|
|
|
src += ['drivers/src/hpm_femc_drv.c']
|
2022-09-06 12:48:16 +08:00
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_PWM']):
|
|
|
|
src += ['drivers/src/hpm_pwm_drv.c']
|
|
|
|
|
2024-08-12 16:48:39 +08:00
|
|
|
if GetDepend(['BSP_USING_PWMV2']):
|
|
|
|
src += ['drivers/src/hpm_pwmv2_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_USB']):
|
2022-09-06 12:48:16 +08:00
|
|
|
src += ['drivers/src/hpm_usb_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_I2S']):
|
|
|
|
src += ['drivers/src/hpm_i2s_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_PDM']):
|
|
|
|
src += ['drivers/src/hpm_pdm_drv.c']
|
|
|
|
src += ['drivers/src/hpm_i2s_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_DAO']):
|
|
|
|
src += ['drivers/src/hpm_dao_drv.c']
|
|
|
|
src += ['drivers/src/hpm_i2s_drv.c']
|
|
|
|
|
2023-08-15 18:41:20 +08:00
|
|
|
if GetDepend(['BSP_USING_PDMA']):
|
|
|
|
src += ['drivers/src/hpm_pdma_drv.c']
|
|
|
|
|
2024-05-31 19:46:47 +08:00
|
|
|
if GetDepend(['BSP_USING_JPEG']):
|
|
|
|
src += ['drivers/src/hpm_jpeg_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_CAM']):
|
|
|
|
src += ['drivers/src/hpm_cam_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_PIXELMUX']):
|
|
|
|
src += ['drivers/src/hpm_pixelmux_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_MIPI_CSI']):
|
|
|
|
src += ['drivers/src/hpm_mipi_csi_drv.c']
|
|
|
|
src += ['drivers/src/hpm_mipi_csi_phy_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_MIPI_DSI']):
|
|
|
|
src += ['drivers/src/hpm_mipi_dsi_drv.c']
|
|
|
|
src += ['drivers/src/hpm_mipi_dsi_phy_drv.c']
|
2024-08-12 16:48:39 +08:00
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_LVB']):
|
|
|
|
src += ['drivers/src/hpm_lvb_drv.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_LCB']):
|
|
|
|
src += ['drivers/src/hpm_lcb_drv.c']
|
|
|
|
|
2024-05-31 19:46:47 +08:00
|
|
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES=CPPDEFINES)
|
2022-09-06 12:48:16 +08:00
|
|
|
|
|
|
|
Return ('group')
|