blob: 83043e634807f71041a178cc67cb8bf7a7599ddc [file] [log] [blame]
# Copyright 2021 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
import("//build_overrides/pigweed.gni")
import("$dir_pw_build/target_types.gni")
declare_args() {
# Product (ex. "STM32F429xx")
pw_third_party_stm32cubef4_product = ""
# External clock frequency (ex. "8000000" for 8Mhz)
pw_third_party_stm32cubef4_hse_hz = ""
}
config("flags") {
cflags = [
"-DUSE_HAL_DRIVER",
"-D" + pw_third_party_stm32cubef4_product,
"-DHSE_VALUE=((uint32_t)" + pw_third_party_stm32cubef4_hse_hz + "U)",
"-Wno-redundant-decls",
"-Wno-unused-parameter",
]
visibility = [ ":*" ]
}
config("public_include_paths") {
include_dirs = [
#TODO: Allow target to define their own `stm32f4xx_hal_conf.h`
".",
"cmsis_device_f4/Include",
"cmsis_core_cm4/Include",
"stm32f4xx_hal_driver/Inc",
"stm32f4xx_hal_driver/Inc/Legacy",
]
visibility = [ ":*" ]
}
pw_source_set("stm32f4xx_hal") {
public_configs = [
":flags",
":public_include_paths",
]
public = [ "cmsis_device_f4/Include/stm32f4xx.h" ]
sources = [
#TODO: Allow target to not use these templates if desired.
"cmsis_device_f4/Source/Templates/system_stm32f4xx.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_msp_template.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_timebase_tim_template.c",
]
sources += [
"stm32f4xx_hal_driver/Src/Legacy/stm32f4xx_hal_can.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_adc.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_adc_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_can.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_cec.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_cortex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_crc.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_cryp.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_cryp_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_dac.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_dac_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_dcmi.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_dcmi_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_dfsdm.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_dma.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_dma2d.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_dma_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_dsi.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_eth.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_exti.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_flash.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_flash_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_flash_ramfunc.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_fmpi2c.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_fmpi2c_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_fmpsmbus.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_fmpsmbus_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_gpio.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_hash.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_hash_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_hcd.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_i2c.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_i2c_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_i2s.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_i2s_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_irda.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_iwdg.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_lptim.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_ltdc.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_ltdc_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_mmc.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_nand.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_nor.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_pccard.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_pcd.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_pcd_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_pwr.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_pwr_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_qspi.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_rcc.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_rcc_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_rng.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_rtc.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_rtc_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_sai.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_sai_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_sd.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_sdram.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_smartcard.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_smbus.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_spdifrx.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_spi.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_sram.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_tim.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_tim_ex.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_uart.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_usart.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_hal_wwdg.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_adc.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_crc.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_dac.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_dma.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_dma2d.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_exti.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_fmc.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_fmpi2c.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_fsmc.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_gpio.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_i2c.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_lptim.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_pwr.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_rcc.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_rng.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_rtc.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_sdmmc.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_spi.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_tim.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_usart.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_usb.c",
"stm32f4xx_hal_driver/Src/stm32f4xx_ll_utils.c",
]
}