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 - mic-985xx
- norma-dmm - norma-dmm
- openbench-logic-sniffer - openbench-logic-sniffer
- rigol-ds1xx2 - rigol-ds
- serial-dmm - serial-dmm
- teleinfo - teleinfo
- tondaj-sl-814 - tondaj-sl-814
@ -118,7 +118,7 @@ The following drivers/devices do not require a serial port specification:
- ikalogic-scanaplus - ikalogic-scanaplus
- kecheng-kc-330b - kecheng-kc-330b
- lascar-el-usb - lascar-el-usb
- rigol-ds1xx2 - rigol-ds
- saleae-logic16 - saleae-logic16
- uni-t-dmm - uni-t-dmm
- uni-t-ut32x - uni-t-ut32x
@ -344,12 +344,12 @@ Example:
$ sigrok-cli --driver ols:conn=/dev/ttyACM0 ... $ 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) The 'rigol-ds' driver (for the Rigol DS series DSOs) currently uses the Linux
currently uses the Linux usbtmc kernel driver. This means it can currently usbtmc kernel driver. This means it can currently only be built and used on
only be built and used on Linux (i.e., it's non-portable). Linux (i.e., it's non-portable).
The use of a kernel module also means it is dependent on the kernel version 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. 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 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 library (which uses libusb) soon, which will fix all these issues and make
the driver portable at the same time. 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="$enableval"],
[HW_OLS=$HW_ENABLED_DEFAULT]) [HW_OLS=$HW_ENABLED_DEFAULT])
AC_ARG_ENABLE(rigol-ds1xx2, AC_HELP_STRING([--enable-rigol-ds1xx2], AC_ARG_ENABLE(rigol-ds, AC_HELP_STRING([--enable-rigol-ds],
[enable Rigol DS1xx2 support [default=yes]]), [enable Rigol DS support [default=yes]]),
[HW_RIGOL_DS1XX2="$enableval"], [HW_RIGOL_DS="$enableval"],
[HW_RIGOL_DS1XX2=$HW_ENABLED_DEFAULT]) [HW_RIGOL_DS=$HW_ENABLED_DEFAULT])
AC_ARG_ENABLE(saleae-logic16, AC_HELP_STRING([--enable-saleae-logic16], AC_ARG_ENABLE(saleae-logic16, AC_HELP_STRING([--enable-saleae-logic16],
[enable Saleae Logic16 support [default=yes]]), [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"]) LIBS="$LIBS $check_LIBS"], [have_check="no"])
AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes") 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). # (though it is planned to rewrite the driver to be portable later).
# Thus, it will be disabled for non-Linux builds for now. # Thus, it will be disabled for non-Linux builds for now.
case "$host" in case "$host" in
*linux*) *linux*)
# Do nothing. Whether the driver is enabled is determined by the # Do nothing. Whether the driver is enabled is determined by the
# previous --enable-all-drivers/--disable-all-drivers and/or any # 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. # Disable the driver for builds that don't target Linux.
HW_RIGOL_DS1XX2="no" HW_RIGOL_DS="no"
;; ;;
esac esac
@ -458,9 +458,9 @@ if test "x$HW_OLS" = "xyes"; then
AC_DEFINE(HAVE_HW_OLS, 1, [OpenBench Logic Sniffer (OLS) support]) AC_DEFINE(HAVE_HW_OLS, 1, [OpenBench Logic Sniffer (OLS) support])
fi fi
AM_CONDITIONAL(HW_RIGOL_DS1XX2, test x$HW_RIGOL_DS1XX2 = xyes) AM_CONDITIONAL(HW_RIGOL_DS, test x$HW_RIGOL_DS = xyes)
if test "x$HW_RIGOL_DS1XX2" = "xyes"; then if test "x$HW_RIGOL_DS" = "xyes"; then
AC_DEFINE(HAVE_HW_RIGOL_DS1XX2, 1, [Rigol DS1xx2 support]) AC_DEFINE(HAVE_HW_RIGOL_DS, 1, [Rigol DS support])
fi fi
AM_CONDITIONAL(HW_SALEAE_LOGIC16, test x$HW_SALEAE_LOGIC16 = xyes) 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/kecheng-kc-330b/Makefile
hardware/lascar-el-usb/Makefile hardware/lascar-el-usb/Makefile
hardware/mic-985xx/Makefile hardware/mic-985xx/Makefile
hardware/rigol-ds1xx2/Makefile hardware/rigol-ds/Makefile
hardware/saleae-logic16/Makefile hardware/saleae-logic16/Makefile
hardware/teleinfo/Makefile hardware/teleinfo/Makefile
hardware/tondaj-sl-814/Makefile hardware/tondaj-sl-814/Makefile
@ -625,7 +625,7 @@ echo " - link-mso19 (EXPERIMENTAL)....... $HW_LINK_MSO19"
echo " - mic-985xx....................... $HW_MIC_985XX" echo " - mic-985xx....................... $HW_MIC_985XX"
echo " - norma-dmm....................... $HW_NORMA_DMM" echo " - norma-dmm....................... $HW_NORMA_DMM"
echo " - openbench-logic-sniffer......... $HW_OLS" 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 " - saleae-logic16.................. $HW_SALEAE_LOGIC16"
echo " - serial-dmm...................... $HW_SERIAL_DMM" echo " - serial-dmm...................... $HW_SERIAL_DMM"
echo " - teleinfo........................ $HW_TELEINFO" 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. # Rigol DS1xx2 output is currently always 600 samples in size.
# This script currently also assumes only one channel is acquired like this: # 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] \ plot [0:600] \
"sigrok_gnuplot.dat" using 1 with lines linewidth 2 title "CH1" "sigrok_gnuplot.dat" using 1 with lines linewidth 2 title "CH1"

View File

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

View File

@ -17,17 +17,17 @@
## along with this program. If not, see <http://www.gnu.org/licenses/>. ## 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! # 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 \ api.c \
protocol.c \ protocol.c \
protocol.h protocol.h
libsigrok_hw_rigol_ds1xx2_la_CFLAGS = \ libsigrok_hw_rigol_ds_la_CFLAGS = \
-I$(top_srcdir) -I$(top_srcdir)
endif endif

View File

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

View File

@ -29,7 +29,7 @@
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
#include "protocol.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_dev_inst *sdi;
struct sr_serial_dev_inst *serial; 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 /* We got the frame for the first analog channel, but
* there's a second analog channel. */ * there's a second analog channel. */
devc->channel_frame = devc->enabled_analog_probes->next->data; 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]); devc->channel_frame->name[2]);
} else { } else {
/* Done with both analog channels in this frame. */ /* 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) { && devc->channel_frame != devc->enabled_digital_probes->data) {
/* Now we need to get the digital data. */ /* Now we need to get the digital data. */
devc->channel_frame = devc->enabled_digital_probes->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) { } else if (++devc->num_frames == devc->limit_frames) {
/* End of last frame. */ /* End of last frame. */
packet.type = SR_DF_END; 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. */ /* Get the next frame, starting with the first analog channel. */
if (devc->enabled_analog_probes) { if (devc->enabled_analog_probes) {
devc->channel_frame = devc->enabled_analog_probes->data; 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]); devc->channel_frame->name[2]);
} else { } else {
devc->channel_frame = devc->enabled_digital_probes->data; 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; 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; va_list args;
char buf[256]; char buf[256];
@ -171,7 +171,7 @@ static int get_cfg(const struct sr_dev_inst *sdi, char *cmd, char *reply)
{ {
int len; int len;
if (rigol_ds1xx2_send(sdi, cmd) != SR_OK) if (rigol_ds_send(sdi, cmd) != SR_OK)
return SR_ERR; return SR_ERR;
if ((len = serial_read(sdi->conn, reply, 255)) < 0) 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; 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; struct dev_context *devc;
char *t_s, *cmd; char *t_s, *cmd;

View File

@ -18,15 +18,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBSIGROK_HARDWARE_RIGOL_DS1XX2_PROTOCOL_H #ifndef LIBSIGROK_HARDWARE_RIGOL_DS_PROTOCOL_H
#define LIBSIGROK_HARDWARE_RIGOL_DS1XX2_PROTOCOL_H #define LIBSIGROK_HARDWARE_RIGOL_DS_PROTOCOL_H
#include <stdint.h> #include <stdint.h>
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ /* 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_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
#define sr_spew(s, args...) sr_spew(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_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
@ -69,8 +69,8 @@ struct dev_context {
struct sr_probe *channel_frame; struct sr_probe *channel_frame;
}; };
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);
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, ...);
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);
#endif #endif

View File

@ -148,8 +148,8 @@ extern SR_PRIV struct sr_dev_driver norma_dmm_driver_info;
#ifdef HAVE_HW_OLS #ifdef HAVE_HW_OLS
extern SR_PRIV struct sr_dev_driver ols_driver_info; extern SR_PRIV struct sr_dev_driver ols_driver_info;
#endif #endif
#ifdef HAVE_HW_RIGOL_DS1XX2 #ifdef HAVE_HW_RIGOL_DS
extern SR_PRIV struct sr_dev_driver rigol_ds1xx2_driver_info; extern SR_PRIV struct sr_dev_driver rigol_ds_driver_info;
#endif #endif
#ifdef HAVE_HW_SALEAE_LOGIC16 #ifdef HAVE_HW_SALEAE_LOGIC16
extern SR_PRIV struct sr_dev_driver saleae_logic16_driver_info; 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 #ifdef HAVE_HW_OLS
&ols_driver_info, &ols_driver_info,
#endif #endif
#ifdef HAVE_HW_RIGOL_DS1XX2 #ifdef HAVE_HW_RIGOL_DS
&rigol_ds1xx2_driver_info, &rigol_ds_driver_info,
#endif #endif
#ifdef HAVE_HW_SALEAE_LOGIC16 #ifdef HAVE_HW_SALEAE_LOGIC16
&saleae_logic16_driver_info, &saleae_logic16_driver_info,