From 8743a23066d779dbfbd6d93467cd9cd36fd00e01 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 6 Sep 2011 18:18:11 -0400 Subject: shd: adding a component gr-shd as an interface to the Symplex Hardware X-Mini system. Mostly cribbed from gr-uhd. --- gr-shd/swig/shd_swig.i | 135 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 gr-shd/swig/shd_swig.i (limited to 'gr-shd/swig/shd_swig.i') diff --git a/gr-shd/swig/shd_swig.i b/gr-shd/swig/shd_swig.i new file mode 100644 index 000000000..8d19c1680 --- /dev/null +++ b/gr-shd/swig/shd_swig.i @@ -0,0 +1,135 @@ +/* -*- c++ -*- */ +/* + * Copyright 2011 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio 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, or (at your option) + * any later version. + * + * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// Defined during configure; avoids trying to locate +// header files if SHD was not installed. +#ifdef GR_HAVE_SHD + +#define GR_SHD_API + +//////////////////////////////////////////////////////////////////////// +// Language independent exception handler +//////////////////////////////////////////////////////////////////////// +%include exception.i + +%exception { + try { + $action + } + catch(std::exception &e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(...) { + SWIG_exception(SWIG_RuntimeError, "Unknown exception"); + } + +} + +//////////////////////////////////////////////////////////////////////// +// standard includes +//////////////////////////////////////////////////////////////////////// +%include "gnuradio.i" + +//////////////////////////////////////////////////////////////////////// +// block headers +//////////////////////////////////////////////////////////////////////// +%{ +#include +#include +%} + +//////////////////////////////////////////////////////////////////////// +// used types +//////////////////////////////////////////////////////////////////////// +%template(string_vector_t) std::vector; + +%include + +%include + +%ignore shd::dict::operator[]; //ignore warnings about %extend +%include +%template(string_string_dict_t) shd::dict; //define after dict + +%include + +%include + +%template(range_vector_t) std::vector; //define before range +%include + +%include + +%include + +%include + +%include + +%include + +%include + +%ignore shd::device::register_device; //causes compile to choke in MSVC +%include +%template(device_addr_vector_t) std::vector; + +%include + +//////////////////////////////////////////////////////////////////////// +// swig dboard_iface for python access +//////////////////////////////////////////////////////////////////////// +%include stdint.i +%include +%template(byte_vector_t) std::vector; +%include + +%template(dboard_iface_sptr) boost::shared_ptr; + +//////////////////////////////////////////////////////////////////////// +// block magic +//////////////////////////////////////////////////////////////////////// +GR_SWIG_BLOCK_MAGIC(shd,xmini_source) +%include + +GR_SWIG_BLOCK_MAGIC(shd,xmini_sink) +%include + +//////////////////////////////////////////////////////////////////////// +// helpful constants +//////////////////////////////////////////////////////////////////////// +%{ +static const size_t ALL_MBOARDS = shd::xmini::multi_xmini::ALL_MBOARDS; +%} +static const size_t ALL_MBOARDS; + +#if SWIGGUILE +%scheme %{ +(load-extension-global "libguile-gnuradio-shd_swig" "scm_init_gnuradio_shd_swig_module") +%} + +%goops %{ +(use-modules (gnuradio gnuradio_core_runtime)) +%} +#endif /* SWIGGUILE */ + +#endif /* GR_HAVE_SHD */ -- cgit From dfda3abece86bd3ba4ad51214726827cbc705c30 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 4 Oct 2011 12:58:50 -0400 Subject: shd: changed name from xmini to smini in GR interface; needs to be matched in the s-mini firmware. --- gr-shd/swig/shd_swig.i | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gr-shd/swig/shd_swig.i') diff --git a/gr-shd/swig/shd_swig.i b/gr-shd/swig/shd_swig.i index 8d19c1680..217b2f1af 100644 --- a/gr-shd/swig/shd_swig.i +++ b/gr-shd/swig/shd_swig.i @@ -53,8 +53,8 @@ // block headers //////////////////////////////////////////////////////////////////////// %{ -#include -#include +#include +#include %} //////////////////////////////////////////////////////////////////////// @@ -108,11 +108,11 @@ //////////////////////////////////////////////////////////////////////// // block magic //////////////////////////////////////////////////////////////////////// -GR_SWIG_BLOCK_MAGIC(shd,xmini_source) -%include +GR_SWIG_BLOCK_MAGIC(shd,smini_source) +%include -GR_SWIG_BLOCK_MAGIC(shd,xmini_sink) -%include +GR_SWIG_BLOCK_MAGIC(shd,smini_sink) +%include //////////////////////////////////////////////////////////////////////// // helpful constants -- cgit