CMakeLists.txt 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. idf_build_get_property(target IDF_TARGET)
  2. set(srcs
  3. "gpio.c"
  4. "i2c.c"
  5. "i2s.c"
  6. "ledc.c"
  7. "pcnt.c"
  8. "periph_ctrl.c"
  9. "rmt.c"
  10. "rtc_io.c"
  11. "rtc_module.c"
  12. "sdspi_crc.c"
  13. "sdspi_host.c"
  14. "sdspi_transaction.c"
  15. "sigmadelta.c"
  16. "spi_common.c"
  17. "spi_master.c"
  18. "spi_slave.c"
  19. "spi_bus_lock.c"
  20. "timer.c"
  21. "twai.c"
  22. "uart.c")
  23. set(includes "include" "${target}/include")
  24. if(${target} STREQUAL "esp32")
  25. # SDMMC and MCPWM are in ESP32 only.
  26. list(APPEND srcs "adc_common.c"
  27. "dac_common.c"
  28. "mcpwm.c"
  29. "sdio_slave.c"
  30. "sdmmc_host.c"
  31. "sdmmc_transaction.c"
  32. "touch_sensor_common.c"
  33. "esp32/touch_sensor.c"
  34. "esp32/adc.c"
  35. "esp32/dac.c")
  36. list(APPEND includes "esp32/include")
  37. endif()
  38. if(IDF_TARGET STREQUAL "esp32s2")
  39. list(APPEND srcs "adc_common.c"
  40. "dac_common.c"
  41. "dedic_gpio.c"
  42. "spi_slave_hd.c"
  43. "touch_sensor_common.c"
  44. "esp32s2/rtc_tempsensor.c"
  45. "esp32s2/touch_sensor.c"
  46. "esp32s2/adc.c"
  47. "esp32s2/adc2_init_cal.c"
  48. "esp32s2/dac.c")
  49. list(APPEND includes "esp32s2/include")
  50. endif()
  51. if(${target} STREQUAL "esp32s3")
  52. list(APPEND srcs "adc_common.c"
  53. "dac_common.c"
  54. "dedic_gpio.c"
  55. "gdma.c"
  56. "spi_slave_hd.c"
  57. "touch_sensor_common.c"
  58. )
  59. endif()
  60. if(IDF_TARGET STREQUAL "esp32c3")
  61. list(APPEND srcs "gdma.c"
  62. "spi_slave_hd.c"
  63. "adc_common.c"
  64. "esp32c3/adc.c"
  65. "esp32c3/adc2_init_cal.c"
  66. "esp32c3/rtc_tempsensor.c")
  67. endif()
  68. idf_component_register(SRCS "${srcs}"
  69. INCLUDE_DIRS ${includes}
  70. PRIV_INCLUDE_DIRS "include/driver"
  71. PRIV_REQUIRES efuse esp_pm esp_timer esp_ipc
  72. REQUIRES esp_ringbuf freertos soc hal esp_hw_support
  73. LDFRAGMENTS linker.lf)
  74. # (REQUIRES cannot hide soc headers, since many arguments in the driver headers are chip-dependent)
  75. # uses C11 atomic feature
  76. set_source_files_properties(spi_master.c PROPERTIES COMPILE_FLAGS -std=gnu11)