]> sigrok.org Git - libsigrok.git/blame - src/hardware/juntek-jds6600/protocol.h
output/csv: use intermediate time_t var, silence compiler warning
[libsigrok.git] / src / hardware / juntek-jds6600 / protocol.h
CommitLineData
b1fa9aac
GS
1/*
2 * This file is part of the libsigrok project.
3 *
4 * Copyright (C) 2023 Gerhard Sittig <gerhard.sittig@gmx.net>
5 *
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.
10 *
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.
15 *
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/>.
18 */
19
20#ifndef LIBSIGROK_HARDWARE_JUNTEK_JDS6600_PROTOCOL_H
21#define LIBSIGROK_HARDWARE_JUNTEK_JDS6600_PROTOCOL_H
22
b1fa9aac
GS
23#include <glib.h>
24#include <libsigrok/libsigrok.h>
18baeeed
GS
25#include <stdint.h>
26
b1fa9aac
GS
27#include "libsigrok-internal.h"
28
29#define LOG_PREFIX "juntek-jds6600"
30
18baeeed
GS
31#define MAX_GEN_CHANNELS 2
32
b1fa9aac 33struct dev_context {
18baeeed
GS
34 struct devc_dev {
35 unsigned int device_type;
36 char *serial_number;
37 uint64_t max_output_frequency;
38 size_t channel_count_gen;
39 } device;
40 struct devc_wave {
41 size_t builtin_count;
42 size_t arbitrary_count;
43 size_t names_count;
44 const char **names;
45 uint32_t *fw_codes;
46 } waveforms;
47 struct devc_chan {
48 gboolean enabled;
49 uint32_t waveform_code;
50 size_t waveform_index;
51 double output_frequency;
1711287e
GS
52 double amplitude;
53 double offset;
18baeeed
GS
54 double dutycycle;
55 } channel_config[MAX_GEN_CHANNELS];
56 double channels_phase;
57 GString *quick_req;
b1fa9aac
GS
58};
59
18baeeed
GS
60SR_PRIV int jds6600_identify(struct sr_dev_inst *sdi);
61SR_PRIV int jds6600_setup_devc(struct sr_dev_inst *sdi);
62
63SR_PRIV int jds6600_get_chans_enable(const struct sr_dev_inst *sdi);
64SR_PRIV int jds6600_get_waveform(const struct sr_dev_inst *sdi, size_t ch_idx);
65SR_PRIV int jds6600_get_frequency(const struct sr_dev_inst *sdi, size_t ch_idx);
66SR_PRIV int jds6600_get_amplitude(const struct sr_dev_inst *sdi, size_t ch_idx);
67SR_PRIV int jds6600_get_offset(const struct sr_dev_inst *sdi, size_t ch_idx);
68SR_PRIV int jds6600_get_dutycycle(const struct sr_dev_inst *sdi, size_t ch_idx);
69SR_PRIV int jds6600_get_phase_chans(const struct sr_dev_inst *sdi);
70
71SR_PRIV int jds6600_set_chans_enable(const struct sr_dev_inst *sdi);
72SR_PRIV int jds6600_set_waveform(const struct sr_dev_inst *sdi, size_t ch_idx);
73SR_PRIV int jds6600_set_frequency(const struct sr_dev_inst *sdi, size_t ch_idx);
74SR_PRIV int jds6600_set_amplitude(const struct sr_dev_inst *sdi, size_t ch_idx);
75SR_PRIV int jds6600_set_offset(const struct sr_dev_inst *sdi, size_t ch_idx);
76SR_PRIV int jds6600_set_dutycycle(const struct sr_dev_inst *sdi, size_t ch_idx);
77SR_PRIV int jds6600_set_phase_chans(const struct sr_dev_inst *sdi);
b1fa9aac
GS
78
79#endif