Revision 48ad3b73 host/lib/usrp/usrp2/dboard_iface.cpp

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