aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-04-05 19:35:34 -0700
committerJosh Blum <josh@joshknows.com>2010-04-05 19:35:34 -0700
commit8ee3d7200169983e7a20409ed5e8c37907fe66e1 (patch)
treeda2dd191ebaa1b38235afa273e4f3f0e2a744489 /host/lib/usrp/dboard
parent8740bc7149717673c4580767142ce2563035d4cb (diff)
downloaduhd-8ee3d7200169983e7a20409ed5e8c37907fe66e1.tar.gz
uhd-8ee3d7200169983e7a20409ed5e8c37907fe66e1.tar.bz2
uhd-8ee3d7200169983e7a20409ed5e8c37907fe66e1.zip
GPIO tested working on usrp.
Write gpio regs in 32 bit chunks. ATR regs rx side is high address.
Diffstat (limited to 'host/lib/usrp/dboard')
-rw-r--r--host/lib/usrp/dboard/db_basic_and_lf.cpp40
1 files changed, 14 insertions, 26 deletions
diff --git a/host/lib/usrp/dboard/db_basic_and_lf.cpp b/host/lib/usrp/dboard/db_basic_and_lf.cpp
index 930646f76..3c14e473e 100644
--- a/host/lib/usrp/dboard/db_basic_and_lf.cpp
+++ b/host/lib/usrp/dboard/db_basic_and_lf.cpp
@@ -87,8 +87,6 @@ UHD_STATIC_BLOCK(reg_dboards){
**********************************************************************/
basic_rx::basic_rx(ctor_args_t const& args, double max_freq) : rx_dboard_base(args){
_max_freq = max_freq;
- // set the gpios to safe values (all inputs)
- get_interface()->set_gpio_ddr(dboard_interface::GPIO_BANK_RX, 0x0000);
}
basic_rx::~basic_rx(void){
@@ -149,7 +147,13 @@ void basic_rx::rx_get(const wax::obj &key_, wax::obj &val){
return;
case SUBDEV_PROP_IQ_SWAPPED:
+ val = false;
+ return;
+
case SUBDEV_PROP_SPECTRUM_INVERTED:
+ val = false;
+ return;
+
case SUBDEV_PROP_USE_LO_OFFSET:
val = false;
return;
@@ -177,17 +181,7 @@ void basic_rx::rx_set(const wax::obj &key_, const wax::obj &val){
case SUBDEV_PROP_FREQ:
return; // it wont do you much good, but you can set it
- case SUBDEV_PROP_NAME:
- case SUBDEV_PROP_OTHERS:
- case SUBDEV_PROP_GAIN_RANGE:
- case SUBDEV_PROP_GAIN_NAMES:
- case SUBDEV_PROP_FREQ_RANGE:
- case SUBDEV_PROP_ANTENNA_NAMES:
- case SUBDEV_PROP_QUADRATURE:
- case SUBDEV_PROP_IQ_SWAPPED:
- case SUBDEV_PROP_SPECTRUM_INVERTED:
- case SUBDEV_PROP_USE_LO_OFFSET:
- throw std::runtime_error(str(boost::format(
+ default: throw std::runtime_error(str(boost::format(
"Error: trying to set read-only property on %s subdev"
) % dboard_id::to_string(get_rx_id())));
}
@@ -198,8 +192,6 @@ void basic_rx::rx_set(const wax::obj &key_, const wax::obj &val){
**********************************************************************/
basic_tx::basic_tx(ctor_args_t const& args, double max_freq) : tx_dboard_base(args){
_max_freq = max_freq;
- // set the gpios to safe values (all inputs)
- get_interface()->set_gpio_ddr(dboard_interface::GPIO_BANK_TX, 0x0000);
}
basic_tx::~basic_tx(void){
@@ -257,7 +249,13 @@ void basic_tx::tx_get(const wax::obj &key_, wax::obj &val){
return;
case SUBDEV_PROP_IQ_SWAPPED:
+ val = false;
+ return;
+
case SUBDEV_PROP_SPECTRUM_INVERTED:
+ val = false;
+ return;
+
case SUBDEV_PROP_USE_LO_OFFSET:
val = false;
return;
@@ -285,17 +283,7 @@ void basic_tx::tx_set(const wax::obj &key_, const wax::obj &val){
case SUBDEV_PROP_FREQ:
return; // it wont do you much good, but you can set it
- case SUBDEV_PROP_NAME:
- case SUBDEV_PROP_OTHERS:
- case SUBDEV_PROP_GAIN_RANGE:
- case SUBDEV_PROP_GAIN_NAMES:
- case SUBDEV_PROP_FREQ_RANGE:
- case SUBDEV_PROP_ANTENNA_NAMES:
- case SUBDEV_PROP_QUADRATURE:
- case SUBDEV_PROP_IQ_SWAPPED:
- case SUBDEV_PROP_SPECTRUM_INVERTED:
- case SUBDEV_PROP_USE_LO_OFFSET:
- throw std::runtime_error(str(boost::format(
+ default: throw std::runtime_error(str(boost::format(
"Error: trying to set read-only property on %s subdev"
) % dboard_id::to_string(get_tx_id())));
}