/*
 * Copyright 2025 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(rfnoc_fft.h)                                        */
/* BINDTOOL_HEADER_FILE_HASH(1b694012bd4488d6c6a1c5920769d6ff)                     */
/***********************************************************************************/

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

namespace py = pybind11;

#include <gnuradio/uhd/rfnoc_fft.h>
// pydoc.h is automatically generated in the build directory
#include <rfnoc_fft_pydoc.h>

void bind_rfnoc_fft(py::module& m)
{

    using rfnoc_fft = ::gr::uhd::rfnoc_fft;

    // Expose enums to Python
    py::enum_<rfnoc_fft::fft_direction>(m, "fft_direction")
        .value("REVERSE", rfnoc_fft::fft_direction::REVERSE)
        .value("FORWARD", rfnoc_fft::fft_direction::FORWARD)
        .export_values();

    py::enum_<rfnoc_fft::fft_magnitude>(m, "fft_magnitude")
        .value("COMPLEX", rfnoc_fft::fft_magnitude::COMPLEX)
        .value("MAGNITUDE", rfnoc_fft::fft_magnitude::MAGNITUDE)
        .value("MAGNITUDE_SQUARED", rfnoc_fft::fft_magnitude::MAGNITUDE_SQUARED)
        .export_values();

    py::enum_<rfnoc_fft::fft_shift>(m, "fft_shift")
        .value("NORMAL", rfnoc_fft::fft_shift::NORMAL)
        .value("REVERSE", rfnoc_fft::fft_shift::REVERSE)
        .value("NATURAL", rfnoc_fft::fft_shift::NATURAL)
        .value("BIT_REVERSE", rfnoc_fft::fft_shift::BIT_REVERSE)
        .export_values();


    py::class_<rfnoc_fft,
               gr::uhd::rfnoc_block,
               gr::block,
               gr::basic_block,
               std::shared_ptr<rfnoc_fft>>(m, "rfnoc_fft", D(rfnoc_fft))

        .def(py::init(&rfnoc_fft::make),
             py::arg("graph"),
             py::arg("block_args"),
             py::arg("device_select"),
             py::arg("instance"),
             D(rfnoc_fft, make))


        .def("set_direction",
             (void(rfnoc_fft::*)(gr::uhd::rfnoc_fft::fft_direction const)) &
                 rfnoc_fft::set_direction,
             py::arg("direction"),
             D(rfnoc_fft, set_direction, 0))


        .def("set_direction",
             (void(rfnoc_fft::*)(std::string const&)) & rfnoc_fft::set_direction,
             py::arg("direction"),
             D(rfnoc_fft, set_direction, 1))


        .def("get_direction_string",
             &rfnoc_fft::get_direction_string,
             D(rfnoc_fft, get_direction_string))


        .def("get_direction", &rfnoc_fft::get_direction, D(rfnoc_fft, get_direction))


        .def("set_magnitude",
             (void(rfnoc_fft::*)(gr::uhd::rfnoc_fft::fft_magnitude const)) &
                 rfnoc_fft::set_magnitude,
             py::arg("magnitude"),
             D(rfnoc_fft, set_magnitude, 0))


        .def("set_magnitude",
             (void(rfnoc_fft::*)(std::string const&)) & rfnoc_fft::set_magnitude,
             py::arg("magnitude"),
             D(rfnoc_fft, set_magnitude, 1))


        .def("get_magnitude_string",
             &rfnoc_fft::get_magnitude_string,
             D(rfnoc_fft, get_magnitude_string))


        .def("get_magnitude", &rfnoc_fft::get_magnitude, D(rfnoc_fft, get_magnitude))


        .def("set_shift_config",
             (void(rfnoc_fft::*)(gr::uhd::rfnoc_fft::fft_shift const)) &
                 rfnoc_fft::set_shift_config,
             py::arg("shift"),
             D(rfnoc_fft, set_shift_config, 0))


        .def("set_shift_config",
             (void(rfnoc_fft::*)(std::string const&)) & rfnoc_fft::set_shift_config,
             py::arg("shift"),
             D(rfnoc_fft, set_shift_config, 1))


        .def("get_shift_config_string",
             &rfnoc_fft::get_shift_config_string,
             D(rfnoc_fft, get_shift_config_string))


        .def("get_shift_config",
             &rfnoc_fft::get_shift_config,
             D(rfnoc_fft, get_shift_config))


        .def("set_scaling_factor",
             &rfnoc_fft::set_scaling_factor,
             py::arg("factor"),
             D(rfnoc_fft, set_scaling_factor))


        .def("set_scaling",
             &rfnoc_fft::set_scaling,
             py::arg("scaling"),
             D(rfnoc_fft, set_scaling))


        .def("get_scaling", &rfnoc_fft::get_scaling, D(rfnoc_fft, get_scaling))


        .def("set_length",
             &rfnoc_fft::set_length,
             py::arg("length"),
             D(rfnoc_fft, set_length))


        .def("get_length", &rfnoc_fft::get_length, D(rfnoc_fft, get_length))


        .def("set_bypass_mode",
             &rfnoc_fft::set_bypass_mode,
             py::arg("bypass"),
             D(rfnoc_fft, set_bypass_mode))


        .def(
            "get_bypass_mode", &rfnoc_fft::get_bypass_mode, D(rfnoc_fft, get_bypass_mode))


        .def("get_nipc", &rfnoc_fft::get_nipc, D(rfnoc_fft, get_nipc))


        .def("get_max_length", &rfnoc_fft::get_max_length, D(rfnoc_fft, get_max_length))


        .def("get_max_cp_length",
             &rfnoc_fft::get_max_cp_length,
             D(rfnoc_fft, get_max_cp_length))


        .def("get_max_cp_removal_list_length",
             &rfnoc_fft::get_max_cp_removal_list_length,
             D(rfnoc_fft, get_max_cp_removal_list_length))


        .def("get_max_cp_insertion_list_length",
             &rfnoc_fft::get_max_cp_insertion_list_length,
             D(rfnoc_fft, get_max_cp_insertion_list_length))


        .def("set_cp_insertion_list",
             &rfnoc_fft::set_cp_insertion_list,
             py::arg("cp_lengths"),
             D(rfnoc_fft, set_cp_insertion_list))


        .def("get_cp_insertion_list",
             &rfnoc_fft::get_cp_insertion_list,
             D(rfnoc_fft, get_cp_insertion_list))


        .def("set_cp_removal_list",
             &rfnoc_fft::set_cp_removal_list,
             py::arg("cp_lengths"),
             D(rfnoc_fft, set_cp_removal_list))


        .def("get_cp_removal_list",
             &rfnoc_fft::get_cp_removal_list,
             D(rfnoc_fft, get_cp_removal_list))

        ;
}
