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 <cstdint>
export module Driver.UartDriverConcept;
import Driver.DriverComponent;
import Driver.UartStatus;
export namespace Driver::Concepts
{
/**
* @concept UartDriver
* @brief Defines requirements for UART communication drivers
*/
template <typename T>
concept UartDriverConcept =
std::derived_from<T, DriverComponent> &&
requires(T driver,
std::span<const std::uint8_t> txData,
std::span<std::uint8_t> rxData,
std::uint32_t timeout) {
{ driver.transmit(txData, timeout) } noexcept -> std::same_as<UartStatus>;
{ driver.receive(rxData, timeout) } noexcept -> std::same_as<UartStatus>;
};
}