diff options
author | Thomas Tsou <ttsou@vt.edu> | 2010-08-26 12:34:06 -0700 |
---|---|---|
committer | Thomas Tsou <ttsou@vt.edu> | 2010-08-26 12:34:06 -0700 |
commit | af44e589a2ed47f08fa060629b33e441fb2dc4ea (patch) | |
tree | ad970811fc253d03400ee70a41e96066e8cd7b6f /host/lib/usrp/usrp2 | |
parent | 4434e8233fadc4eec81d345a6c4e63922d8c01ab (diff) | |
parent | 738f4a86558aca8d2fdfecd480613766bfc82510 (diff) | |
download | uhd-af44e589a2ed47f08fa060629b33e441fb2dc4ea.tar.gz uhd-af44e589a2ed47f08fa060629b33e441fb2dc4ea.tar.bz2 uhd-af44e589a2ed47f08fa060629b33e441fb2dc4ea.zip |
Merge branch 'convert_types' into usrp1
Diffstat (limited to 'host/lib/usrp/usrp2')
-rw-r--r-- | host/lib/usrp/usrp2/dboard_iface.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/host/lib/usrp/usrp2/dboard_iface.cpp b/host/lib/usrp/usrp2/dboard_iface.cpp index 8bded1ea3..f6d2b718a 100644 --- a/host/lib/usrp/usrp2/dboard_iface.cpp +++ b/host/lib/usrp/usrp2/dboard_iface.cpp @@ -51,6 +51,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 &); @@ -219,6 +220,25 @@ void usrp2_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t atr, boost::uint16_t _iface->poke16(unit_to_atr_to_addr[unit][atr], value); } +void usrp2_dboard_iface::set_gpio_debug(unit_t unit, int which){ + this->set_gpio_ddr(unit, 0xffff); //all outputs + + //calculate the new selection mux setting + boost::uint32_t new_sels = 0x0; + int sel = (which == 0)? + U2_FLAG_GPIO_SEL_DEBUG_0: + U2_FLAG_GPIO_SEL_DEBUG_1; + for(size_t i = 0; i < 16; i++){ + new_sels |= sel << (i*2); + } + + //write the selection mux value to register + switch(unit){ + case UNIT_RX: _iface->poke32(U2_REG_GPIO_RX_SEL, new_sels); return; + case UNIT_TX: _iface->poke32(U2_REG_GPIO_TX_SEL, new_sels); return; + } +} + /*********************************************************************** * SPI **********************************************************************/ |