aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/multi_usrp_rfnoc.cpp
diff options
context:
space:
mode:
authormattprost <matt.prost@ni.com>2021-12-16 13:48:26 -0600
committerAaron Rossetto <aaron.rossetto@ni.com>2022-04-07 13:28:02 -0700
commitb8acf58798018f5fb4d84d470badadce5dd3a08d (patch)
tree137db7eeff0d3bbc202b228fd4bee4f143b1b467 /host/lib/usrp/multi_usrp_rfnoc.cpp
parenta8ad4917d331258e163e1786c0325a4b7e7d2e3e (diff)
downloaduhd-b8acf58798018f5fb4d84d470badadce5dd3a08d.tar.gz
uhd-b8acf58798018f5fb4d84d470badadce5dd3a08d.tar.bz2
uhd-b8acf58798018f5fb4d84d470badadce5dd3a08d.zip
n310: Add Filter API to n310
Add the Filter API to n3xx specifically for the AD937x device. The TX filter is limited to 32 taps, and the RX filter is limited to 48 taps. This feature requires MPM version 4.2 or later on the device. Co-authored-by: bpadalino <bpadalino@gmail.com> Signed-off-by: mattprost <matt.prost@ni.com>
Diffstat (limited to 'host/lib/usrp/multi_usrp_rfnoc.cpp')
-rw-r--r--host/lib/usrp/multi_usrp_rfnoc.cpp38
1 files changed, 22 insertions, 16 deletions
diff --git a/host/lib/usrp/multi_usrp_rfnoc.cpp b/host/lib/usrp/multi_usrp_rfnoc.cpp
index 00e386b71..270e86ca4 100644
--- a/host/lib/usrp/multi_usrp_rfnoc.cpp
+++ b/host/lib/usrp/multi_usrp_rfnoc.cpp
@@ -17,6 +17,7 @@
#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/utils/graph_utils.hpp>
#include <uhd/utils/math.hpp>
+#include <uhd/utils/string.hpp>
#include <uhdlib/rfnoc/rfnoc_device.hpp>
#include <uhdlib/rfnoc/rfnoc_rx_streamer.hpp>
#include <uhdlib/rfnoc/rfnoc_tx_streamer.hpp>
@@ -2229,11 +2230,13 @@ public:
const std::string& name, const size_t chan) override
{
try {
+ // Get the blockid and filtername separated from the name string
+ const auto names = string::split(name, ":");
+ const auto& blockid = names.first;
+ const auto& filter_name = names.second;
// The block_id_t constructor is pretty smart; let it handle the parsing.
- block_id_t block_id(name);
- auto rx_chan = _get_rx_chan(chan);
- // The filter name is the `name` after the BLOCK_ID and a `:`
- std::string filter_name = name.substr(block_id.to_string().size() + 1);
+ block_id_t block_id(blockid);
+ const auto rx_chan = _get_rx_chan(chan);
// Try to dynamic cast either the radio or the DDC to a filter_node, and call
// its filter function
auto block_ctrl = [rx_chan, block_id, chan]() -> noc_block_base::sptr {
@@ -2270,11 +2273,12 @@ public:
{
MUX_RX_API_CALL(set_rx_filter, name, filter);
try {
+ const auto names = string::split(name, ":");
+ const auto& blockid = names.first;
+ const auto& filter_name = names.second;
// The block_id_t constructor is pretty smart; let it handle the parsing.
- block_id_t block_id(name);
- auto rx_chan = _get_rx_chan(chan);
- // The filter name is the `name` after the BLOCK_ID and a `:`
- std::string filter_name = name.substr(block_id.to_string().size() + 1);
+ block_id_t block_id(blockid);
+ const auto rx_chan = _get_rx_chan(chan);
// Try to dynamic cast either the radio or the DDC to a filter_node, and call
// its filter function
auto block_ctrl = [rx_chan, block_id, chan]() -> noc_block_base::sptr {
@@ -2352,11 +2356,12 @@ public:
const std::string& name, const size_t chan) override
{
try {
+ const auto names = string::split(name, ":");
+ const auto& blockid = names.first;
+ const auto& filter_name = names.second;
// The block_id_t constructor is pretty smart; let it handle the parsing.
- block_id_t block_id(name);
- auto tx_chan = _get_tx_chan(chan);
- // The filter name is the `name` after the BLOCK_ID and a `:`
- std::string filter_name = name.substr(block_id.to_string().size() + 1);
+ block_id_t block_id(blockid);
+ const auto tx_chan = _get_tx_chan(chan);
// Try to dynamic cast either the radio or the DUC to a filter_node, and call
// its filter function
auto block_ctrl = [tx_chan, block_id, chan]() -> noc_block_base::sptr {
@@ -2393,11 +2398,12 @@ public:
{
MUX_TX_API_CALL(set_tx_filter, name, filter);
try {
+ const auto names = string::split(name, ":");
+ const auto& blockid = names.first;
+ const auto& filter_name = names.second;
// The block_id_t constructor is pretty smart; let it handle the parsing.
- block_id_t block_id(name);
- auto tx_chan = _get_tx_chan(chan);
- // The filter name is the `name` after the BLOCK_ID and a `:`
- std::string filter_name = name.substr(block_id.to_string().size() + 1);
+ block_id_t block_id(blockid);
+ const auto tx_chan = _get_tx_chan(chan);
// Try to dynamic cast either the radio or the DUC to a filter_node, and call
// its filter function
auto block_ctrl = [tx_chan, block_id, chan]() -> noc_block_base::sptr {