CMakeLists.txt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. set(srcs
  2. "adc_common.c"
  3. "dac_common.c"
  4. "gpio.c"
  5. "i2c.c"
  6. "i2s.c"
  7. "ledc.c"
  8. "pcnt.c"
  9. "periph_ctrl.c"
  10. "rmt.c"
  11. "rtc_io.c"
  12. "rtc_module.c"
  13. "sdspi_crc.c"
  14. "sdspi_host.c"
  15. "sdspi_transaction.c"
  16. "sigmadelta.c"
  17. "spi_common.c"
  18. "spi_master.c"
  19. "spi_slave.c"
  20. "spi_bus_lock.c"
  21. "timer.c"
  22. "touch_sensor_common.c"
  23. "twai.c"
  24. "uart.c")
  25. set(includes "include")
  26. if(IDF_TARGET STREQUAL "esp32")
  27. # SDMMC and MCPWM are in ESP32 only.
  28. list(APPEND srcs "mcpwm.c"
  29. "sdio_slave.c"
  30. "sdmmc_host.c"
  31. "sdmmc_transaction.c"
  32. "esp32/touch_sensor.c"
  33. "esp32/adc.c"
  34. "esp32/dac.c")
  35. list(APPEND includes "esp32/include")
  36. endif()
  37. if(IDF_TARGET STREQUAL "esp32s2")
  38. list(APPEND srcs "esp32s2/rtc_tempsensor.c"
  39. "esp32s2/touch_sensor.c"
  40. "esp32s2/adc.c"
  41. "esp32s2/adc2_init_cal.c"
  42. "esp32s2/dac.c")
  43. # currently only S2 beta has its own target-specific includes
  44. list(APPEND includes "esp32s2/include")
  45. endif()
  46. idf_component_register(SRCS "${srcs}"
  47. INCLUDE_DIRS ${includes}
  48. PRIV_INCLUDE_DIRS "include/driver"
  49. PRIV_REQUIRES efuse esp_timer esp_ipc
  50. REQUIRES esp_ringbuf freertos soc) #cannot totally hide soc headers, since there are a lot arguments in the driver are chip-dependent
  51. # uses C11 atomic feature
  52. set_source_files_properties(spi_master.c PROPERTIES COMPILE_FLAGS -std=gnu11)