From: Uwe Hermann Date: Mon, 5 Aug 2013 10:59:23 +0000 (+0200) Subject: Drop nexus-osciprime skeleton for now. X-Git-Tag: libsigrok-0.2.1~17 X-Git-Url: http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=c51bbdec345b0d7e1c9013e0a1bea2586cf6daa7 Drop nexus-osciprime skeleton for now. This is mostly just a skeleton driver framework at the moment, we'll bring it back when the driver is fully implemented. --- diff --git a/README.devices b/README.devices index 8bfa2cf2..45b5c09b 100644 --- a/README.devices +++ b/README.devices @@ -42,9 +42,6 @@ The following drivers/devices require a firmware upload upon connection: These can be extracted from the vendor's Windows drivers using a tool from our 'sigrok-util' repository/project. - - nexus-osciprime: The Nexus Computing OsciPrime PC oscilloscope needs - firmware files. These are available from the vendor website. - The following drivers/devices do not need any firmware upload: - agilent-dmm @@ -91,7 +88,6 @@ The following drivers/devices require a serial port specification: - fluke-dmm - link-mso19 - mic-985xx - - nexus-osciprime - openbench-logic-sniffer - serial-dmm - tondaj-sl-814 diff --git a/configure.ac b/configure.ac index 5136be2c..778093e7 100644 --- a/configure.ac +++ b/configure.ac @@ -169,11 +169,6 @@ AC_ARG_ENABLE(mic-985xx, AC_HELP_STRING([--enable-mic-985xx], [HW_MIC_985XX="$enableval"], [HW_MIC_985XX=$HW_ENABLED_DEFAULT]) -AC_ARG_ENABLE(nexus-osciprime, AC_HELP_STRING([--enable-nexus-osciprime], - [enable Nexus Osciprime support [default=yes]]), - [HW_NEXUS_OSCIPRIME="$enableval"], - [HW_NEXUS_OSCIPRIME=$HW_ENABLED_DEFAULT]) - AC_ARG_ENABLE(ols, AC_HELP_STRING([--enable-ols], [enable OpenBench Logic Sniffer (OLS) support [default=yes]]), [HW_OLS="$enableval"], @@ -248,7 +243,7 @@ case "$host" in SR_PKGLIBS="$SR_PKGLIBS libusb-1.0"], [have_libusb1_0="no"; HW_FX2LAFW="no"; HW_HANTEK_DSO="no"; HW_IKALOGIC_SCANALOGIC2="no"; HW_LASCAR_EL_USB="no"; - HW_NEXUS_OSCIPRIME="no"; HW_UNI_T_DMM="no"; HW_VICTOR_DMM="no"; + HW_UNI_T_DMM="no"; HW_VICTOR_DMM="no"; HW_ZEROPLUS_LOGIC_CUBE="no"]) # Define HAVE_LIBUSB_1_0 in config.h if we found libusb-1.0. @@ -391,11 +386,6 @@ if test "x$HW_MIC_985XX" = "xyes"; then AC_DEFINE(HAVE_HW_MIC_985XX, 1, [MIC 985xx support]) fi -AM_CONDITIONAL(HW_NEXUS_OSCIPRIME, test x$HW_NEXUS_OSCIPRIME = xyes) -if test "x$HW_NEXUS_OSCIPRIME" = "xyes"; then - AC_DEFINE(HAVE_HW_NEXUS_OSCIPRIME, 1, [Nexus Osciprime support]) -fi - AM_CONDITIONAL(HW_OLS, test x$HW_OLS = xyes) if test "x$HW_OLS" = "xyes"; then AC_DEFINE(HAVE_HW_OLS, 1, [OpenBench Logic Sniffer (OLS) support]) @@ -478,7 +468,6 @@ AC_CONFIG_FILES([Makefile version.h hardware/Makefile hardware/kecheng-kc-330b/Makefile hardware/lascar-el-usb/Makefile hardware/mic-985xx/Makefile - hardware/nexus-osciprime/Makefile hardware/rigol-ds1xx2/Makefile hardware/tondaj-sl-814/Makefile hardware/victor-dmm/Makefile @@ -543,7 +532,6 @@ echo " - kecheng-kc-330b................. $HW_KECHENG_KC_330B" echo " - lascar-el-usb................... $HW_LASCAR_EL_USB" echo " - link-mso19...................... $HW_LINK_MSO19" echo " - mic-985xx....................... $HW_MIC_985XX" -echo " - nexus-osciprime................. $HW_NEXUS_OSCIPRIME" echo " - openbench-logic-sniffer......... $HW_OLS" echo " - rigol-ds1xx2.................... $HW_RIGOL_DS1XX2" echo " - serial-dmm...................... $HW_SERIAL_DMM" diff --git a/contrib/z60_libsigrok.rules b/contrib/z60_libsigrok.rules index 4a871f2c..7f8f7fba 100644 --- a/contrib/z60_libsigrok.rules +++ b/contrib/z60_libsigrok.rules @@ -117,11 +117,6 @@ ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="664", GROUP="plugdev" # Tondaj SL-814 ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE="664", GROUP="plugdev" -# Nexus-Computing OsciPrime -# The device comes up with the default Cypress FX2 VID:PID (04b4:8613), but -# after firmware upload enumerates as "04b4:1004 Cypress Semiconductor Corp.". -ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="1004", MODE="664", GROUP="plugdev" - # Openbench Logic Sniffer ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="000a", MODE="664", GROUP="plugdev" diff --git a/hardware/Makefile.am b/hardware/Makefile.am index 086f8364..a9526f19 100644 --- a/hardware/Makefile.am +++ b/hardware/Makefile.am @@ -37,7 +37,6 @@ SUBDIRS = \ lascar-el-usb \ link-mso19 \ mic-985xx \ - nexus-osciprime \ openbench-logic-sniffer \ rigol-ds1xx2 \ serial-dmm \ @@ -121,10 +120,6 @@ if HW_MIC_985XX libsigrokhardware_la_LIBADD += mic-985xx/libsigrok_hw_mic_985xx.la endif -if HW_NEXUS_OSCIPRIME -libsigrokhardware_la_LIBADD += nexus-osciprime/libsigrok_hw_nexus_osciprime.la -endif - if HW_OLS libsigrokhardware_la_LIBADD += openbench-logic-sniffer/libsigrok_hw_ols.la endif diff --git a/hardware/nexus-osciprime/Makefile.am b/hardware/nexus-osciprime/Makefile.am deleted file mode 100644 index 01f313e2..00000000 --- a/hardware/nexus-osciprime/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -## -## This file is part of the libsigrok project. -## -## Copyright (C) 2012 Bert Vermeulen -## -## 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 -## (at your option) 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 . -## - -if HW_NEXUS_OSCIPRIME - -AM_CPPFLAGS = -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"' - -# Local lib, this is NOT meant to be installed! -noinst_LTLIBRARIES = libsigrok_hw_nexus_osciprime.la - -libsigrok_hw_nexus_osciprime_la_SOURCES = \ - api.c \ - protocol.c \ - protocol.h - -libsigrok_hw_nexus_osciprime_la_CFLAGS = \ - -I$(top_srcdir) - -endif diff --git a/hardware/nexus-osciprime/api.c b/hardware/nexus-osciprime/api.c deleted file mode 100644 index e1f2d076..00000000 --- a/hardware/nexus-osciprime/api.c +++ /dev/null @@ -1,290 +0,0 @@ -/* - * This file is part of the libsigrok project. - * - * Copyright (C) 2012 Bert Vermeulen - * - * 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 - * (at your option) 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 . - */ - -#include -#include -#include "libsigrok.h" -#include "libsigrok-internal.h" -#include "protocol.h" - -#define OSCI_VENDOR "Nexus Computing" -#define OSCI_MODEL "OsciPrime" -#define OSCI_VERSION "1.0" -#define OSCI_FIRMWARE FIRMWARE_DIR "/nexus-osciprime.fw" -#define OSCI_VIDPID "04b4.1004" - -static const int32_t hwopts[] = { - SR_CONF_CONN, - SR_CONF_SERIALCOMM, -}; - -static const int32_t hwcaps[] = { - SR_CONF_OSCILLOSCOPE, - SR_CONF_LIMIT_SAMPLES, - SR_CONF_CONTINUOUS, - SR_CONF_TIMEBASE, - SR_CONF_VDIV, -}; - -static const uint64_t timebases[][2] = { - /* 24 MHz */ - { 42, 1e9 }, - /* 12 MHz */ - { 83, 1e9 }, - /* 6 MHz */ - { 167, 1e9 }, - /* 3 MHz */ - { 333, 1e9 }, - /* 1.5 MHz */ - { 667, 1e9 }, - /* 750 kHz */ - { 1333, 1e9 }, - /* 375 kHz */ - { 2667, 1e9 }, - /* 187.5 kHz */ - { 5333, 1e9 }, - /* 93.25 kHz */ - { 10724, 1e9 }, - /* 46.875 kHz */ - { 21333, 1e9 }, - /* 23.4375 kHz */ - { 42666, 1e9 }, - /* 11.718 kHz */ - { 85339, 1e9 }, - /* 5.859 kHz */ - { 170678, 1e9 }, - /* 2.929 kHz */ - { 341413, 1e9 }, - /* 1.465 kHz */ - { 682594, 1e9 }, - /* 732 Hz */ - { 1366, 1e6 }, - /* 366 Hz */ - { 2732, 1e6 }, - /* 183 Hz */ - { 5464, 1e6 }, - /* 91 Hz */ - { 10989, 1e6 }, - /* 46 Hz */ - { 21739, 1e6 }, - /* 23 Hz */ - { 43478, 1e6 }, - /* 12 Hz */ - { 83333, 1e6 }, -}; - -static const char *probe_names[] = { - "CHA", "CHB", - NULL, -}; - -static const uint64_t vdivs[][2] = { - { 1, 1 }, - { 2, 1 }, - { 5, 2 }, - { 5, 1 }, - { 10, 1 }, -}; - -SR_PRIV struct sr_dev_driver nexus_osciprime_driver_info; -static struct sr_dev_driver *di = &nexus_osciprime_driver_info; - -static int dev_clear(void) -{ - return std_dev_clear(di, NULL); -} - -static int init(struct sr_context *sr_ctx) -{ - return std_init(sr_ctx, di, LOG_PREFIX); -} - -static GSList *scan(GSList *options) -{ - struct drv_context *drvc; - struct dev_context *devc; - struct sr_dev_inst *sdi; - struct sr_usb_dev_inst *usb; - struct sr_config *src; - struct sr_probe *probe; - libusb_device *dev; - GSList *usb_devices, *devices, *l; - int i; - const char *conn; - - drvc = di->priv; - - conn = NULL; - for (l = options; l; l = l->next) { - src = l->data; - switch (src->key) { - case SR_CONF_CONN: - conn = g_variant_get_string(src->data, NULL); - break; - } - } - if (!conn) - conn = OSCI_VIDPID; - - devices = NULL; - if ((usb_devices = sr_usb_find(drvc->sr_ctx->libusb_ctx, conn))) { - for (l = usb_devices; l; l = l->next) { - usb = l->data; - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, - OSCI_VENDOR, OSCI_MODEL, OSCI_VERSION))) - return NULL; - sdi->driver = di; - for (i = 0; probe_names[i]; i++) { - if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, - probe_names[i]))) - return NULL; - sdi->probes = g_slist_append(sdi->probes, probe); - } - - if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) - return NULL; - sdi->priv = devc; - devc->usb = usb; - - if (strcmp(conn, OSCI_VIDPID)) { - if (sr_usb_open(drvc->sr_ctx->libusb_ctx, usb) != SR_OK) - break; - dev = libusb_get_device(usb->devhdl); - if (ezusb_upload_firmware(dev, 0, OSCI_FIRMWARE) == SR_OK) - /* Remember when the firmware on this device was updated */ - devc->fw_updated = g_get_monotonic_time(); - else - sr_err("Firmware upload failed for device " - "at bus %d address %d.", usb->bus, usb->address); - } - - drvc->instances = g_slist_append(drvc->instances, sdi); - devices = g_slist_append(devices, sdi); - } - g_slist_free(usb_devices); - } else - g_slist_free_full(usb_devices, g_free); - - return devices; -} - -static GSList *dev_list(void) -{ - return ((struct drv_context *)(di->priv))->instances; -} - -static int dev_open(struct sr_dev_inst *sdi) -{ - - /* TODO */ - sdi->status = SR_ST_ACTIVE; - - return SR_OK; -} - -static int dev_close(struct sr_dev_inst *sdi) -{ - - /* TODO */ - sdi->status = SR_ST_INACTIVE; - - return SR_OK; -} - -static int cleanup(void) -{ - return dev_clear(); -} - -static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) -{ - int ret; - - /* TODO */ - (void)data; - - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - - ret = SR_OK; - switch (id) { - - default: - ret = SR_ERR_NA; - } - - return ret; -} - -static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi) -{ - (void)sdi; - (void)data; - - switch (key) { - default: - return SR_ERR_NA; - } - - return SR_OK; -} - -static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) -{ - /* TODO */ - (void)cb_data; - - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - - return SR_OK; -} - -static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) -{ - (void)cb_data; - - if (sdi->status != SR_ST_ACTIVE) { - sr_err("Device inactive, can't stop acquisition."); - return SR_ERR; - } - - /* TODO */ - - return SR_OK; -} - -SR_PRIV struct sr_dev_driver nexus_osciprime_driver_info = { - .name = "nexus-osciprime", - .longname = "Nexus OsciPrime", - .api_version = 1, - .init = init, - .cleanup = cleanup, - .scan = scan, - .dev_list = dev_list, - .dev_clear = dev_clear, - .config_get = NULL, - .config_set = config_set, - .config_list = config_list, - .dev_open = dev_open, - .dev_close = dev_close, - .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, -}; diff --git a/hardware/nexus-osciprime/protocol.c b/hardware/nexus-osciprime/protocol.c deleted file mode 100644 index 86c4214b..00000000 --- a/hardware/nexus-osciprime/protocol.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of the libsigrok project. - * - * Copyright (C) 2012 Bert Vermeulen - * - * 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 - * (at your option) 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 . - */ - -#include -#include -#include "libsigrok.h" -#include "libsigrok-internal.h" -#include "protocol.h" - -SR_PRIV int nexus_osciprime_receive_data(int fd, int revents, void *cb_data) -{ - const struct sr_dev_inst *sdi; - struct dev_context *devc; - - (void)fd; - - if (!(sdi = cb_data)) - return TRUE; - - if (!(devc = sdi->priv)) - return TRUE; - - if (revents == G_IO_IN) { - /* TODO */ - } - - return TRUE; -} diff --git a/hardware/nexus-osciprime/protocol.h b/hardware/nexus-osciprime/protocol.h deleted file mode 100644 index 579639dd..00000000 --- a/hardware/nexus-osciprime/protocol.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * This file is part of the libsigrok project. - * - * Copyright (C) 2012 Bert Vermeulen - * - * 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 - * (at your option) 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 . - */ - -#ifndef LIBSIGROK_HARDWARE_NEXUS_OSCIPRIME_PROTOCOL_H -#define LIBSIGROK_HARDWARE_NEXUS_OSCIPRIME_PROTOCOL_H - -#include -#include "libsigrok.h" -#include "libsigrok-internal.h" - -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "nexus-osciprime: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) - -/** Private, per-device-instance driver context. */ -struct dev_context { - /** The current sampling limit (in number of samples). */ - uint64_t limit_samples; - - /** The current sampling limit (in ms). */ - uint64_t limit_msec; - - /** Opaque pointer passed in by the frontend. */ - void *cb_data; - - /** The current number of already received samples. */ - uint64_t num_samples; - struct sr_usb_dev_inst *usb; - int usbfd[10]; - int64_t fw_updated; -}; - -SR_PRIV int nexus_osciprime_receive_data(int fd, int revents, void *cb_data); - -#endif diff --git a/hwdriver.c b/hwdriver.c index 7f3ca35a..8b23aea3 100644 --- a/hwdriver.c +++ b/hwdriver.c @@ -129,9 +129,6 @@ extern SR_PRIV struct sr_dev_driver lascar_el_usb_driver_info; extern SR_PRIV struct sr_dev_driver mic_98581_driver_info; extern SR_PRIV struct sr_dev_driver mic_98583_driver_info; #endif -#ifdef HAVE_HW_NEXUS_OSCIPRIME -extern SR_PRIV struct sr_dev_driver nexus_osciprime_driver_info; -#endif #ifdef HAVE_HW_OLS extern SR_PRIV struct sr_dev_driver ols_driver_info; #endif @@ -235,9 +232,6 @@ static struct sr_dev_driver *drivers_list[] = { &mic_98581_driver_info, &mic_98583_driver_info, #endif -#ifdef HAVE_HW_NEXUS_OSCIPRIME - &nexus_osciprime_driver_info, -#endif #ifdef HAVE_HW_OLS &ols_driver_info, #endif