[USRP-users] Re: Can only control 1 pin of x310 GPIO

2024-11-21 Thread hui cj
In your last example, it should be usrp->set_gpio_attr("FP0", "OUT", 0xFFF , 0xFFF); The third parameter should also be a mask. Will Haftel via USRP-users 于2024年11月21日周四 05:38写道: > This doesn’t quite work for me - in the last example I gave, I try using 1 > mask to set all of the bits high bu

[USRP-users] Re: Can only control 1 pin of x310 GPIO

2024-11-21 Thread Martin Braun
Hi Will, hui is right. If you want any pins to be high, then mask & value must be non-zero. Is it possible that you assume that the value only applies to the mask bits? Because they don't. In you example, this line: usrp->set_gpio_attr("FP0", "OUT", 1, (1<<1)); will not do anything because 1 & (

[USRP-users] Re: Can only control 1 pin of x310 GPIO

2024-11-21 Thread hui cj
If you want to set both pin 0 and pin 1 to high, the third parameter should be 0x0003. In this case: If your last parameter is 0x, both pin 0 and pin 1 will be set to high, while all other pins will be set to low. However, if your last parameter is 0x0003, only pin 0 and pin 1 will change to h

[USRP-users] Re: Can only control 1 pin of x310 GPIO

2024-11-20 Thread Will Haftel via USRP-users
This doesn’t quite work for me - in the last example I gave, I try using 1 mask to set all of the bits high but still only pin 0 is set. I am able to control all of the pins using ATR, but am not sure why the manual api isn’t giving me the same results. _

[USRP-users] Re: Can only control 1 pin of x310 GPIO

2024-11-19 Thread hui cj
Hi, According to the manual, The mask argument can be used to apply value only to select pins, and retain the existing value on the rest. Because of this feature, this API call will incur two register transactions (one read, one write). I think the value parameter should be a hexadecimal number,