#Description: SDMMC sd stack; user_visible: True
include_guard(GLOBAL)
message("middleware_sdmmc_sd component is included.")

target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
    ${CMAKE_CURRENT_LIST_DIR}/sd/fsl_sd.c
)

target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
    ${CMAKE_CURRENT_LIST_DIR}/sd
)

#OR Logic component
if(${MCUX_DEVICE} STREQUAL "MIMXRT1166_cm4")
    include(middleware_sdmmc_host_usdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "MIMXRT1166_cm7")
    include(middleware_sdmmc_host_usdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "MIMXRT1052")
    include(middleware_sdmmc_host_usdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "MIMXRT1064")
    include(middleware_sdmmc_host_usdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "MK64F12")
    include(middleware_sdmmc_host_sdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "MK66F18")
    include(middleware_sdmmc_host_sdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "LPC54628")
    include(middleware_sdmmc_host_sdif)
endif()
if(${MCUX_DEVICE} STREQUAL "MIMXRT1021")
    include(middleware_sdmmc_host_usdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "MIMXRT1062")
    include(middleware_sdmmc_host_usdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "LPC54S018")
    include(middleware_sdmmc_host_sdif)
endif()
if(${MCUX_DEVICE} STREQUAL "K32L3A60_cm0plus")
    include(middleware_sdmmc_host_usdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "K32L3A60_cm4")
    include(middleware_sdmmc_host_usdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "MIMXRT1176_cm4")
    include(middleware_sdmmc_host_usdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "MIMXRT1176_cm7")
    include(middleware_sdmmc_host_usdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "LPC54S018M")
    include(middleware_sdmmc_host_sdif)
endif()
if(${MCUX_DEVICE} STREQUAL "LPC55S69_cm33_core0")
    include(middleware_sdmmc_host_sdif)
endif()
if(${MCUX_DEVICE} STREQUAL "MIMXRT1024")
    include(middleware_sdmmc_host_usdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "LPC55S28")
    include(middleware_sdmmc_host_sdif)
endif()
if(${MCUX_DEVICE} STREQUAL "MIMXRT685S_cm33")
    include(middleware_sdmmc_host_usdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "MIMXRT595S_cm33")
    include(middleware_sdmmc_host_usdhc)
endif()
if(${MCUX_DEVICE} STREQUAL "MK28FA15")
    include(middleware_sdmmc_host_sdhc)
endif()

include(middleware_sdmmc_common)
