2024-08-16 22:50:06 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <QMetaType>
|
|
|
|
|
|
|
|
|
|
#include "TargetPadDescriptor.hpp"
|
|
|
|
|
|
|
|
|
|
#include "src/Helpers/Pair.hpp"
|
|
|
|
|
|
|
|
|
|
namespace Targets
|
|
|
|
|
{
|
|
|
|
|
struct TargetGpioPadState
|
|
|
|
|
{
|
|
|
|
|
enum class State: std::uint8_t
|
|
|
|
|
{
|
|
|
|
|
HIGH,
|
|
|
|
|
LOW,
|
2025-02-18 00:35:39 +00:00
|
|
|
UNKNOWN,
|
2024-08-16 22:50:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum class DataDirection: std::uint8_t
|
|
|
|
|
{
|
|
|
|
|
INPUT,
|
|
|
|
|
OUTPUT,
|
2025-02-18 00:35:39 +00:00
|
|
|
UNKNOWN,
|
2024-08-16 22:50:06 +01:00
|
|
|
};
|
|
|
|
|
|
2025-02-18 00:35:39 +00:00
|
|
|
bool disabled = false;
|
|
|
|
|
State value = State::UNKNOWN;
|
|
|
|
|
DataDirection direction = DataDirection::UNKNOWN;
|
2024-08-16 22:50:06 +01:00
|
|
|
|
|
|
|
|
bool operator == (const TargetGpioPadState& other) const {
|
|
|
|
|
return this->value == other.value && this->direction == other.direction;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool operator != (const TargetGpioPadState& other) const {
|
|
|
|
|
return !(*this == other);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
using TargetGpioPadDescriptorAndStatePair = Pair<const TargetPadDescriptor&, TargetGpioPadState>;
|
|
|
|
|
using TargetGpioPadDescriptorAndStatePairs = std::vector<TargetGpioPadDescriptorAndStatePair>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Q_DECLARE_METATYPE(Targets::TargetGpioPadState)
|