On 05/10/2011 08:46 PM, Brett L. Trotter wrote:
> I did a bench experiment here and observed that set_gpio_ddr is required
> on a tx card but not an rx card. Is this intended?
> 

yup, see the constructors in host/lib/usrp/dboard/db_basic_and_lf.cpp

> Here is iotest.py (Python 2.5 required for ternary I used)
> 
> #!/usr/bin/env python
> 
> I2C_DEV_EEPROM = 0x50            # 24LC02[45]:  7-bits 1010xxx
> I2C_ADDR_BOOT  = (I2C_DEV_EEPROM | 0x0)
> I2C_ADDR_TX_A  = (I2C_DEV_EEPROM | 0x4)
> I2C_ADDR_RX_A  = (I2C_DEV_EEPROM | 0x5)
> I2C_ADDR_TX_B  = (I2C_DEV_EEPROM | 0x6)
> I2C_ADDR_RX_B  = (I2C_DEV_EEPROM | 0x7)
> 
> from gnuradio import uhd
> from gnuradio import eng_notation
> from gnuradio.eng_option import eng_option
> from optparse import OptionParser
> import time
> 
> if __name__ == '__main__':
>     device = uhd.usrp_sink(
>       device_addr="addr=192.168.10.2",
>       io_type=uhd.io_type_t.COMPLEX_FLOAT32,
>       num_channels=1,
>     )
>     cmd_handle = device.get_dboard_iface()
>     cmd_handle.set_gpio_ddr(uhd.dboard_iface.UNIT_TX, 0xFFFF, 0xFFFF)
>     #cmd_handle.set_gpio_ddr(uhd.dboard_iface.UNIT_RX, 0xFFFF, 0xFFFF)
>     toggle = False
>     while True:
>         print ("True" if toggle else "False")
>         cmd_handle.set_gpio_out(uhd.dboard_iface.UNIT_TX, (0xFFFF if
> toggle else 0x0000), 0xFFFF)
>         cmd_handle.set_gpio_out(uhd.dboard_iface.UNIT_RX, (0xFFFF if
> toggle else 0x0000), 0xFFFF)
>         toggle = ~toggle
>         time.sleep(1)
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to