/*
 * Copyright 2021 Free Software Foundation, Inc.
 *
 * This file is part of GNU Radio
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 */

/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited  */
/* The following lines can be configured to regenerate this file during cmake      */
/* If manual edits are made, the following tags should be modified accordingly.    */
/* BINDTOOL_GEN_AUTOMATIC(0)                                                       */
/* BINDTOOL_USE_PYGCCXML(0)                                                        */
/* BINDTOOL_HEADER_FILE(iio_types.h)                                        */
/* BINDTOOL_HEADER_FILE_HASH(77b1d523bd8cf53e30fcb42f41c6ed8d)                     */
/***********************************************************************************/

#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

namespace py = pybind11;

#include <gnuradio/iio/iio_types.h>

void bind_iio_types(py::module& m)
{
    py::enum_<gr::iio::data_type_t>(m, "data_type_t")
        .value("DOUBLE", gr::iio::data_type_t::DOUBLE)
        .value("FLOAT", gr::iio::data_type_t::FLOAT)
        .value("LONGLONG", gr::iio::data_type_t::LONGLONG)
        .value("INT", gr::iio::data_type_t::INT)
        .value("UINT8", gr::iio::data_type_t::UINT8)
        .export_values();

    py::enum_<gr::iio::attr_type_t>(m, "attr_type_t")
        .value("CHANNEL", gr::iio::attr_type_t::CHANNEL)
        .value("DEVICE", gr::iio::attr_type_t::DEVICE)
        .value("DEVICE_BUFFER", gr::iio::attr_type_t::DEVICE_BUFFER)
        .value("DEVICE_DEBUG", gr::iio::attr_type_t::DEVICE_DEBUG)
        .value("DIRECT_REGISTER_ACCESS", gr::iio::attr_type_t::DIRECT_REGISTER_ACCESS)
        .export_values();

    py::implicitly_convertible<int, gr::iio::data_type_t>();
    py::implicitly_convertible<int, gr::iio::attr_type_t>();

    py::class_<gr::iio::iio_param_t, std::shared_ptr<gr::iio::iio_param_t>>(m,
                                                                            "iio_param_t")
        .def(py::init<const std::string&>())
        .def(py::init<const std::string&, gr::iio::iio_param_value_t>());

    py::implicitly_convertible<std::string, gr::iio::iio_param_t>();
}
