From: Soeren Apel Date: Mon, 25 Aug 2014 11:09:42 +0000 (+0200) Subject: yokogawa-dlm: Integrate driver skeleton X-Git-Tag: libsigrok-0.4.0~1071 X-Git-Url: http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=107639373df3d592961eb70111e6f4ccb36f74fa yokogawa-dlm: Integrate driver skeleton --- diff --git a/Makefile.am b/Makefile.am index 56d6230c..3087649c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -332,6 +332,14 @@ libsigrok_la_SOURCES += \ src/hardware/victor-dmm/protocol.c \ src/hardware/victor-dmm/api.c endif +if HW_YOKOGAWA_DLM +libsigrok_la_SOURCES += \ + src/hardware/yokogawa-dlm/protocol.h \ + src/hardware/yokogawa-dlm/protocol.c \ + src/hardware/yokogawa-dlm/protocol_wrappers.h \ + src/hardware/yokogawa-dlm/protocol_wrappers.c \ + src/hardware/yokogawa-dlm/api.c +endif if HW_ZEROPLUS_LOGIC_CUBE libsigrok_la_SOURCES += \ src/hardware/zeroplus-logic-cube/analyzer.c \ diff --git a/README.devices b/README.devices index 0f089f10..1ea445bc 100644 --- a/README.devices +++ b/README.devices @@ -83,6 +83,7 @@ The following drivers/devices do not need any firmware upload: - uni-t-dmm (including all subdrivers) - uni-t-ut32x - victor-dmm + - yokogawa-dlm - zeroplus-logic-cube @@ -141,6 +142,7 @@ The following drivers/devices do not require a serial port specification: - uni-t-dmm (including all subdrivers) - uni-t-ut32x - victor-dmm + - yokogawa-dlm (USBTMC or TCP) - zeroplus-logic-cube diff --git a/configure.ac b/configure.ac index d5a9e896..a60450cd 100644 --- a/configure.ac +++ b/configure.ac @@ -140,6 +140,7 @@ DRIVER([Tondaj SL-814], [tondaj-sl-814]) DRIVER([UNI-T DMM], [uni-t-dmm]) DRIVER([UNI-T UT32x], [uni-t-ut32x]) DRIVER([Victor DMM], [victor-dmm]) +DRIVER([Yokogawa DL/DLM], [yokogawa-dlm]) DRIVER([ZEROPLUS Logic Cube], [zeroplus-logic-cube]) AC_ARG_ENABLE(libserialport, @@ -638,6 +639,11 @@ if test "x$HW_VICTOR_DMM" = "xyes"; then AC_DEFINE(HAVE_HW_VICTOR_DMM, 1, [Victor DMM support]) fi +AM_CONDITIONAL(HW_YOKOGAWA_DLM, test x$HW_YOKOGAWA_DLM = xyes) +if test "x$HW_YOKOGAWA_DLM" = "xyes"; then + AC_DEFINE(HAVE_HW_YOKOGAWA_DLM, 1, [Yokogawa DL/DLM support]) +fi + AM_CONDITIONAL(HW_ZEROPLUS_LOGIC_CUBE, test x$HW_ZEROPLUS_LOGIC_CUBE = xyes) if test "x$HW_ZEROPLUS_LOGIC_CUBE" = "xyes"; then AC_DEFINE(HAVE_HW_ZEROPLUS_LOGIC_CUBE, 1, [ZEROPLUS Logic Cube support]) diff --git a/src/drivers.c b/src/drivers.c index 14936789..ff13f912 100644 --- a/src/drivers.c +++ b/src/drivers.c @@ -187,6 +187,9 @@ extern SR_PRIV struct sr_dev_driver uni_t_ut32x_driver_info; #ifdef HAVE_HW_VICTOR_DMM extern SR_PRIV struct sr_dev_driver victor_dmm_driver_info; #endif +#ifdef HAVE_HW_YOKOGAWA_DLM +extern SR_PRIV struct sr_dev_driver yokogawa_dlm_driver_info; +#endif #ifdef HAVE_HW_ZEROPLUS_LOGIC_CUBE extern SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info; #endif @@ -358,6 +361,9 @@ SR_PRIV struct sr_dev_driver *drivers_list[] = { #ifdef HAVE_HW_VICTOR_DMM &victor_dmm_driver_info, #endif +#ifdef HAVE_HW_YOKOGAWA_DLM + &yokogawa_dlm_driver_info, +#endif #ifdef HAVE_HW_ZEROPLUS_LOGIC_CUBE &zeroplus_logic_cube_driver_info, #endif diff --git a/src/hardware/yokogawa-dlm/api.c b/src/hardware/yokogawa-dlm/api.c new file mode 100644 index 00000000..614c4a7a --- /dev/null +++ b/src/hardware/yokogawa-dlm/api.c @@ -0,0 +1,42 @@ +/* + * This file is part of the libsigrok project. + * + * Copyright (C) 2014 abraxa (Soeren Apel) + * Based on the Hameg HMO driver by poljar (Damir Jelić) + * + * 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 "protocol.h" + + +SR_PRIV struct sr_dev_driver yokogawa_dlm_driver_info = { + .name = "yokogawa-dlm", + .longname = "Yokogawa DL/DLM driver", + .api_version = 1, + .init = NULL, + .cleanup = NULL, + .scan = NULL, + .dev_list = NULL, + .dev_clear = NULL, + .config_get = NULL, + .config_set = NULL, + .config_list = NULL, + .dev_open = NULL, + .dev_close = NULL, + .dev_acquisition_start = NULL, + .dev_acquisition_stop = NULL, + .priv = NULL, +}; diff --git a/src/hardware/yokogawa-dlm/protocol.c b/src/hardware/yokogawa-dlm/protocol.c new file mode 100644 index 00000000..1849b8b8 --- /dev/null +++ b/src/hardware/yokogawa-dlm/protocol.c @@ -0,0 +1,22 @@ +/* + * This file is part of the libsigrok project. + * + * Copyright (C) 2014 abraxa (Soeren Apel) + * Based on the Hameg HMO driver by poljar (Damir Jelić) + * + * 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 "protocol.h" + diff --git a/src/hardware/yokogawa-dlm/protocol.h b/src/hardware/yokogawa-dlm/protocol.h new file mode 100644 index 00000000..dc8ac25b --- /dev/null +++ b/src/hardware/yokogawa-dlm/protocol.h @@ -0,0 +1,30 @@ +/* + * This file is part of the libsigrok project. + * + * Copyright (C) 2014 abraxa (Soeren Apel) + * Based on the Hameg HMO driver by poljar (Damir Jelić) + * + * 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_YOKOGAWA_DLM_PROTOCOL_H +#define LIBSIGROK_HARDWARE_YOKOGAWA_DLM_PROTOCOL_H + +#include +#include +#include +#include "libsigrok.h" +#include "libsigrok-internal.h" + +#endif diff --git a/src/hardware/yokogawa-dlm/protocol_wrappers.c b/src/hardware/yokogawa-dlm/protocol_wrappers.c new file mode 100644 index 00000000..53599460 --- /dev/null +++ b/src/hardware/yokogawa-dlm/protocol_wrappers.c @@ -0,0 +1,21 @@ +/* + * This file is part of the libsigrok project. + * + * Copyright (C) 2014 abraxa (Soeren Apel) + * + * 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 "protocol_wrappers.h" + diff --git a/src/hardware/yokogawa-dlm/protocol_wrappers.h b/src/hardware/yokogawa-dlm/protocol_wrappers.h new file mode 100644 index 00000000..40fb8309 --- /dev/null +++ b/src/hardware/yokogawa-dlm/protocol_wrappers.h @@ -0,0 +1,30 @@ +/* + * This file is part of the libsigrok project. + * + * Copyright (C) 2014 abraxa (Soeren Apel) + * + * 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_YOKOGAWA_DLM_PROTOCOL_WRAPPERS_H +#define LIBSIGROK_HARDWARE_YOKOGAWA_DLM_PROTOCOL_WRAPPERS_H + +#include +#include +#include +#include "libsigrok.h" +#include "libsigrok-internal.h" +#include "protocol.h" + +#endif