2020-08-08 20:15:27 +08:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
2021-08-24 21:23:45 +05:30
|
|
|
set(srcs "wdt_hal_iram.c"
|
|
|
|
"mpu_hal.c"
|
|
|
|
"cpu_hal.c")
|
2021-02-07 15:03:51 +08:00
|
|
|
|
2021-05-19 10:53:21 +08:00
|
|
|
set(includes "${target}/include" "include" "platform_port/include")
|
2020-08-08 20:15:27 +08:00
|
|
|
|
|
|
|
if(NOT BOOTLOADER_BUILD)
|
|
|
|
list(APPEND srcs
|
2021-08-24 21:23:45 +05:30
|
|
|
"rtc_io_hal.c"
|
|
|
|
"spi_hal.c"
|
|
|
|
"spi_hal_iram.c"
|
|
|
|
"spi_slave_hal.c"
|
|
|
|
"spi_slave_hal_iram.c"
|
|
|
|
"timer_hal.c"
|
2022-01-02 16:14:17 +08:00
|
|
|
"timer_hal_iram.c"
|
2021-08-24 21:23:45 +05:30
|
|
|
"ledc_hal.c"
|
|
|
|
"ledc_hal_iram.c"
|
|
|
|
"i2c_hal.c"
|
|
|
|
"i2c_hal_iram.c"
|
|
|
|
"gpio_hal.c"
|
|
|
|
"uart_hal.c"
|
|
|
|
"uart_hal_iram.c"
|
|
|
|
"spi_flash_hal.c"
|
|
|
|
"spi_flash_hal_iram.c"
|
|
|
|
"spi_flash_encrypt_hal_iram.c"
|
|
|
|
"soc_hal.c"
|
|
|
|
"interrupt_controller_hal.c"
|
|
|
|
"sha_hal.c"
|
|
|
|
"adc_hal.c")
|
2020-08-08 20:15:27 +08:00
|
|
|
|
|
|
|
if(${target} STREQUAL "esp32")
|
|
|
|
list(APPEND srcs
|
2021-08-24 21:23:45 +05:30
|
|
|
"dac_hal.c"
|
2021-11-06 17:24:45 +08:00
|
|
|
"rmt_hal.c"
|
|
|
|
"sigmadelta_hal.c"
|
2021-08-24 21:23:45 +05:30
|
|
|
"mcpwm_hal.c"
|
|
|
|
"pcnt_hal.c"
|
|
|
|
"sdio_slave_hal.c"
|
|
|
|
"touch_sensor_hal.c"
|
2021-11-06 17:24:45 +08:00
|
|
|
"i2s_hal.c"
|
|
|
|
"twai_hal.c"
|
|
|
|
"twai_hal_iram.c"
|
|
|
|
"aes_hal.c"
|
2021-08-24 21:23:45 +05:30
|
|
|
"esp32/adc_hal.c"
|
|
|
|
"esp32/brownout_hal.c"
|
|
|
|
"esp32/interrupt_descriptor_table.c"
|
|
|
|
"esp32/touch_sensor_hal.c"
|
|
|
|
"esp32/gpio_hal_workaround.c")
|
2020-08-08 20:15:27 +08:00
|
|
|
if(NOT BOOTLOADER_BUILD AND CONFIG_ETH_USE_ESP32_EMAC)
|
2021-05-07 17:38:36 +08:00
|
|
|
list(APPEND srcs "emac_hal.c")
|
2020-08-08 20:15:27 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${target} STREQUAL "esp32s2")
|
|
|
|
list(APPEND srcs
|
2020-11-26 16:06:21 +11:00
|
|
|
"dac_hal.c"
|
2021-11-06 17:24:45 +08:00
|
|
|
"rmt_hal.c"
|
|
|
|
"sigmadelta_hal.c"
|
2020-11-26 16:06:21 +11:00
|
|
|
"pcnt_hal.c"
|
2020-08-08 20:15:27 +08:00
|
|
|
"spi_flash_hal_gpspi.c"
|
|
|
|
"spi_slave_hd_hal.c"
|
2021-04-02 12:41:21 +08:00
|
|
|
"systimer_hal.c"
|
2020-11-26 16:06:21 +11:00
|
|
|
"touch_sensor_hal.c"
|
2021-05-06 16:20:54 +08:00
|
|
|
"usb_hal.c"
|
2021-08-19 20:28:28 +08:00
|
|
|
"usb_phy_hal.c"
|
2021-08-30 11:30:12 +08:00
|
|
|
"xt_wdt_hal.c"
|
2021-11-06 17:24:45 +08:00
|
|
|
"i2s_hal.c"
|
|
|
|
"twai_hal.c"
|
|
|
|
"twai_hal_iram.c"
|
|
|
|
"aes_hal.c"
|
2020-08-08 20:15:27 +08:00
|
|
|
"esp32s2/brownout_hal.c"
|
|
|
|
"esp32s2/cp_dma_hal.c"
|
|
|
|
"esp32s2/touch_sensor_hal.c"
|
2020-09-17 19:59:37 +08:00
|
|
|
"esp32s2/dac_hal.c"
|
2020-12-25 10:44:22 -03:00
|
|
|
"esp32s2/interrupt_descriptor_table.c"
|
2021-06-02 17:57:50 +08:00
|
|
|
"usbh_hal.c")
|
2020-08-08 20:15:27 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${target} STREQUAL "esp32s3")
|
|
|
|
list(APPEND srcs
|
2021-08-24 21:23:45 +05:30
|
|
|
"ds_hal.c"
|
2021-11-06 17:24:45 +08:00
|
|
|
"rmt_hal.c"
|
|
|
|
"sigmadelta_hal.c"
|
2020-12-09 20:29:26 +08:00
|
|
|
"gdma_hal.c"
|
2021-02-26 13:58:04 +08:00
|
|
|
"lcd_hal.c"
|
2021-01-07 17:36:54 +08:00
|
|
|
"mcpwm_hal.c"
|
2020-11-26 16:06:21 +11:00
|
|
|
"pcnt_hal.c"
|
2020-08-18 17:11:46 +08:00
|
|
|
"spi_flash_hal_gpspi.c"
|
2020-09-08 17:05:49 +08:00
|
|
|
"spi_slave_hd_hal.c"
|
2021-04-02 12:41:21 +08:00
|
|
|
"systimer_hal.c"
|
2020-11-26 16:06:21 +11:00
|
|
|
"touch_sensor_hal.c"
|
2021-05-06 16:20:54 +08:00
|
|
|
"usb_hal.c"
|
2021-08-19 20:28:28 +08:00
|
|
|
"usb_phy_hal.c"
|
2021-08-30 11:30:12 +08:00
|
|
|
"xt_wdt_hal.c"
|
2021-11-06 17:24:45 +08:00
|
|
|
"i2s_hal.c"
|
|
|
|
"twai_hal.c"
|
|
|
|
"twai_hal_iram.c"
|
|
|
|
"aes_hal.c"
|
2020-08-08 20:15:27 +08:00
|
|
|
"esp32s3/brownout_hal.c"
|
2021-08-02 14:31:43 +08:00
|
|
|
"esp32s3/hmac_hal.c"
|
2020-12-25 10:44:22 -03:00
|
|
|
"esp32s3/interrupt_descriptor_table.c"
|
2021-06-02 17:57:50 +08:00
|
|
|
"esp32s3/touch_sensor_hal.c"
|
2021-06-18 17:25:04 +08:00
|
|
|
"esp32s3/rtc_cntl_hal.c"
|
2021-06-02 17:57:50 +08:00
|
|
|
"usbh_hal.c")
|
2020-08-08 20:15:27 +08:00
|
|
|
endif()
|
2020-11-26 16:06:21 +11:00
|
|
|
|
|
|
|
if(${target} STREQUAL "esp32c3")
|
|
|
|
list(APPEND srcs
|
2020-09-30 17:27:33 +08:00
|
|
|
"ds_hal.c"
|
2020-12-09 20:29:26 +08:00
|
|
|
"gdma_hal.c"
|
2021-11-06 17:24:45 +08:00
|
|
|
"rmt_hal.c"
|
|
|
|
"sigmadelta_hal.c"
|
2021-04-02 12:41:21 +08:00
|
|
|
"spi_flash_hal_gpspi.c"
|
|
|
|
"spi_slave_hd_hal.c"
|
|
|
|
"systimer_hal.c"
|
2021-08-30 11:30:12 +08:00
|
|
|
"xt_wdt_hal.c"
|
2021-11-06 17:24:45 +08:00
|
|
|
"i2s_hal.c"
|
|
|
|
"twai_hal.c"
|
|
|
|
"twai_hal_iram.c"
|
|
|
|
"aes_hal.c"
|
2020-11-26 16:06:21 +11:00
|
|
|
"esp32c3/adc_hal.c"
|
|
|
|
"esp32c3/brownout_hal.c"
|
|
|
|
"esp32c3/hmac_hal.c"
|
2020-12-24 21:02:32 +08:00
|
|
|
"esp32c3/rtc_cntl_hal.c")
|
2020-11-26 16:06:21 +11:00
|
|
|
endif()
|
2021-06-10 10:28:23 +08:00
|
|
|
|
|
|
|
if(${target} STREQUAL "esp32h2")
|
|
|
|
list(APPEND srcs
|
2021-08-24 21:23:45 +05:30
|
|
|
"ds_hal.c"
|
|
|
|
"gdma_hal.c"
|
2021-11-06 17:24:45 +08:00
|
|
|
"rmt_hal.c"
|
|
|
|
"sigmadelta_hal.c"
|
2021-08-24 21:23:45 +05:30
|
|
|
"spi_flash_hal_gpspi.c"
|
|
|
|
"spi_slave_hd_hal.c"
|
|
|
|
"systimer_hal.c"
|
2021-11-06 17:24:45 +08:00
|
|
|
"i2s_hal.c"
|
|
|
|
"twai_hal.c"
|
|
|
|
"twai_hal_iram.c"
|
|
|
|
"aes_hal.c"
|
2021-08-24 21:23:45 +05:30
|
|
|
"esp32h2/brownout_hal.c"
|
|
|
|
"esp32h2/hmac_hal.c"
|
|
|
|
"esp32h2/rtc_cntl_hal.c")
|
2021-06-10 10:28:23 +08:00
|
|
|
endif()
|
2021-11-06 17:24:45 +08:00
|
|
|
|
2022-01-18 10:32:56 +08:00
|
|
|
if(${target} STREQUAL "esp32c2")
|
2021-11-06 17:24:45 +08:00
|
|
|
list(APPEND srcs
|
|
|
|
"gdma_hal.c"
|
|
|
|
"spi_flash_hal_gpspi.c"
|
|
|
|
"spi_slave_hd_hal.c"
|
|
|
|
"systimer_hal.c"
|
2022-01-18 10:32:56 +08:00
|
|
|
"esp32c2/brownout_hal.c"
|
|
|
|
"esp32c2/rtc_cntl_hal.c")
|
2021-11-06 17:24:45 +08:00
|
|
|
endif()
|
2020-08-08 20:15:27 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
idf_component_register(SRCS ${srcs}
|
|
|
|
INCLUDE_DIRS ${includes}
|
|
|
|
PRIV_INCLUDE_DIRS ${priv_include}
|
|
|
|
REQUIRES soc
|
2021-03-19 20:03:13 +08:00
|
|
|
PRIV_REQUIRES ${target}
|
2020-08-08 20:15:27 +08:00
|
|
|
LDFRAGMENTS linker.lf)
|
2021-05-19 10:53:21 +08:00
|
|
|
|
|
|
|
if(CONFIG_HAL_DEFAULT_ASSERTION_LEVEL EQUAL 1)
|
|
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u abort")
|
|
|
|
elseif(CONFIG_HAL_DEFAULT_ASSERTION_LEVEL EQUAL 2)
|
|
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __assert_func")
|
|
|
|
endif()
|