CMakeLists.txt 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. "adc.c"
  35. "esp32/adc.c"
  36. "adc_deprecated.c"
  37. "esp32/dac.c")
  38. endif()
  39. if(IDF_TARGET STREQUAL "esp32s2")
  40. list(APPEND srcs "adc_common.c"
  41. "dac_common.c"
  42. "dedic_gpio.c"
  43. "spi_slave_hd.c"
  44. "touch_sensor_common.c"
  45. "esp32s2/rtc_tempsensor.c"
  46. "esp32s2/touch_sensor.c"
  47. "esp32s2/adc.c"
  48. "adc.c"
  49. "adc_deprecated.c"
  50. "esp32s2/adc2_init_cal.c"
  51. "esp32s2/dac.c")
  52. endif()
  53. if(${target} STREQUAL "esp32s3")
  54. list(APPEND srcs "adc_common.c"
  55. "adc.c"
  56. "dedic_gpio.c"
  57. "gdma.c"
  58. "sdmmc_host.c"
  59. "sdmmc_transaction.c"
  60. "mcpwm.c"
  61. "usb_serial_jtag.c"
  62. "spi_slave_hd.c"
  63. "touch_sensor_common.c"
  64. "esp32s3/touch_sensor.c"
  65. )
  66. endif()
  67. if(IDF_TARGET STREQUAL "esp32c3")
  68. list(APPEND srcs "gdma.c"
  69. "spi_slave_hd.c"
  70. "adc_common.c"
  71. "dedic_gpio.c"
  72. "usb_serial_jtag.c"
  73. "adc.c"
  74. "esp32c3/adc2_init_cal.c"
  75. "esp32c3/rtc_tempsensor.c")
  76. endif()
  77. if(IDF_TARGET STREQUAL "esp32h2")
  78. list(APPEND srcs "gdma.c"
  79. "spi_slave_hd.c"
  80. "adc_common.c"
  81. "dedic_gpio.c"
  82. "adc.c"
  83. "esp32h2/rtc_tempsensor.c")
  84. endif()
  85. idf_component_register(SRCS "${srcs}"
  86. INCLUDE_DIRS ${includes}
  87. PRIV_INCLUDE_DIRS "include/driver"
  88. PRIV_REQUIRES efuse esp_timer esp_ipc
  89. REQUIRES esp_pm esp_ringbuf freertos soc hal esp_hw_support
  90. LDFRAGMENTS linker.lf)
  91. # (REQUIRES cannot hide soc headers, since many arguments in the driver headers are chip-dependent)
  92. # uses C11 atomic feature
  93. set_source_files_properties(spi_master.c PROPERTIES COMPILE_FLAGS -std=gnu11)