1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00
VILLASnode/include/villas/nodes/uldaq.hpp

75 lines
1.8 KiB
C++
Raw Permalink Normal View History

/** Node-type for uldaq connections.
*
* @file
* @author Manuel Pitz <manuel.pitz@eonerc.rwth-aachen.de>
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
2020-01-20 17:17:00 +01:00
* @copyright 2014-2020, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* VILLASnode
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
/**
* @ingroup node
* @addtogroup uldaq Read USB analog to digital converters
* @{
*/
#pragma once
#include <pthread.h>
#include <villas/queue_signalled.h>
#include <villas/pool.h>
#include <uldaq.h>
#define ULDAQ_MAX_DEV_COUNT 100
#define ULDAQ_MAX_RANGE_COUNT 8
struct uldaq {
2018-10-04 03:00:14 +02:00
const char *device_id;
DaqDeviceHandle device_handle;
2018-10-04 03:00:14 +02:00
DaqDeviceDescriptor *device_descriptor;
DaqDeviceInterface device_interface_type;
2018-09-25 21:46:42 +02:00
uint64_t sequence;
struct {
double sample_rate;
double *buffer;
2018-10-04 03:00:14 +02:00
size_t buffer_len;
size_t buffer_pos;
size_t channel_count;
ScanOption scan_options;
AInScanFlag flags;
AiQueueElement *queues;
ScanStatus status; // protected by mutex
TransferStatus transfer_status; // protected by mutex
pthread_mutex_t mutex;
pthread_cond_t cv;
} in;
struct {
// TODO
} out;
};
/** @} */