discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] toggling LFRX gpio pins


From: Josh Blum
Subject: Re: [Discuss-gnuradio] toggling LFRX gpio pins
Date: Thu, 25 Jul 2013 03:44:49 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7


On 07/24/2013 12:46 PM, Nemanja Savic wrote:
> After some time I maybe realized how this thing works, but I don't know jow
> to call correctly methods from dboard_iface:
> 
> def get_pin_ctrl(self, *args, **kwargs):
>         """get_pin_ctrl(self, unit_t unit) -> boost::uint16_t"""
>         return _uhd_swig.dboard_iface_get_pin_ctrl(self, *args, **kwargs)
> 
> ef get_gpio_ddr(self, *args, **kwargs):
>         """get_gpio_ddr(self, unit_t unit) -> boost::uint16_t"""
>         return _uhd_swig.dboard_iface_get_gpio_ddr(self, *args, **kwargs)
> 
> or any of these methods that have *arg and **kwargs. When I call like this:
> iface = usrp1_src.get_dboard_iface()
> print iface.get_pin_ctrl(uhd.dboard_iface.UNIT_RX, 0)
> 
> I get following error:
> 
> Traceback (most recent call last):
>   File "lftx_io.py", line 31, in <module>
>     print iface.get_pin_ctrl(uhd.dboard_iface.UNIT_RX, 0)
>   File "/usr/local/lib64/python2.6/site-packages/gnuradio/uhd/uhd_swig.py",
> line 1691, in get_pin_ctrl
>     return _uhd_swig.dboard_iface_sptr_get_pin_ctrl(self, *args, **kwargs)
> TypeError: dboard_iface_sptr_get_pin_ctrl() takes at most 2 arguments (3
> given)
> 
> 

You have the right idea, but that particular function only takes one
argument. So thats the error.

Take a look at include/uhd/usrp/dboard_iface.hpp for documentation. The
python interface may be a little different syntax wise, but the function
names are all the same.

-josh

> 
> On Wed, Jul 24, 2013 at 4:58 PM, Nemanja Savic <address@hidden> wrote:
> 
>> Hi guys again,
>>
>> I have designed small RF frontend using TI's cc1000 transciever. Since the
>> transciever need to be configured using external pins, I need to be able to
>> toggle gpio pins on my LFRX. I have found that I should use dboard_iface
>> which is available in python via swig. However I have several questions:
>> How should I address my board, since there are 4 possible slots, and onlt
>> 2 values of type unit, UNIT_RX and UNIT_TX.
>> As far as i can see, every uhd source has method get_iface, does this
>> anyhow concerns me?
>>
>> Thanks again,
>> Nemanja
>>
>> --
>> Nemanja Savić
>>
> 
> 
> 
> 
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]