SR_PRIV const size_t samplerates_count = ARRAY_SIZE(samplerates);
-static const char sigma_firmware_files[][24] = {
+static const char firmware_files[][24] = {
/* 50 MHz, supports 8 bit fractions */
"asix-sigma-50.fw",
/* 100 MHz */
const char *firmware;
/* Avoid downloading the same firmware multiple times. */
- firmware = sigma_firmware_files[firmware_idx];
+ firmware = firmware_files[firmware_idx];
if (devc->cur_firmware == firmware_idx) {
sr_info("Not uploading firmware file '%s' again.", firmware);
return SR_OK;
uint8_t sample_delay_l;
};
-struct dslogic_fpga_config {
+struct fpga_config {
uint32_t sync;
uint16_t mode_header;
* Get the session trigger and configure the FPGA structure
* accordingly.
*/
-static void set_trigger(const struct sr_dev_inst *sdi,
- struct dslogic_fpga_config *cfg)
+static void set_trigger(const struct sr_dev_inst *sdi, struct fpga_config *cfg)
{
struct sr_trigger *trigger;
struct sr_trigger_stage *stage;
struct dev_context *devc;
struct sr_usb_dev_inst *usb;
uint8_t c[3];
- struct dslogic_fpga_config cfg;
+ struct fpga_config cfg;
uint16_t v16;
uint32_t v32;
int transferred, len, ret;
WL32(&cfg.end_sync, DS_CFG_END);
/* Pass in the length of a fixed-size struct. Really. */
- len = sizeof(struct dslogic_fpga_config) / 2;
+ len = sizeof(struct fpga_config) / 2;
c[0] = len & 0xff;
c[1] = (len >> 8) & 0xff;
c[2] = (len >> 16) & 0xff;
set_trigger(sdi, &cfg);
- len = sizeof(struct dslogic_fpga_config);
+ len = sizeof(struct fpga_config);
ret = libusb_bulk_transfer(usb->devhdl, 2 | LIBUSB_ENDPOINT_OUT,
(unsigned char *)&cfg, len, &transferred, USB_TIMEOUT);
if (ret < 0 || transferred != len) {
if (!usb->devhdl)
return SR_ERR_BUG;
- sr_info("fx2lafw: Closing device on %d.%d (logical) / %s (physical) interface %d.",
+ sr_info("Closing device on %d.%d (logical) / %s (physical) interface %d.",
usb->bus, usb->address, sdi->connection_id, USB_INTERFACE);
libusb_release_interface(usb->devhdl, USB_INTERFACE);
libusb_close(usb->devhdl);
[SCPI_CMD_GET_PROBE_UNIT] = ":PROB%d:SET:ATT:UNIT?",
};
-static const uint32_t hmo_devopts[] = {
+static const uint32_t devopts[] = {
SR_CONF_OSCILLOSCOPE,
SR_CONF_LIMIT_FRAMES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_SAMPLERATE | SR_CONF_GET,
SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
-static const uint32_t hmo_analog_devopts[] = {
+static const uint32_t analog_devopts[] = {
SR_CONF_NUM_VDIV | SR_CONF_GET,
SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
-static const char *hmo_coupling_options[] = {
+static const char *coupling_options[] = {
"AC", // AC with 50 Ohm termination (152x, 202x, 30xx, 1202)
"ACL", // AC with 1 MOhm termination
"DC", // DC with 50 Ohm termination
NULL,
};
-static const char *hmo_compact2_trigger_sources[] = {
+static const char *compact2_trigger_sources[] = {
"CH1",
"CH2",
"LINE",
NULL,
};
-static const char *hmo_compact4_trigger_sources[] = {
+static const char *compact4_trigger_sources[] = {
"CH1",
"CH2",
"CH3",
NULL,
};
-static const char *hmo_compact4_dig16_trigger_sources[] = {
+static const char *compact4_dig16_trigger_sources[] = {
"CH1",
"CH2",
"CH3",
NULL,
};
-static const uint64_t hmo_timebases[][2] = {
+static const uint64_t timebases[][2] = {
/* nanoseconds */
{ 2, 1000000000 },
{ 5, 1000000000 },
{ 50, 1 },
};
-static const uint64_t hmo_vdivs[][2] = {
+static const uint64_t vdivs[][2] = {
/* millivolts */
{ 1, 1000 },
{ 2, 1000 },
.analog_names = &scope_analog_channel_names,
.digital_names = &scope_digital_channel_names,
- .devopts = &hmo_devopts,
- .num_devopts = ARRAY_SIZE(hmo_devopts),
+ .devopts = &devopts,
+ .num_devopts = ARRAY_SIZE(devopts),
- .analog_devopts = &hmo_analog_devopts,
- .num_analog_devopts = ARRAY_SIZE(hmo_analog_devopts),
+ .analog_devopts = &analog_devopts,
+ .num_analog_devopts = ARRAY_SIZE(analog_devopts),
- .coupling_options = &hmo_coupling_options,
- .trigger_sources = &hmo_compact2_trigger_sources,
+ .coupling_options = &coupling_options,
+ .trigger_sources = &compact2_trigger_sources,
.trigger_slopes = &scope_trigger_slopes,
- .timebases = &hmo_timebases,
- .num_timebases = ARRAY_SIZE(hmo_timebases),
+ .timebases = &timebases,
+ .num_timebases = ARRAY_SIZE(timebases),
- .vdivs = &hmo_vdivs,
- .num_vdivs = ARRAY_SIZE(hmo_vdivs),
+ .vdivs = &vdivs,
+ .num_vdivs = ARRAY_SIZE(vdivs),
.num_xdivs = 12,
.num_ydivs = 8,
.analog_names = &scope_analog_channel_names,
.digital_names = &scope_digital_channel_names,
- .devopts = &hmo_devopts,
- .num_devopts = ARRAY_SIZE(hmo_devopts),
+ .devopts = &devopts,
+ .num_devopts = ARRAY_SIZE(devopts),
- .analog_devopts = &hmo_analog_devopts,
- .num_analog_devopts = ARRAY_SIZE(hmo_analog_devopts),
+ .analog_devopts = &analog_devopts,
+ .num_analog_devopts = ARRAY_SIZE(analog_devopts),
- .coupling_options = &hmo_coupling_options,
- .trigger_sources = &hmo_compact4_trigger_sources,
+ .coupling_options = &coupling_options,
+ .trigger_sources = &compact4_trigger_sources,
.trigger_slopes = &scope_trigger_slopes,
- .timebases = &hmo_timebases,
- .num_timebases = ARRAY_SIZE(hmo_timebases),
+ .timebases = &timebases,
+ .num_timebases = ARRAY_SIZE(timebases),
- .vdivs = &hmo_vdivs,
- .num_vdivs = ARRAY_SIZE(hmo_vdivs),
+ .vdivs = &vdivs,
+ .num_vdivs = ARRAY_SIZE(vdivs),
.num_xdivs = 12,
.num_ydivs = 8,
.analog_names = &scope_analog_channel_names,
.digital_names = &scope_digital_channel_names,
- .devopts = &hmo_devopts,
- .num_devopts = ARRAY_SIZE(hmo_devopts),
+ .devopts = &devopts,
+ .num_devopts = ARRAY_SIZE(devopts),
- .analog_devopts = &hmo_analog_devopts,
- .num_analog_devopts = ARRAY_SIZE(hmo_analog_devopts),
+ .analog_devopts = &analog_devopts,
+ .num_analog_devopts = ARRAY_SIZE(analog_devopts),
- .coupling_options = &hmo_coupling_options,
- .trigger_sources = &hmo_compact4_dig16_trigger_sources,
+ .coupling_options = &coupling_options,
+ .trigger_sources = &compact4_dig16_trigger_sources,
.trigger_slopes = &scope_trigger_slopes,
- .timebases = &hmo_timebases,
- .num_timebases = ARRAY_SIZE(hmo_timebases),
+ .timebases = &timebases,
+ .num_timebases = ARRAY_SIZE(timebases),
- .vdivs = &hmo_vdivs,
- .num_vdivs = ARRAY_SIZE(hmo_vdivs),
+ .vdivs = &vdivs,
+ .num_vdivs = ARRAY_SIZE(vdivs),
.num_xdivs = 12,
.num_ydivs = 8,
if (sr_scpi_get_string(scpi, command, &tmp_str) != SR_OK)
return SR_ERR;
- if (array_float_get(tmp_str, hmo_vdivs, ARRAY_SIZE(hmo_vdivs),
- &j) != SR_OK) {
+ if (array_float_get(tmp_str, vdivs, ARRAY_SIZE(vdivs), &j) != SR_OK) {
g_free(tmp_str);
sr_err("Could not determine array index for vertical div scale.");
return SR_ERR;
&tmp_str) != SR_OK)
return SR_ERR;
- if (array_float_get(tmp_str, hmo_timebases, ARRAY_SIZE(hmo_timebases),
- &i) != SR_OK) {
+ if (array_float_get(tmp_str, timebases, ARRAY_SIZE(timebases), &i) != SR_OK) {
g_free(tmp_str);
sr_err("Could not determine array index for time base.");
return SR_ERR;
static const char *MANUFACTURER_ID = "YOKOGAWA";
static const char *MANUFACTURER_NAME = "Yokogawa";
-static const uint32_t dlm_scanopts[] = {
+static const uint32_t scanopts[] = {
SR_CONF_CONN,
};
-static const uint32_t dlm_drvopts[] = {
+static const uint32_t drvopts[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_OSCILLOSCOPE,
};
-static const uint32_t dlm_devopts[] = {
+static const uint32_t devopts[] = {
SR_CONF_LIMIT_FRAMES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_SAMPLERATE | SR_CONF_GET,
SR_CONF_TIMEBASE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
-static const uint32_t dlm_analog_devopts[] = {
+static const uint32_t analog_devopts[] = {
SR_CONF_NUM_VDIV | SR_CONF_GET,
SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
-static const uint32_t dlm_digital_devopts[] = {
+static const uint32_t digital_devopts[] = {
};
enum {
switch (key) {
case SR_CONF_SCAN_OPTIONS:
case SR_CONF_DEVICE_OPTIONS:
- return STD_CONFIG_LIST(key, data, sdi, cg, dlm_scanopts, dlm_drvopts, dlm_devopts);
+ return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
case SR_CONF_TIMEBASE:
*data = build_tuples(&dlm_timebases, ARRAY_SIZE(dlm_timebases));
return SR_OK;
case SR_CONF_DEVICE_OPTIONS:
if (cg_type == CG_ANALOG) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
- dlm_analog_devopts, ARRAY_SIZE(dlm_analog_devopts), sizeof(uint32_t));
+ analog_devopts, ARRAY_SIZE(analog_devopts), sizeof(uint32_t));
} else if (cg_type == CG_DIGITAL) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
- dlm_digital_devopts, ARRAY_SIZE(dlm_digital_devopts), sizeof(uint32_t));
+ digital_devopts, ARRAY_SIZE(digital_devopts), sizeof(uint32_t));
} else {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
NULL, 0, sizeof(uint32_t));
#include "scpi.h"
#include "protocol.h"
-static const char *dlm_coupling_options[] = {
+static const char *coupling_options[] = {
"AC",
"DC",
"DC50",
NULL,
};
-static const char *dlm_2ch_trigger_sources[] = {
+static const char *trigger_sources_2ch[] = {
"1",
"2",
"LINE",
};
/* TODO: Is BITx handled correctly or is Dx required? */
-static const char *dlm_4ch_trigger_sources[] = {
+static const char *trigger_sources_4ch[] = {
"1",
"2",
"3",
.analog_names = &scope_analog_channel_names,
.digital_names = &scope_digital_channel_names_8,
- .coupling_options = &dlm_coupling_options,
- .trigger_sources = &dlm_2ch_trigger_sources,
+ .coupling_options = &coupling_options,
+ .trigger_sources = &trigger_sources_2ch,
.num_xdivs = 10,
.num_ydivs = 8,
.analog_names = &scope_analog_channel_names,
.digital_names = &scope_digital_channel_names_8,
- .coupling_options = &dlm_coupling_options,
- .trigger_sources = &dlm_4ch_trigger_sources,
+ .coupling_options = &coupling_options,
+ .trigger_sources = &trigger_sources_4ch,
.num_xdivs = 10,
.num_ydivs = 8,
.analog_names = &scope_analog_channel_names,
.digital_names = NULL,
- .coupling_options = &dlm_coupling_options,
- .trigger_sources = &dlm_4ch_trigger_sources,
+ .coupling_options = &coupling_options,
+ .trigger_sources = &trigger_sources_4ch,
.num_xdivs = 10,
.num_ydivs = 8,
.analog_names = &scope_analog_channel_names,
.digital_names = &scope_digital_channel_names_32,
- .coupling_options = &dlm_coupling_options,
- .trigger_sources = &dlm_4ch_trigger_sources,
+ .coupling_options = &coupling_options,
+ .trigger_sources = &trigger_sources_4ch,
.num_xdivs = 10,
.num_ydivs = 8,
.analog_names = &scope_analog_channel_names,
.digital_names = &scope_digital_channel_names_32,
- .coupling_options = &dlm_coupling_options,
- .trigger_sources = &dlm_4ch_trigger_sources,
+ .coupling_options = &coupling_options,
+ .trigger_sources = &trigger_sources_4ch,
.num_xdivs = 10,
.num_ydivs = 8,