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: Nemanja Savic
Subject: Re: [Discuss-gnuradio] toggling LFRX gpio pins
Date: Thu, 25 Jul 2013 10:14:38 +0200

Hi,

thank you Josh. Yesterday late I figured out almost everything. I suppose everything would be faster with a little bit more documentation.
So, I have USRP1 with wbx, lftx and lfrx.
There is one doubt now. When I set USRP source to wbx and after that read register for setting direction of the pins i get some value (49116). The binary representation is not the same as i expect from WBX schematic. In schematgic is written that for example io_rx[5] for selecting rx1 or rx2 is output pin, but I get 0 when I read. Also io_rx[15] and io_rx[14] are unused, but still one is set as output and other as input. Also when I change antenna selection and read the same value again i read the same number.

thanks,
Nemanja


On Thu, Jul 25, 2013 at 9:44 AM, Josh Blum <address@hidden> wrote:


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
>

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



--
Nemanja Savić

reply via email to

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