diff options
author | Trung N Tran <trung.tran@ettus.com> | 2018-02-21 13:28:50 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-02-21 16:59:46 -0800 |
commit | 21cc92016c4d5c3ae99e8fb49c04793feb51c21e (patch) | |
tree | 81126a5bbd40ee9e468361d8341806b9380cc398 /host/lib/usrp/cores | |
parent | cf7667fe71c961a4656ddb961302cc5a7e5570ed (diff) | |
download | uhd-21cc92016c4d5c3ae99e8fb49c04793feb51c21e.tar.gz uhd-21cc92016c4d5c3ae99e8fb49c04793feb51c21e.tar.bz2 uhd-21cc92016c4d5c3ae99e8fb49c04793feb51c21e.zip |
usrp: Add set_gpio_attr overload that use string
1/ multi_usrp.hpp; multi_usrp.cpp: added new functions
- set_gpio_attr() that allow user to set certain attribute by string
value.
- get_gpio_string_attr() return string type value of certain attribute.
2/ gpio_defs.hpp; gpio_atr_3000.cpp : added new definition of SRC attribute.
This commit enable user to use multi_usrp api to set_gpio_attr using string
value. This is helpful; because the attribute can represent more than two state
as of old API. This enable user to set SRC (source) that drive each GPIO bank's
pin. Source can be either processing unit(PS) or radio frontend logic from FPGA
logic.
Diffstat (limited to 'host/lib/usrp/cores')
-rw-r--r-- | host/lib/usrp/cores/gpio_atr_3000.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/host/lib/usrp/cores/gpio_atr_3000.cpp b/host/lib/usrp/cores/gpio_atr_3000.cpp index 1649d27bb..6e5df02ed 100644 --- a/host/lib/usrp/cores/gpio_atr_3000.cpp +++ b/host/lib/usrp/cores/gpio_atr_3000.cpp @@ -121,6 +121,8 @@ public: //call. This API does not have a mask so it configures all bits at the same time. switch (attr) { + case GPIO_SRC: + throw uhd::runtime_error("Can't set GPIO source by GPIO ATR interface."); case GPIO_CTRL: set_atr_mode(MODE_ATR, value); //Configure mode=ATR for all bits that are set set_atr_mode(MODE_GPIO, ~value); //Configure mode=GPIO for all bits that are unset @@ -149,6 +151,9 @@ public: //Only set bits that are driven by the ATR engine set_atr_reg(ATR_REG_FULL_DUPLEX, value); break; + case GPIO_READBACK: + //This is readonly register, ignore on set. + break; default: UHD_THROW_INVALID_CODE_PATH(); } |