Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
a38f6f2eaThis file is pinned to the selected release. Download the original to open it in your design tool.
module;
#include <concepts>
#include <span>
#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::span<const std::uint8_t> 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>;
};
}