2022-12-02 01:54:27 -05:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
|
|
|
# On Linux the soc component is a simple wrapper, without much functionality
|
|
|
|
if(NOT ${target} STREQUAL "linux")
|
2023-01-19 04:35:52 -05:00
|
|
|
set(srcs "lldesc.c"
|
|
|
|
"dport_access_common.c"
|
|
|
|
"${target}/interrupts.c"
|
|
|
|
"${target}/gpio_periph.c"
|
|
|
|
"${target}/uart_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(includes "include" "${target}")
|
|
|
|
|
|
|
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${target}/include")
|
|
|
|
list(APPEND includes "${target}/include")
|
|
|
|
if(target STREQUAL "esp32h4")
|
|
|
|
if(CONFIG_IDF_TARGET_ESP32H4_BETA_VERSION_1)
|
|
|
|
list(APPEND includes "${target}/include/rev1")
|
|
|
|
elseif(CONFIG_IDF_TARGET_ESP32H4_BETA_VERSION_2)
|
|
|
|
list(APPEND includes "${target}/include/rev2")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(target STREQUAL "esp32")
|
|
|
|
list(APPEND srcs "${target}/dport_access.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_ADC_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/adc_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_DEDICATED_GPIO_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/dedic_gpio_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_GDMA_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/gdma_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_GPSPI_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/spi_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_LEDC_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/ledc_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_PCNT_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/pcnt_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_RMT_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/rmt_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_SDM_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/sdm_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_I2S_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/i2s_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_I2C_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/i2c_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_TEMP_SENSOR_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/temperature_sensor_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_GPTIMER_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/timer_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_LCDCAM_SUPPORTED OR CONFIG_SOC_LCD_I80_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/lcd_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_MCPWM_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/mcpwm_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_SDMMC_HOST_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/sdmmc_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_TOUCH_SENSOR_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/touch_sensor_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_TWAI_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/twai_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_USB_OTG_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/usb_periph.c"
|
|
|
|
"${target}/usb_otg_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_DAC_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/dac_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_RTCIO_PIN_COUNT GREATER 0)
|
|
|
|
list(APPEND srcs "${target}/rtc_io_periph.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_SDIO_SLAVE_SUPPORTED)
|
|
|
|
list(APPEND srcs "${target}/sdio_slave_periph.c")
|
2022-12-02 01:54:27 -05:00
|
|
|
endif()
|
|
|
|
|
|
|
|
idf_component_register(SRCS ${srcs}
|
2023-01-19 04:35:52 -05:00
|
|
|
INCLUDE_DIRS ${includes}
|
2021-03-10 06:33:24 -05:00
|
|
|
LDFRAGMENTS "linker.lf")
|
2018-03-22 02:27:10 -04:00
|
|
|
|
2023-01-19 04:35:52 -05:00
|
|
|
if(target STREQUAL "esp32")
|
|
|
|
# esp_dport_access_reg_read is added as an undefined symbol because otherwise
|
|
|
|
# the linker can ignore dport_access.c as it would no other files depending on any symbols in it.
|
|
|
|
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u esp_dport_access_reg_read")
|
|
|
|
endif()
|
2021-07-21 09:09:45 -04:00
|
|
|
|
2022-12-02 01:54:27 -05:00
|
|
|
if(NOT CONFIG_IDF_TARGET_LINUX)
|
|
|
|
target_linker_script(${COMPONENT_LIB} INTERFACE "${target}/ld/${target}.peripherals.ld")
|
|
|
|
endif()
|