score
Home
Classes
Namespaces
Files
SimpleIOSpecificSettings.hpp
1
#pragma once
2
#include <ossia/detail/config.hpp>
3
#if defined(OSSIA_PROTOCOL_SIMPLEIO)
4
#include <score/tools/std/StringHash.hpp>
5
6
#include <ossia/detail/variant.hpp>
7
8
#include <QString>
9
10
#include <utility>
11
#include <vector>
12
#include <verdigris>
13
14
namespace
Protocols
15
{
16
17
namespace
SimpleIO
18
{
19
struct
GPIO
20
{
21
int32_t chip{};
22
int32_t line{};
23
int32_t flags{};
24
int32_t events{};
25
int32_t state{};
26
bool
direction{};
27
};
28
struct
PWM
29
{
30
int32_t chip{};
31
int32_t channel{};
32
int32_t polarity{};
33
};
34
struct
ADC
35
{
36
int32_t chip{};
37
int32_t channel{};
38
};
39
struct
DAC
40
{
41
int32_t chip{};
42
int32_t channel{};
43
};
44
struct
HID
45
{
46
int32_t chip{};
47
int32_t channel{};
48
};
49
struct
Custom
50
{
51
};
52
53
using
Type = ossia::variant<GPIO, PWM, ADC, DAC, HID, Custom>;
54
55
struct
Port
56
{
57
Type control{};
58
QString name{};
59
QString path{};
60
};
61
62
}
63
64
struct
SimpleIOSpecificSettings
65
{
66
std::vector<SimpleIO::Port> ports;
67
};
68
}
69
70
Q_DECLARE_METATYPE(Protocols::SimpleIOSpecificSettings)
71
W_REGISTER_ARGTYPE(Protocols::SimpleIOSpecificSettings)
72
#endif