2 * This file is part of the libsigrok project.
4 * Copyright (C) 2015 Martin Lederhilger <martin.lederhilger@gmx.at>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef LIBSIGROK_HARDWARE_GWINSTEK_GDS_800_PROTOCOL_H
21 #define LIBSIGROK_HARDWARE_GWINSTEK_GDS_800_PROTOCOL_H
25 #include <libsigrok/libsigrok.h>
26 #include "libsigrok-internal.h"
29 #define LOG_PREFIX "gwinstek-gds-800"
31 #define MAX_SAMPLES 125000
32 #define MAX_RCV_BUFFER_SIZE (MAX_SAMPLES * 2)
37 START_TRANSFER_OF_CHANNEL_DATA,
38 WAIT_FOR_TRANSFER_OF_BEGIN_TRANSMISSION_COMPLETE,
39 WAIT_FOR_TRANSFER_OF_DATA_SIZE_DIGIT_COMPLETE,
40 WAIT_FOR_TRANSFER_OF_DATA_SIZE_COMPLETE,
41 WAIT_FOR_TRANSFER_OF_SAMPLE_RATE_COMPLETE,
42 WAIT_FOR_TRANSFER_OF_CHANNEL_INDICATOR_COMPLETE,
43 WAIT_FOR_TRANSFER_OF_RESERVED_DATA_COMPLETE,
44 WAIT_FOR_TRANSFER_OF_CHANNEL_DATA_COMPLETE,
47 /** Private, per-device-instance driver context. */
50 uint64_t cur_acq_frame;
53 int cur_rcv_buffer_position;
54 char rcv_buffer[MAX_RCV_BUFFER_SIZE];
61 SR_PRIV int gwinstek_gds_800_receive_data(int fd, int revents, void *cb_data);