Hello,

 

I am a new USRP user with a question about how the GPIO functions. Are the
front panel and daughterboard GPIO separate entities?

 

For instance, if I set the transmit to be always enabled on the
daughterboard ATR registers

 

    uint32_t old_atr_idle_val =
tx_db_iface->get_atr_reg(uhd::usrp::dboard_iface::UNIT_TX,
uhd::usrp::gpio_atr::ATR_REG_IDLE);

    uint32_t old_atr_rxo_val =
tx_db_iface->get_atr_reg(uhd::usrp::dboard_iface::UNIT_TX,
uhd::usrp::gpio_atr::ATR_REG_RX_ONLY);

    uint32_t new_atr_val = 0;

    uint32_t mask = 0x20; //bit 5 = tx not enabled (ie 0 -> always enable
Tx)

    tx_db_iface->set_atr_reg(uhd::usrp::dboard_iface::UNIT_TX,
uhd::usrp::gpio_atr::ATR_REG_IDLE, new_atr_val, mask);

    tx_db_iface->set_atr_reg(uhd::usrp::dboard_iface::UNIT_TX,
uhd::usrp::gpio_atr::ATR_REG_RX_ONLY, new_atr_val, mask);

 

Will setting the front panel ATR to change a GPIO when I start streaming
function as normal, or will the pin always stay high?

 

//GPIO[2] = ATR output 1 during TX

    ctrl |= GPIO_BIT(2);

    ddr |= GPIO_BIT(2);

    atr_tx |= GPIO_BIT(2);

 

//set data direction register (DDR)

    mpUsrp->set_gpio_attr(gpio, "DDR", ddr, mask);

    //set control register

    mpUsrp->set_gpio_attr(gpio, "CTRL", ctrl, mask);

    //set output values (OUT)

    mpUsrp->set_gpio_attr(gpio, "OUT", out, mask);

 

mpUsrp->set_gpio_attr(gpio, "ATR_TX", atr_tx, mask);

 

Thank you!

Richard

 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Reply via email to