Loading...
Searching...
No Matches
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
14namespace Protocols
15{
16
17namespace SimpleIO
18{
19struct 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};
28struct PWM
29{
30 int32_t chip{};
31 int32_t channel{};
32 int32_t polarity{};
33};
34struct ADC
35{
36 int32_t chip{};
37 int32_t channel{};
38};
39struct DAC
40{
41 int32_t chip{};
42 int32_t channel{};
43};
44struct HID
45{
46 int32_t chip{};
47 int32_t channel{};
48};
49struct Custom
50{
51};
52
53using Type = ossia::variant<GPIO, PWM, ADC, DAC, HID, Custom>;
54
55struct Port
56{
57 Type control{};
58 QString name{};
59 QString path{};
60};
61
62}
63
64struct SimpleIOSpecificSettings
65{
66 std::vector<SimpleIO::Port> ports;
67};
68}
69
70Q_DECLARE_METATYPE(Protocols::SimpleIOSpecificSettings)
71W_REGISTER_ARGTYPE(Protocols::SimpleIOSpecificSettings)
72#endif