CMakeLists.txt 2.9 KB

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