Revision 48ad3b73
| b/host/include/uhd/usrp/dboard_iface.hpp | ||
|---|---|---|
| 148 | 148 |
virtual void write_gpio(unit_t unit, boost::uint16_t value) = 0; |
| 149 | 149 |
|
| 150 | 150 |
/*! |
| 151 |
* Setup the GPIO debug mux. |
|
| 152 |
* |
|
| 153 |
* \param unit which unit rx or tx |
|
| 154 |
* \param which which debug: 0, 1 |
|
| 155 |
*/ |
|
| 156 |
virtual void set_gpio_debug(unit_t unit, int which) = 0; |
|
| 157 |
|
|
| 158 |
/*! |
|
| 151 | 159 |
* Read daughterboard GPIO pin values. |
| 152 | 160 |
* |
| 153 | 161 |
* \param unit which unit rx or tx |
| b/host/include/uhd/usrp/simple_usrp.hpp | ||
|---|---|---|
| 25 | 25 |
#include <uhd/types/clock_config.hpp> |
| 26 | 26 |
#include <uhd/types/tune_result.hpp> |
| 27 | 27 |
#include <uhd/usrp/subdev_spec.hpp> |
| 28 |
#include <uhd/usrp/dboard_iface.hpp> |
|
| 28 | 29 |
#include <boost/shared_ptr.hpp> |
| 29 | 30 |
#include <boost/utility.hpp> |
| 30 | 31 |
#include <vector> |
| ... | ... | |
| 136 | 137 |
*/ |
| 137 | 138 |
virtual float read_rssi(void) = 0; |
| 138 | 139 |
|
| 140 |
virtual dboard_iface::sptr get_rx_dboard_iface(void) = 0; |
|
| 141 |
|
|
| 139 | 142 |
/******************************************************************* |
| 140 | 143 |
* TX methods |
| 141 | 144 |
******************************************************************/ |
| ... | ... | |
| 159 | 162 |
virtual std::vector<std::string> get_tx_antennas(void) = 0; |
| 160 | 163 |
|
| 161 | 164 |
virtual bool get_tx_lo_locked(void) = 0; |
| 165 |
|
|
| 166 |
virtual dboard_iface::sptr get_tx_dboard_iface(void) = 0; |
|
| 162 | 167 |
}; |
| 163 | 168 |
|
| 164 | 169 |
}} |
| b/host/lib/usrp/simple_usrp.cpp | ||
|---|---|---|
| 168 | 168 |
return _rx_subdev()[SUBDEV_PROP_RSSI].as<float>(); |
| 169 | 169 |
} |
| 170 | 170 |
|
| 171 |
dboard_iface::sptr get_rx_dboard_iface(void){
|
|
| 172 |
return _rx_dboard()[DBOARD_PROP_DBOARD_IFACE].as<dboard_iface::sptr>(); |
|
| 173 |
} |
|
| 174 |
|
|
| 171 | 175 |
/******************************************************************* |
| 172 | 176 |
* TX methods |
| 173 | 177 |
******************************************************************/ |
| ... | ... | |
| 232 | 236 |
return _tx_subdev()[SUBDEV_PROP_LO_LOCKED].as<bool>(); |
| 233 | 237 |
} |
| 234 | 238 |
|
| 239 |
dboard_iface::sptr get_tx_dboard_iface(void){
|
|
| 240 |
return _tx_dboard()[DBOARD_PROP_DBOARD_IFACE].as<dboard_iface::sptr>(); |
|
| 241 |
} |
|
| 242 |
|
|
| 235 | 243 |
private: |
| 236 | 244 |
device::sptr _dev; |
| 237 | 245 |
wax::obj _mboard(void){
|
| b/host/lib/usrp/usrp2/dboard_iface.cpp | ||
|---|---|---|
| 51 | 51 |
void set_atr_reg(unit_t, atr_reg_t, boost::uint16_t); |
| 52 | 52 |
void set_gpio_ddr(unit_t, boost::uint16_t); |
| 53 | 53 |
void write_gpio(unit_t, boost::uint16_t); |
| 54 |
void set_gpio_debug(unit_t, int); |
|
| 54 | 55 |
boost::uint16_t read_gpio(unit_t); |
| 55 | 56 |
|
| 56 | 57 |
void write_i2c(boost::uint8_t, const byte_vector_t &); |
| ... | ... | |
| 219 | 220 |
_iface->poke16(unit_to_atr_to_addr[unit][atr], value); |
| 220 | 221 |
} |
| 221 | 222 |
|
| 223 |
void usrp2_dboard_iface::set_gpio_debug(unit_t unit, int which){
|
|
| 224 |
this->set_gpio_ddr(unit, 0xffff); //all outputs |
|
| 225 |
|
|
| 226 |
//calculate the new selection mux setting |
|
| 227 |
boost::uint32_t new_sels = 0x0; |
|
| 228 |
int sel = (which == 0)? |
|
| 229 |
U2_FLAG_GPIO_SEL_DEBUG_0: |
|
| 230 |
U2_FLAG_GPIO_SEL_DEBUG_1; |
|
| 231 |
for(size_t i = 0; i < 16; i++){
|
|
| 232 |
new_sels |= sel << (i*2); |
|
| 233 |
} |
|
| 234 |
|
|
| 235 |
//write the selection mux value to register |
|
| 236 |
switch(unit){
|
|
| 237 |
case UNIT_RX: _iface->poke32(U2_REG_GPIO_RX_SEL, new_sels); return; |
|
| 238 |
case UNIT_TX: _iface->poke32(U2_REG_GPIO_TX_SEL, new_sels); return; |
|
| 239 |
} |
|
| 240 |
} |
|
| 241 |
|
|
| 222 | 242 |
/*********************************************************************** |
| 223 | 243 |
* SPI |
| 224 | 244 |
**********************************************************************/ |
Also available in: Unified diff