aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b200
diff options
context:
space:
mode:
authorLane Kolbly <lane.kolbly@ni.com>2021-10-14 13:15:48 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2021-10-27 07:56:33 -0700
commit62d467f3fc024f6a43abca9c3a2b194b5d3829bf (patch)
tree45e13cf7624f0539febb37478c305e05055d7cb5 /host/lib/usrp/b200
parent4e6531f30648ede5be8f93fa49fdcd4973b73813 (diff)
downloaduhd-62d467f3fc024f6a43abca9c3a2b194b5d3829bf.tar.gz
uhd-62d467f3fc024f6a43abca9c3a2b194b5d3829bf.tar.bz2
uhd-62d467f3fc024f6a43abca9c3a2b194b5d3829bf.zip
host: gpio: Create gpio_atr_offsets to store GPIO registers
Refactors register addresses into a gpio_atr_offsets structure which contains the various register addresses. This allows creating other devices with different GPIO register layouts with greater ease, and eliminates the use of macros (yay!)
Diffstat (limited to 'host/lib/usrp/b200')
-rw-r--r--host/lib/usrp/b200/b200_impl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp
index 2e2ed5a98..ed685d536 100644
--- a/host/lib/usrp/b200/b200_impl.cpp
+++ b/host/lib/usrp/b200/b200_impl.cpp
@@ -749,7 +749,8 @@ b200_impl::b200_impl(
// front panel gpio
////////////////////////////////////////////////////////////////////
_radio_perifs[0].fp_gpio =
- gpio_atr_3000::make(_radio_perifs[0].ctrl, TOREG(SR_FP_GPIO), RB32_FP_GPIO);
+ gpio_atr_3000::make(_radio_perifs[0].ctrl,
+ gpio_atr_offsets::make_default(TOREG(SR_FP_GPIO), RB32_FP_GPIO));
for (const auto& attr : gpio_attr_map) {
switch (attr.first) {
case usrp::gpio_atr::GPIO_SRC:
@@ -883,7 +884,7 @@ void b200_impl::setup_radio(const size_t dspno)
////////////////////////////////////////////////////////////////////
// Set up peripherals
////////////////////////////////////////////////////////////////////
- perif.atr = gpio_atr_3000::make_write_only(perif.ctrl, TOREG(SR_ATR));
+ perif.atr = gpio_atr_3000::make(perif.ctrl, gpio_atr_offsets::make_write_only(TOREG(SR_ATR)));
perif.atr->set_atr_mode(MODE_ATR, 0xFFFFFFFF);
// create rx dsp control objects
perif.framer = rx_vita_core_3000::make(perif.ctrl, TOREG(SR_RX_CTRL));