Rename rigol-ds1xx2 driver to rigol-ds.

This commit is contained in:
Martin Ling 2013-10-31 17:31:39 +00:00
parent 6c57446d41
commit 3086efdd73
9 changed files with 57 additions and 58 deletions

View File

@ -66,7 +66,7 @@ The following drivers/devices do not need any firmware upload:
- mic-985xx
- norma-dmm
- openbench-logic-sniffer
- rigol-ds1xx2
- rigol-ds
- serial-dmm
- teleinfo
- tondaj-sl-814
@ -118,7 +118,7 @@ The following drivers/devices do not require a serial port specification:
- ikalogic-scanaplus
- kecheng-kc-330b
- lascar-el-usb
- rigol-ds1xx2
- rigol-ds
- saleae-logic16
- uni-t-dmm
- uni-t-ut32x
@ -344,12 +344,12 @@ Example:
$ sigrok-cli --driver ols:conn=/dev/ttyACM0 ...
Rigol DS1xx2 oscilloscopes
--------------------------
Rigol DS oscilloscopes
----------------------
The 'rigol-ds1xx2' driver (for the Rigol DS1052E and some other, similar DSOs)
currently uses the Linux usbtmc kernel driver. This means it can currently
only be built and used on Linux (i.e., it's non-portable).
The 'rigol-ds' driver (for the Rigol DS series DSOs) currently uses the Linux
usbtmc kernel driver. This means it can currently only be built and used on
Linux (i.e., it's non-portable).
The use of a kernel module also means it is dependent on the kernel version
used, as well as on whether this specific module is available in the kernel.
@ -360,4 +360,3 @@ module as opposed to a libusb-based driver that works in user-space.
We plan to change the driver to use the 'librevisa' user-space shared
library (which uses libusb) soon, which will fix all these issues and make
the driver portable at the same time.

View File

@ -189,10 +189,10 @@ AC_ARG_ENABLE(ols, AC_HELP_STRING([--enable-ols],
[HW_OLS="$enableval"],
[HW_OLS=$HW_ENABLED_DEFAULT])
AC_ARG_ENABLE(rigol-ds1xx2, AC_HELP_STRING([--enable-rigol-ds1xx2],
[enable Rigol DS1xx2 support [default=yes]]),
[HW_RIGOL_DS1XX2="$enableval"],
[HW_RIGOL_DS1XX2=$HW_ENABLED_DEFAULT])
AC_ARG_ENABLE(rigol-ds, AC_HELP_STRING([--enable-rigol-ds],
[enable Rigol DS support [default=yes]]),
[HW_RIGOL_DS="$enableval"],
[HW_RIGOL_DS=$HW_ENABLED_DEFAULT])
AC_ARG_ENABLE(saleae-logic16, AC_HELP_STRING([--enable-saleae-logic16],
[enable Saleae Logic16 support [default=yes]]),
@ -334,18 +334,18 @@ PKG_CHECK_MODULES([check], [check >= 0.9.4],
LIBS="$LIBS $check_LIBS"], [have_check="no"])
AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
# The Rigol DS1xx2 driver currently uses the Linux kernel usbtmc module
# The Rigol DS driver currently uses the Linux kernel usbtmc module
# (though it is planned to rewrite the driver to be portable later).
# Thus, it will be disabled for non-Linux builds for now.
case "$host" in
*linux*)
# Do nothing. Whether the driver is enabled is determined by the
# previous --enable-all-drivers/--disable-all-drivers and/or any
# --enable-rigol-ds1xx2/--disable-rigol-ds1xx2 options.
# --enable-rigol-ds/--disable-rigol-ds options.
;;
*)
# Disable the driver for builds that don't target Linux.
HW_RIGOL_DS1XX2="no"
HW_RIGOL_DS="no"
;;
esac
@ -458,9 +458,9 @@ if test "x$HW_OLS" = "xyes"; then
AC_DEFINE(HAVE_HW_OLS, 1, [OpenBench Logic Sniffer (OLS) support])
fi
AM_CONDITIONAL(HW_RIGOL_DS1XX2, test x$HW_RIGOL_DS1XX2 = xyes)
if test "x$HW_RIGOL_DS1XX2" = "xyes"; then
AC_DEFINE(HAVE_HW_RIGOL_DS1XX2, 1, [Rigol DS1xx2 support])
AM_CONDITIONAL(HW_RIGOL_DS, test x$HW_RIGOL_DS = xyes)
if test "x$HW_RIGOL_DS" = "xyes"; then
AC_DEFINE(HAVE_HW_RIGOL_DS, 1, [Rigol DS support])
fi
AM_CONDITIONAL(HW_SALEAE_LOGIC16, test x$HW_SALEAE_LOGIC16 = xyes)
@ -553,7 +553,7 @@ AC_CONFIG_FILES([Makefile version.h hardware/Makefile
hardware/kecheng-kc-330b/Makefile
hardware/lascar-el-usb/Makefile
hardware/mic-985xx/Makefile
hardware/rigol-ds1xx2/Makefile
hardware/rigol-ds/Makefile
hardware/saleae-logic16/Makefile
hardware/teleinfo/Makefile
hardware/tondaj-sl-814/Makefile
@ -625,7 +625,7 @@ echo " - link-mso19 (EXPERIMENTAL)....... $HW_LINK_MSO19"
echo " - mic-985xx....................... $HW_MIC_985XX"
echo " - norma-dmm....................... $HW_NORMA_DMM"
echo " - openbench-logic-sniffer......... $HW_OLS"
echo " - rigol-ds1xx2.................... $HW_RIGOL_DS1XX2"
echo " - rigol-ds........................ $HW_RIGOL_DS"
echo " - saleae-logic16.................. $HW_SALEAE_LOGIC16"
echo " - serial-dmm...................... $HW_SERIAL_DMM"
echo " - teleinfo........................ $HW_TELEINFO"

View File

@ -30,7 +30,7 @@ set output "sigrok_gnuplot.png"
# Rigol DS1xx2 output is currently always 600 samples in size.
# This script currently also assumes only one channel is acquired like this:
#
# $ sigrok-cli --driver rigol-ds1xx2 --frames 1 -p CH1 ...
# $ sigrok-cli --driver rigol-ds --frames 1 -p CH1 ...
#
plot [0:600] \
"sigrok_gnuplot.dat" using 1 with lines linewidth 2 title "CH1"

View File

@ -41,7 +41,7 @@ SUBDIRS = \
mic-985xx \
norma-dmm \
openbench-logic-sniffer \
rigol-ds1xx2 \
rigol-ds \
saleae-logic16 \
serial-dmm \
teleinfo \
@ -142,8 +142,8 @@ if HW_OLS
libsigrokhardware_la_LIBADD += openbench-logic-sniffer/libsigrok_hw_ols.la
endif
if HW_RIGOL_DS1XX2
libsigrokhardware_la_LIBADD += rigol-ds1xx2/libsigrok_hw_rigol_ds1xx2.la
if HW_RIGOL_DS
libsigrokhardware_la_LIBADD += rigol-ds/libsigrok_hw_rigol_ds.la
endif
if HW_SALEAE_LOGIC16

View File

@ -17,17 +17,17 @@
## along with this program. If not, see <http://www.gnu.org/licenses/>.
##
if HW_RIGOL_DS1XX2
if HW_RIGOL_DS
# Local lib, this is NOT meant to be installed!
noinst_LTLIBRARIES = libsigrok_hw_rigol_ds1xx2.la
noinst_LTLIBRARIES = libsigrok_hw_rigol_ds.la
libsigrok_hw_rigol_ds1xx2_la_SOURCES = \
libsigrok_hw_rigol_ds_la_SOURCES = \
api.c \
protocol.c \
protocol.h
libsigrok_hw_rigol_ds1xx2_la_CFLAGS = \
libsigrok_hw_rigol_ds_la_CFLAGS = \
-I$(top_srcdir)
endif

View File

@ -142,8 +142,8 @@ static const char *supported_models[] = {
"DS1152D",
};
SR_PRIV struct sr_dev_driver rigol_ds1xx2_driver_info;
static struct sr_dev_driver *di = &rigol_ds1xx2_driver_info;
SR_PRIV struct sr_dev_driver rigol_ds_driver_info;
static struct sr_dev_driver *di = &rigol_ds_driver_info;
static void clear_helper(void *priv)
{
@ -172,7 +172,7 @@ static int set_cfg(const struct sr_dev_inst *sdi, const char *format, ...)
va_start(args, format);
vsnprintf(buf, 255, format, args);
va_end(args);
if (rigol_ds1xx2_send(sdi, buf) != SR_OK)
if (rigol_ds_send(sdi, buf) != SR_OK)
return SR_ERR;
/* When setting a bunch of parameters in a row, the DS1052E scrambles
@ -358,7 +358,7 @@ static int dev_open(struct sr_dev_inst *sdi)
if (serial_open(sdi->conn, SERIAL_RDWR) != SR_OK)
return SR_ERR;
if (rigol_ds1xx2_get_dev_cfg(sdi) != SR_OK)
if (rigol_ds_get_dev_cfg(sdi) != SR_OK)
return SR_ERR;
sdi->status = SR_ST_ACTIVE;
@ -673,7 +673,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
/* Enabled channel is currently disabled, or vice versa. */
sprintf(cmd, ":CHAN%d:DISP %s", probe->index + 1,
probe->enabled ? "ON" : "OFF");
if (rigol_ds1xx2_send(sdi, cmd) != SR_OK)
if (rigol_ds_send(sdi, cmd) != SR_OK)
return SR_ERR;
}
} else if (probe->type == SR_PROBE_LOGIC) {
@ -684,7 +684,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
/* Enabled channel is currently disabled, or vice versa. */
sprintf(cmd, ":DIG%d:TURN %s", probe->index,
probe->enabled ? "ON" : "OFF");
if (rigol_ds1xx2_send(sdi, cmd) != SR_OK)
if (rigol_ds_send(sdi, cmd) != SR_OK)
return SR_ERR;
}
}
@ -692,7 +692,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
if (!devc->enabled_analog_probes && !devc->enabled_digital_probes)
return SR_ERR;
sr_source_add(serial->fd, G_IO_IN, 50, rigol_ds1xx2_receive, (void *)sdi);
sr_source_add(serial->fd, G_IO_IN, 50, rigol_ds_receive, (void *)sdi);
/* Send header packet to the session bus. */
std_session_send_df_header(cb_data, LOG_PREFIX);
@ -700,12 +700,12 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
/* Fetch the first frame. */
if (devc->enabled_analog_probes) {
devc->channel_frame = devc->enabled_analog_probes->data;
if (rigol_ds1xx2_send(sdi, ":WAV:DATA? CHAN%d",
if (rigol_ds_send(sdi, ":WAV:DATA? CHAN%d",
devc->channel_frame->index + 1) != SR_OK)
return SR_ERR;
} else {
devc->channel_frame = devc->enabled_digital_probes->data;
if (rigol_ds1xx2_send(sdi, ":WAV:DATA? DIG") != SR_OK)
if (rigol_ds_send(sdi, ":WAV:DATA? DIG") != SR_OK)
return SR_ERR;
}
@ -738,9 +738,9 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
return SR_OK;
}
SR_PRIV struct sr_dev_driver rigol_ds1xx2_driver_info = {
.name = "rigol-ds1xx2",
.longname = "Rigol DS1xx2",
SR_PRIV struct sr_dev_driver rigol_ds_driver_info = {
.name = "rigol-ds",
.longname = "Rigol DS",
.api_version = 1,
.init = init,
.cleanup = cleanup,

View File

@ -29,7 +29,7 @@
#include "libsigrok-internal.h"
#include "protocol.h"
SR_PRIV int rigol_ds1xx2_receive(int fd, int revents, void *cb_data)
SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
{
struct sr_dev_inst *sdi;
struct sr_serial_dev_inst *serial;
@ -112,7 +112,7 @@ SR_PRIV int rigol_ds1xx2_receive(int fd, int revents, void *cb_data)
/* We got the frame for the first analog channel, but
* there's a second analog channel. */
devc->channel_frame = devc->enabled_analog_probes->next->data;
rigol_ds1xx2_send(sdi, ":WAV:DATA? CHAN%c",
rigol_ds_send(sdi, ":WAV:DATA? CHAN%c",
devc->channel_frame->name[2]);
} else {
/* Done with both analog channels in this frame. */
@ -120,7 +120,7 @@ SR_PRIV int rigol_ds1xx2_receive(int fd, int revents, void *cb_data)
&& devc->channel_frame != devc->enabled_digital_probes->data) {
/* Now we need to get the digital data. */
devc->channel_frame = devc->enabled_digital_probes->data;
rigol_ds1xx2_send(sdi, ":WAV:DATA? DIG");
rigol_ds_send(sdi, ":WAV:DATA? DIG");
} else if (++devc->num_frames == devc->limit_frames) {
/* End of last frame. */
packet.type = SR_DF_END;
@ -130,11 +130,11 @@ SR_PRIV int rigol_ds1xx2_receive(int fd, int revents, void *cb_data)
/* Get the next frame, starting with the first analog channel. */
if (devc->enabled_analog_probes) {
devc->channel_frame = devc->enabled_analog_probes->data;
rigol_ds1xx2_send(sdi, ":WAV:DATA? CHAN%c",
rigol_ds_send(sdi, ":WAV:DATA? CHAN%c",
devc->channel_frame->name[2]);
} else {
devc->channel_frame = devc->enabled_digital_probes->data;
rigol_ds1xx2_send(sdi, ":WAV:DATA? DIG");
rigol_ds_send(sdi, ":WAV:DATA? DIG");
}
}
}
@ -143,7 +143,7 @@ SR_PRIV int rigol_ds1xx2_receive(int fd, int revents, void *cb_data)
return TRUE;
}
SR_PRIV int rigol_ds1xx2_send(const struct sr_dev_inst *sdi, const char *format, ...)
SR_PRIV int rigol_ds_send(const struct sr_dev_inst *sdi, const char *format, ...)
{
va_list args;
char buf[256];
@ -171,7 +171,7 @@ static int get_cfg(const struct sr_dev_inst *sdi, char *cmd, char *reply)
{
int len;
if (rigol_ds1xx2_send(sdi, cmd) != SR_OK)
if (rigol_ds_send(sdi, cmd) != SR_OK)
return SR_ERR;
if ((len = serial_read(sdi->conn, reply, 255)) < 0)
@ -209,7 +209,7 @@ static int get_cfg_string(const struct sr_dev_inst *sdi, char *cmd, char **buf)
return SR_OK;
}
SR_PRIV int rigol_ds1xx2_get_dev_cfg(const struct sr_dev_inst *sdi)
SR_PRIV int rigol_ds_get_dev_cfg(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
char *t_s, *cmd;

View File

@ -18,15 +18,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBSIGROK_HARDWARE_RIGOL_DS1XX2_PROTOCOL_H
#define LIBSIGROK_HARDWARE_RIGOL_DS1XX2_PROTOCOL_H
#ifndef LIBSIGROK_HARDWARE_RIGOL_DS_PROTOCOL_H
#define LIBSIGROK_HARDWARE_RIGOL_DS_PROTOCOL_H
#include <stdint.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */
#define LOG_PREFIX "rigol-ds1xx2: "
#define LOG_PREFIX "rigol-ds: "
#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)
@ -69,8 +69,8 @@ struct dev_context {
struct sr_probe *channel_frame;
};
SR_PRIV int rigol_ds1xx2_receive(int fd, int revents, void *cb_data);
SR_PRIV int rigol_ds1xx2_send(const struct sr_dev_inst *sdi, const char *format, ...);
SR_PRIV int rigol_ds1xx2_get_dev_cfg(const struct sr_dev_inst *sdi);
SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data);
SR_PRIV int rigol_ds_send(const struct sr_dev_inst *sdi, const char *format, ...);
SR_PRIV int rigol_ds_get_dev_cfg(const struct sr_dev_inst *sdi);
#endif

View File

@ -148,8 +148,8 @@ extern SR_PRIV struct sr_dev_driver norma_dmm_driver_info;
#ifdef HAVE_HW_OLS
extern SR_PRIV struct sr_dev_driver ols_driver_info;
#endif
#ifdef HAVE_HW_RIGOL_DS1XX2
extern SR_PRIV struct sr_dev_driver rigol_ds1xx2_driver_info;
#ifdef HAVE_HW_RIGOL_DS
extern SR_PRIV struct sr_dev_driver rigol_ds_driver_info;
#endif
#ifdef HAVE_HW_SALEAE_LOGIC16
extern SR_PRIV struct sr_dev_driver saleae_logic16_driver_info;
@ -274,8 +274,8 @@ static struct sr_dev_driver *drivers_list[] = {
#ifdef HAVE_HW_OLS
&ols_driver_info,
#endif
#ifdef HAVE_HW_RIGOL_DS1XX2
&rigol_ds1xx2_driver_info,
#ifdef HAVE_HW_RIGOL_DS
&rigol_ds_driver_info,
#endif
#ifdef HAVE_HW_SALEAE_LOGIC16
&saleae_logic16_driver_info,