aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-08-24 18:11:46 +0000
committerJosh Blum <josh@joshknows.com>2010-08-24 18:11:46 +0000
commitd3501cda50407143db85f7ea5eb894c71ecd8aac (patch)
treec73c67f92c0f7dc009b505f1f4eb14b6a33b0640 /host
parente0d55c79f5e61858dbe75ca96abfbd7a6a4e8f97 (diff)
downloaduhd-d3501cda50407143db85f7ea5eb894c71ecd8aac.tar.gz
uhd-d3501cda50407143db85f7ea5eb894c71ecd8aac.tar.bz2
uhd-d3501cda50407143db85f7ea5eb894c71ecd8aac.zip
usrp-e: added dboard iface set gpio debug call
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/usrp_e/dboard_iface.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/host/lib/usrp/usrp_e/dboard_iface.cpp b/host/lib/usrp/usrp_e/dboard_iface.cpp
index c9efd0c9e..1bd177f60 100644
--- a/host/lib/usrp/usrp_e/dboard_iface.cpp
+++ b/host/lib/usrp/usrp_e/dboard_iface.cpp
@@ -67,6 +67,7 @@ public:
void set_atr_reg(unit_t, atr_reg_t, boost::uint16_t);
void set_gpio_ddr(unit_t, boost::uint16_t);
void write_gpio(unit_t, boost::uint16_t);
+ void set_gpio_debug(unit_t, int);
boost::uint16_t read_gpio(unit_t);
void write_i2c(boost::uint8_t, const byte_vector_t &);
@@ -193,6 +194,29 @@ void usrp_e_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t atr, boost::uint16_
_iface->poke16(unit_to_atr_to_addr[unit][atr], value);
}
+void usrp_e_dboard_iface::set_gpio_debug(unit_t unit, int which){
+ //set this unit to all outputs
+ this->set_gpio_ddr(unit, 0xffff);
+
+ //calculate the debug selections
+ boost::uint32_t dbg_sels = 0x0;
+ int sel = (which == 0)? GPIO_SEL_DEBUG_0 : GPIO_SEL_DEBUG_1;
+ for(size_t i = 0; i < 16; i++) dbg_sels |= sel << i;
+
+ //set the debug on and which debug selection
+ switch(unit){
+ case UNIT_RX:
+ _iface->poke16(UE_REG_GPIO_RX_DBG, 0xffff);
+ _iface->poke16(UE_REG_GPIO_RX_SEL, dbg_sels);
+ return;
+
+ case UNIT_TX:
+ _iface->poke16(UE_REG_GPIO_TX_DBG, 0xffff);
+ _iface->poke16(UE_REG_GPIO_TX_SEL, dbg_sels);
+ return;
+ }
+}
+
/***********************************************************************
* SPI
**********************************************************************/