Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
1292c910cThis file is pinned to the selected release. Download the original to open it in your design tool.
module;
#include <concepts>
#include <string_view>
#include <cstdint>
export module Driver.SdCardDriverConcept;
import Driver.DriverComponent;
import Driver.SdCardStatus;
import Driver.FileOpenMode;
export namespace Driver::Concepts
{
/**
* @concept SdCardDriverConcept
* @brief Defines requirements for SD card storage drivers
*/
template <typename T>
concept SdCardDriverConcept =
std::derived_from<T, DriverComponent> &&
requires(T driver,
std::string_view filename,
FileOpenMode mode,
std::string_view data) {
// File operations
{ driver.openFile(filename, mode) } noexcept -> std::same_as<SdCardStatus>;
{ driver.write(data) } noexcept -> std::same_as<SdCardStatus>;
{ driver.closeFile() } noexcept -> std::same_as<SdCardStatus>;
};
}