package platform.stm32.f7.nucleo_f767zi

@Build(stage=1)
@BuildArtifactPath(cppflags="-DSTM32F767xx -DUSE_STM32F7XX_NUCLEO_144")
static module nucleo_f767zi_conf extends third_party.bsp.stmf7cube.stm32f7_conf {
	@IncludeExport(path="", target_name="stm32f7xx_hal_conf.h")
	source "stm32f7xx_hal_conf_1.17.1.h"
}

@Build(stage=1)
@BuildDepends(nucleo_f767zi_conf)
@BuildDepends(third_party.bsp.stmf7cube.cube)
@BuildArtifactPath(cppflags="$(addprefix -I$(EXTERNAL_BUILD_DIR)/third_party/bsp/stmf7cube/cube/STM32CubeF7-1.17.1/,Drivers/BSP/STM32F7xx_Nucleo_144)")
static module bsp extends third_party.bsp.st_bsp_api {
	source "clock_config.c"

	@AddPrefix("^BUILD/extbld/third_party/bsp/stmf7cube/cube")
	source "./STM32CubeF7-1.17.1/Projects/STM32F767ZI-Nucleo/Templates/Src/system_stm32f7xx.c"

	/* Cubse LCD call SDRAM_Init, we don't wont that, so tell Cube's LCD do not init SDRAM */
	@DefineMacro("DATA_IN_ExtSDRAM")
	@AddPrefix("^BUILD/extbld/third_party/bsp/stmf7cube/cube/STM32CubeF7-1.17.1/Drivers/BSP/STM32F7xx_Nucleo_144")
	source "stm32f7xx_nucleo_144.c"

	@NoRuntime depends third_party.bsp.stmf7cube.cube
	@NoRuntime depends nucleo_f767zi_conf
	@NoRuntime depends platform.stm32.stm32cube_compat
}
