aboutsummaryrefslogtreecommitdiffstats
path: root/src/OfdmGenerator.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2024-11-11 10:51:29 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2024-11-11 10:51:29 +0100
commitb6a6cfc5636713e3f7b79d3ac12c9a2b31661549 (patch)
treeccf70adb94b39dfe4469b152a44f179f9b65fb63 /src/OfdmGenerator.cpp
parent767d69622770a4bb886f527eaa2e1e2a15a71309 (diff)
downloaddabmod-b6a6cfc5636713e3f7b79d3ac12c9a2b31661549.tar.gz
dabmod-b6a6cfc5636713e3f7b79d3ac12c9a2b31661549.tar.bz2
dabmod-b6a6cfc5636713e3f7b79d3ac12c9a2b31661549.zip
Initialise FFT Accelerator GPIO config
Diffstat (limited to 'src/OfdmGenerator.cpp')
-rw-r--r--src/OfdmGenerator.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/OfdmGenerator.cpp b/src/OfdmGenerator.cpp
index 23cece0..d6698c2 100644
--- a/src/OfdmGenerator.cpp
+++ b/src/OfdmGenerator.cpp
@@ -599,6 +599,27 @@ OfdmGeneratorDEXTER::OfdmGeneratorDEXTER(size_t nbSymbols,
etiLog.level(info) << "Using DEXTER FFT Accelerator for fixed-point transform";
+ // I tried to get this to work in code using libgpiod, but life is too short to waste time on that.
+ // It works through gpioset, so we just call it
+ // The GPIO is connected to the config AXI bus of the xfft block.
+ // 15..0 is the config data; 31 is tvalid
+ if (inverse) {
+ if (system("gpioset gpiochip0 0=0 31=0") != 0)
+ throw std::runtime_error("Failed to call gpioset #1");
+ if (system("gpioset gpiochip0 0=0 31=1") != 0)
+ throw std::runtime_error("Failed to call gpioset #2");
+ if (system("gpioset gpiochip0 0=0 31=0") != 0)
+ throw std::runtime_error("Failed to call gpioset #3");
+ }
+ else {
+ if (system("gpioset gpiochip0 0=1 31=0") != 0)
+ throw std::runtime_error("Failed to call gpioset #1");
+ if (system("gpioset gpiochip0 0=1 31=1") != 0)
+ throw std::runtime_error("Failed to call gpioset #2");
+ if (system("gpioset gpiochip0 0=1 31=0") != 0)
+ throw std::runtime_error("Failed to call gpioset #3");
+ }
+
if (nbCarriers > spacing) {
throw std::runtime_error("OfdmGenerator nbCarriers > spacing!");
}