CMakeLists.txt 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. idf_build_get_property(target IDF_TARGET)
  2. set(srcs "wdt_hal_iram.c"
  3. "mpu_hal.c"
  4. "cpu_hal.c")
  5. set(includes "${target}/include" "include" "platform_port/include")
  6. if(NOT BOOTLOADER_BUILD)
  7. list(APPEND srcs
  8. "rmt_hal.c"
  9. "rtc_io_hal.c"
  10. "spi_hal.c"
  11. "spi_hal_iram.c"
  12. "spi_slave_hal.c"
  13. "spi_slave_hal_iram.c"
  14. "i2s_hal.c"
  15. "sigmadelta_hal.c"
  16. "timer_hal.c"
  17. "ledc_hal.c"
  18. "ledc_hal_iram.c"
  19. "i2c_hal.c"
  20. "i2c_hal_iram.c"
  21. "gpio_hal.c"
  22. "uart_hal.c"
  23. "uart_hal_iram.c"
  24. "spi_flash_hal.c"
  25. "spi_flash_hal_iram.c"
  26. "spi_flash_encrypt_hal_iram.c"
  27. "soc_hal.c"
  28. "interrupt_controller_hal.c"
  29. "sha_hal.c"
  30. "aes_hal.c"
  31. "twai_hal.c"
  32. "twai_hal_iram.c"
  33. "adc_hal.c")
  34. if(${target} STREQUAL "esp32")
  35. list(APPEND srcs
  36. "dac_hal.c"
  37. "mcpwm_hal.c"
  38. "pcnt_hal.c"
  39. "sdio_slave_hal.c"
  40. "touch_sensor_hal.c"
  41. "esp32/adc_hal.c"
  42. "esp32/brownout_hal.c"
  43. "esp32/interrupt_descriptor_table.c"
  44. "esp32/touch_sensor_hal.c"
  45. "esp32/gpio_hal_workaround.c")
  46. if(NOT BOOTLOADER_BUILD AND CONFIG_ETH_USE_ESP32_EMAC)
  47. list(APPEND srcs "emac_hal.c")
  48. endif()
  49. endif()
  50. if(${target} STREQUAL "esp32s2")
  51. list(APPEND srcs
  52. "dac_hal.c"
  53. "pcnt_hal.c"
  54. "spi_flash_hal_gpspi.c"
  55. "spi_slave_hd_hal.c"
  56. "systimer_hal.c"
  57. "touch_sensor_hal.c"
  58. "usb_hal.c"
  59. "usb_phy_hal.c"
  60. "xt_wdt_hal.c"
  61. "esp32s2/adc_hal.c"
  62. "esp32s2/brownout_hal.c"
  63. "esp32s2/cp_dma_hal.c"
  64. "esp32s2/touch_sensor_hal.c"
  65. "esp32s2/dac_hal.c"
  66. "esp32s2/interrupt_descriptor_table.c"
  67. "usbh_hal.c")
  68. endif()
  69. if(${target} STREQUAL "esp32s3")
  70. list(APPEND srcs
  71. "ds_hal.c"
  72. "gdma_hal.c"
  73. "lcd_hal.c"
  74. "mcpwm_hal.c"
  75. "pcnt_hal.c"
  76. "spi_flash_hal_gpspi.c"
  77. "spi_slave_hd_hal.c"
  78. "systimer_hal.c"
  79. "touch_sensor_hal.c"
  80. "usb_hal.c"
  81. "usb_phy_hal.c"
  82. "xt_wdt_hal.c"
  83. "esp32s3/brownout_hal.c"
  84. "esp32s3/hmac_hal.c"
  85. "esp32s3/interrupt_descriptor_table.c"
  86. "esp32s3/touch_sensor_hal.c"
  87. "esp32s3/rtc_cntl_hal.c"
  88. "usbh_hal.c")
  89. endif()
  90. if(${target} STREQUAL "esp32c3")
  91. list(APPEND srcs
  92. "ds_hal.c"
  93. "gdma_hal.c"
  94. "spi_flash_hal_gpspi.c"
  95. "spi_slave_hd_hal.c"
  96. "systimer_hal.c"
  97. "xt_wdt_hal.c"
  98. "esp32c3/adc_hal.c"
  99. "esp32c3/brownout_hal.c"
  100. "esp32c3/hmac_hal.c"
  101. "esp32c3/rtc_cntl_hal.c")
  102. endif()
  103. if(${target} STREQUAL "esp32h2")
  104. list(APPEND srcs
  105. "ds_hal.c"
  106. "gdma_hal.c"
  107. "spi_flash_hal_gpspi.c"
  108. "spi_slave_hd_hal.c"
  109. "systimer_hal.c"
  110. "esp32h2/adc_hal.c"
  111. "esp32h2/brownout_hal.c"
  112. "esp32h2/hmac_hal.c"
  113. "esp32h2/rtc_cntl_hal.c")
  114. endif()
  115. endif()
  116. idf_component_register(SRCS ${srcs}
  117. INCLUDE_DIRS ${includes}
  118. PRIV_INCLUDE_DIRS ${priv_include}
  119. REQUIRES soc
  120. PRIV_REQUIRES ${target}
  121. LDFRAGMENTS linker.lf)
  122. if(CONFIG_HAL_DEFAULT_ASSERTION_LEVEL EQUAL 1)
  123. target_link_libraries(${COMPONENT_LIB} INTERFACE "-u abort")
  124. elseif(CONFIG_HAL_DEFAULT_ASSERTION_LEVEL EQUAL 2)
  125. target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __assert_func")
  126. endif()