SeekDAS S100M4X C++ SDK 0.2.0
seekdas.hpp: C++17 interface over the Rust SDK
Loading...
Searching...
No Matches
seekdas.hpp File Reference

SeekDAS S100M4X host SDK for C++ (C++17, header only). More...

#include <array>
#include <chrono>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <initializer_list>
#include <memory>
#include <optional>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>
#include "seekdas_ffi.h"

Go to the source code of this file.

Classes

class  seekdas::Error
struct  seekdas::IoError
 socket or serial port I/O error More...
struct  seekdas::TimeoutError
 no answer from the device in time; also: no data while waiting for a run More...
struct  seekdas::ProtocolError
 received data does not follow the protocol More...
struct  seekdas::AtError
 the device answered ERROR to an AT command More...
struct  seekdas::ParseError
 an AT answer could not be parsed More...
struct  seekdas::ArgumentError
 invalid argument More...
struct  seekdas::DeviceError
 the device reports an error state (lost points, wrong ID, ...) More...
struct  seekdas::InternalError
 internal error of the library More...
struct  seekdas::BusyError
 an acquisition (trigger) is running: no new start and no configuration change until it is done or stopped More...
class  seekdas::ChannelMask
 A set of inputs (bit i = input i). More...
class  seekdas::View< T >
 Read-only view of an array owned by the library (Capture, Packet); valid as long as its owner. More...
struct  seekdas::DeviceInfo
struct  seekdas::BoardStatus
struct  seekdas::NetStatus
struct  seekdas::AcqStatus
struct  seekdas::StreamStats
struct  seekdas::RunSummary
struct  seekdas::WindowStats
struct  seekdas::TriggerState
 State of the trigger (Device::trigger_state). More...
struct  seekdas::KernelChoice
 What Config::bandwidth / Trigger::bandwidth choose for a signal bandwidth. More...
class  seekdas::Config
 Configuration of a run: decimation and kernel, edge detectors, internal generator, the two groups, point count, packet size. More...
class  seekdas::Trigger
 One trigger run: N points on each target channel, CONV edges from one to four analogue inputs. More...
class  seekdas::Capture
 Result of a run. Points per group; a trigger run uses group 0. Move-only. More...
struct  seekdas::Packet
 One point packet from Device::recv. The views are valid until the next call on the same Device. More...
struct  seekdas::RawCapture
 1024 raw samples of all inputs (Device::raw_capture). More...
struct  seekdas::DeviceOptions
class  seekdas::Device
class  seekdas::RangeTarget
 Target of At::set_range: one input, one slot, or all inputs. More...
struct  seekdas::AtVersion
struct  seekdas::AtStatus
struct  seekdas::SelftestResult
struct  seekdas::ConvSource
 A CONV source as the management program lists it (AT+CONV?). More...
class  seekdas::At

Namespaces

namespace  seekdas

Enumerations

enum class  seekdas::Channel : int {
  seekdas::S0A , seekdas::S0B , seekdas::S0C , seekdas::S0D ,
  seekdas::S1A , seekdas::S1B , seekdas::S1C , seekdas::S1D ,
  seekdas::S2A , seekdas::S2B , seekdas::S2C , seekdas::S2D
}
 Analogue inputs, left to right: slot 0..2, input A..D. Index = 4 * slot + input. More...
enum class  seekdas::Range : int { seekdas::V10 = 10 , seekdas::V5 = 5 , seekdas::V2 = 2 }
 Input range of the analogue front end. More...
enum class  seekdas::Edge : int { seekdas::Rising = SEEKDAS_EDGE_RISING , seekdas::Falling = SEEKDAS_EDGE_FALLING , seekdas::Both = SEEKDAS_EDGE_BOTH }
 Edge of a CONV input that produces an event. More...
enum class  seekdas::Window : int { seekdas::Ms1 = SEEKDAS_WINDOW_1MS , seekdas::Ms100 = SEEKDAS_WINDOW_100MS , seekdas::S1 = SEEKDAS_WINDOW_1S }
 Statistics windows of the bypass statistics. More...
enum class  seekdas::RunState { seekdas::Idle = SEEKDAS_RUN_IDLE , seekdas::Running = SEEKDAS_RUN_RUNNING , seekdas::Done = SEEKDAS_RUN_DONE }

Functions

std::string seekdas::library_version ()
 Version of the underlying library, e.g. "0.2.0".
constexpr int seekdas::index (Channel c) noexcept
Channel seekdas::channel (int index)
Channel seekdas::channel (int slot, int input)
std::string seekdas::to_string (Channel c)
Channel seekdas::parse_channel (const std::string &s)
 "S0A" .. "S2D" (case-insensitive)
ChannelMask seekdas::operator| (Channel a, Channel b) noexcept
double seekdas::code_to_volts (Range r, double code)
 ADC code -> volts with the typical sensitivity of the range (not calibrated per input; offset not corrected).
constexpr std::uint32_t seekdas::source_detector (int d) noexcept
 Source mask of a group (Config::group): edge detector d, or the internal generator.
const char * seekdas::to_string (RunState s)
KernelChoice seekdas::kernel_for_bandwidth (double bandwidth_hz)

Variables

constexpr int seekdas::kChannels = SEEKDAS_CHANNELS
 12 inputs
constexpr int seekdas::kRawSamples = SEEKDAS_RAW_SAMPLES
 samples per input of Device::raw_capture
constexpr std::uint32_t seekdas::kSourceGenerator = SEEKDAS_SRC_GENERATOR

Detailed Description

SeekDAS S100M4X host SDK for C++ (C++17, header only).

A native C++ interface over the C ABI of the Rust SDK (library seekdas_ffi, header seekdas_ffi.h): RAII handles, exceptions instead of return codes, enums and value types instead of integers and flags. Every call goes through the Rust implementation; nothing of the protocol is re-implemented here.

seekdas::Device dev("192.168.1.128");
trig.target({seekdas::Channel::S0A, seekdas::Channel::S0B}, 10000) // 10000 points on S0A and on S0B
.conv(seekdas::Channel::S2A, seekdas::Edge::Rising, 1400); // CONV: rising edges of S2A at 1400 codes
dev.start_trigger(trig); // throws seekdas::BusyError while a run is active
while (dev.trigger_state().running) { ... } // progress, start_allowed, ...
seekdas::Capture cap = dev.wait_trigger(); // all points
auto s0a = cap.channel(seekdas::Channel::S0A); // 10000 values (ADC codes)
Result of a run. Points per group; a trigger run uses group 0. Move-only.
Definition seekdas.hpp:446
View< std::int16_t > channel(Channel input, int group=0) const
all points of one input (empty if the input is not in the group)
Definition seekdas.hpp:454
One trigger run: N points on each target channel, CONV edges from one to four analogue inputs.
Definition seekdas.hpp:394
Trigger & target(ChannelMask channels, std::uint32_t points_per_channel)
target: points_per_channel (>= 1) points on every channel of channels (at least one)
Definition seekdas.hpp:400

Threading: one Device / At object is used by one thread at a time; different objects may be used on different threads. Errors: every failure throws a subclass of seekdas::Error carrying the library's message and the C error code.

Definition in file seekdas.hpp.