ngscopeclient v0.2.1
Loading...
Searching...
No Matches
AntikernelLabsGPIO.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopehal *
4* *
5* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
6* All rights reserved. *
7* *
8* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9* following conditions are met: *
10* *
11* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12* following disclaimer. *
13* *
14* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15* following disclaimer in the documentation and/or other materials provided with the distribution. *
16* *
17* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18* derived from this software without specific prior written permission. *
19* *
20* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26* POSSIBILITY OF SUCH DAMAGE. *
27* *
28***********************************************************************************************************************/
29
37#ifndef AntikernelLabsGPIO_h
38#define AntikernelLabsGPIO_h
39
46 : public virtual SCPIMiscInstrument
47{
48public:
50 virtual ~AntikernelLabsGPIO();
51
52 //Device information
53 virtual uint32_t GetInstrumentTypes() const override;
54 virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override;
55
56 //Acquisition
57 virtual bool AcquireData() override;
58
59protected:
60
64 void DoPreLoadConfiguration(int version, const YAML::Node& node, IDTable& idmap, ConfigWarningList& list);
65
66 bool m_cachedConfigValid;
67 uint32_t m_cachedTris;
68 uint32_t m_cachedOut;
69
70public:
71
72 //This is intentionally not virtual since it's a static method used by enumeration
73 //cppcheck-suppress duplInheritedMember
74 static std::vector<SCPIInstrumentModel> GetDriverSupportedModels()
75 {
76 return
77 {
78 {"gpio", {{ SCPITransportType::TRANSPORT_LAN, "localhost:5025" }}}
79 };
80 }
81
82 static std::string GetDriverNameInternal();
83 MISC_INITPROC(AntikernelLabsGPIO);
84};
85
86#endif
A miscellaneous instrument which provides access to an Antikernel Labs GPIO bridge.
Definition AntikernelLabsGPIO.h:47
virtual bool AcquireData() override
Pull data from the instrument.
Definition AntikernelLabsGPIO.cpp:108
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition AntikernelLabsGPIO.cpp:82
static std::string GetDriverNameInternal()
Returns the constant driver name.
Definition AntikernelLabsGPIO.cpp:88
virtual uint32_t GetInstrumentTypes() const override
Returns a bitfield describing the set of instrument types that this instrument supports.
Definition AntikernelLabsGPIO.cpp:77
void DoPreLoadConfiguration(int version, const YAML::Node &node, IDTable &idmap, ConfigWarningList &list)
Validate instrument and channel configuration from a save file.
Definition AntikernelLabsGPIO.cpp:96
All warnings generated by a configuration we're in the process of loading.
Definition ConfigWarningList.h:90
Bidirectional table mapping integer IDs in scopesession files to object pointers.
Definition IDTable.h:49
An SCPI-based miscellaneous instrument.
Definition SCPIMiscInstrument.h:37
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition SCPITransport.h:53