Re: [beagleboard] libgpiod on Beaglebone AI

2020-08-11 Thread TJF
There're two options to control the 32 outputs of a GPIO subsystem:

   1. writes to register GPIO_DATAOUT, or
   2. writes to registers GPIO_SETDATAOUT and GPIO_CLEARDATAOUT

In the first case all pins switch at the exact same time. But there's a 
downside in controlling all 32 pins at once: it may override changes on 
lines controlled by other software.

The second option is a convenient way to avoid that overriding. The 
registers GPIO_SETDATAOUT and GPIO_CLEARDATAOUT can be used to change only 
the masked pins. As long as only one register is necessary (ie all pins 
set, or all pins cleared) the change is at the exact same time. In contrast 
when performing mixed changes (some pins set, others cleared) you'll see a 
delay between the output changes depending on the L3 latency.

@Mark
In order to testing gpiod you should use mixed changes

while true; do 
gpioset 1 18=0 19=1
gpioset 1 18=1 19=0
done

Regards

BTW:
Changing multiple pins on the same chip all at once is supported in libpruio 
 since version 0.0 (2014, kernel 3.8).

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/dd89965b-ae8b-4d5a-b4f7-1d5c487261b7o%40googlegroups.com.


Re: [beagleboard] libgpiod on Beaglebone AI

2020-08-10 Thread Steve Lentz
Alright then.  Something in the chip is indeed flipping them on the same clock 
edge.

> On Aug 10, 2020, at 11:58 AM, Mark A. Yoder  wrote:
> 
> 
> 
> On my 100MHz 'scope they look the same.  I think it's one instruction 
> toggling the pair.  They are toggling at some 268KHz.
> 
> --Mark
> On Monday, August 10, 2020 at 11:43:49 AM UTC-4 stl...@gmail.com wrote:
> It’s unlikely to be exactly the same time, it’s just within some undefined 
> margin for error.  Compiled C code can get the two pins set within a small 
> number of 1 GHz clocks.  With a fast enough scope, you’’ll probably find at 
> least a few ns difference, if this isn’t obscured by parasitic capacitance in 
> the traces and wiring.  Sure, this is a 3 orders of magnitude less than 
> gpiod, but there are folks out there working in femtoseconds for whom a 
> nanosecond would be far too long.  Time is a very stretchy thing.  
> 
> 
>> On Aug 10, 2020, at 11:33 AM, Mark A. Yoder > > wrote:
>> 
> 
>> Interesting   I wrote a c version 
>> 
>>  and the pins are toggle at the exact same time.  Now, how to get gpioset to 
>> work correctly.
>> 
>> --Mark
>> 
>> On Monday, August 10, 2020 at 10:27:08 AM UTC-4 Mark A. Yoder wrote:
>> Yes, but the hardware on the am335x can toggle multiple pins on the same 
>> chip in the same clock cycle.  Seems like the software should be able to 
>> support it.
>> 
>> On Monday, August 10, 2020 at 10:20:10 AM UTC-4 evilw...@gmail.com <> wrote:
>> software takes time to execute.
>> 
>> 
>> On 8/10/2020 7:09 AM, Mark A. Yoder wrote:
>>> I'm starting to play with gpiod on a Beaglebone Black.  One of the 
>>> advantages of gpiod is you can toggle multiple pins on the same chip all at 
>>> once.
>>> So I try:
>>> while true; do 
>>> gpioset 1 18=0 19=0
>>> gpioset 1 18=1 19=1
>>> done
>>> 
>>> This is toggling pins P9_14 and P9_16.  I expect to see the two pins toggle 
>>> on at the same time, but what I get is
>>> a 4 microsecond delay from P9_14 switching and P9_16 switching.  
>>> 
>>> Should there be such a long delay?  I'd expect the two to switch at the 
>>> same time (which is what happens when toggle pins via the PRU).
>>> 
>>> I do the same experiment with python and I see a 70 us delay.
>>> 
>>> --Mark
>>> On Friday, March 27, 2020 at 3:58:21 PM UTC-4 Drew Fustini wrote:
>>> On Fri, Mar 27, 2020 at 8:45 PM John Allwine > 
>>> wrote: 
>>> > 
>>> > I don't intend to toggle a GPIO as fast as possible (except to test), but 
>>> > from a performance standpoint that demonstration seemed to indicate that 
>>> > there are issues with sysfs. Hopefully, libgpiod will prove to be better! 
>>> 
>>> Bartosz explains the differences and improvements that new gpiod 
>>> interface provides in this talk: 
>>> https://www.youtube.com/watch?v=cdTLewJCL1Y 
>>>  
>>> 
>>> Essentially, if you need read or set multiple lines, it is faster. 
>>> Also, it has an improved way to read events as well. 
>>> 
>>> Slides if you prefer over video: 
>>> https://ostconf.com/system/attachments/files/000/001/532/original/Linux_Piter_2018_-_New_GPIO_interface_for_linux_userspace.pdf?1541021776
>>>  
>>> 
>>>  
>> 
>>> -- 
>>> For more options, visit http://beagleboard.org/discuss 
>>> 
>>> --- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "BeagleBoard" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to beagleboard...@googlegroups.com <>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/beagleboard/16a18eef-a649-46d9-b126-f774a8eb1522n%40googlegroups.com
>>>  
>>> .
>> 
>> 
>> -- 
>> For more options, visit http://beagleboard.org/discuss 
>> 
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "BeagleBoard" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to beagleboard...@googlegroups.com 
>> .
> 
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beagleboard/ab17b85d-7f42-42cb-9793-ed7d04a44e27n%40googlegroups.com
>>  
>> .
> 
> 
> -- 
> For more options, visit http://beagleboard.org/discuss 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to 

Re: [beagleboard] libgpiod on Beaglebone AI

2020-08-10 Thread Steve Lentz
It’s unlikely to be exactly the same time, it’s just within some undefined 
margin for error.  Compiled C code can get the two pins set within a small 
number of 1 GHz clocks.  With a fast enough scope, you’’ll probably find at 
least a few ns difference, if this isn’t obscured by parasitic capacitance in 
the traces and wiring.  Sure, this is a 3 orders of magnitude less than gpiod, 
but there are folks out there working in femtoseconds for whom a nanosecond 
would be far too long.  Time is a very stretchy thing.  

> On Aug 10, 2020, at 11:33 AM, Mark A. Yoder  wrote:
> 
> Interesting   I wrote a c version 
> 
>  and the pins are toggle at the exact same time.  Now, how to get gpioset to 
> work correctly.
> 
> --Mark
> 
> On Monday, August 10, 2020 at 10:27:08 AM UTC-4 Mark A. Yoder wrote:
> Yes, but the hardware on the am335x can toggle multiple pins on the same chip 
> in the same clock cycle.  Seems like the software should be able to support 
> it.
> 
> On Monday, August 10, 2020 at 10:20:10 AM UTC-4 evilw...@gmail.com 
>  wrote:
> software takes time to execute.
> 
> 
> On 8/10/2020 7:09 AM, Mark A. Yoder wrote:
>> I'm starting to play with gpiod on a Beaglebone Black.  One of the 
>> advantages of gpiod is you can toggle multiple pins on the same chip all at 
>> once.
>> So I try:
>> while true; do 
>> gpioset 1 18=0 19=0
>> gpioset 1 18=1 19=1
>> done
>> 
>> This is toggling pins P9_14 and P9_16.  I expect to see the two pins toggle 
>> on at the same time, but what I get is
>> a 4 microsecond delay from P9_14 switching and P9_16 switching.  
>> 
>> Should there be such a long delay?  I'd expect the two to switch at the same 
>> time (which is what happens when toggle pins via the PRU).
>> 
>> I do the same experiment with python and I see a 70 us delay.
>> 
>> --Mark
>> On Friday, March 27, 2020 at 3:58:21 PM UTC-4 Drew Fustini wrote:
>> On Fri, Mar 27, 2020 at 8:45 PM John Allwine > 
>> wrote: 
>> > 
>> > I don't intend to toggle a GPIO as fast as possible (except to test), but 
>> > from a performance standpoint that demonstration seemed to indicate that 
>> > there are issues with sysfs. Hopefully, libgpiod will prove to be better! 
>> 
>> Bartosz explains the differences and improvements that new gpiod 
>> interface provides in this talk: 
>> https://www.youtube.com/watch?v=cdTLewJCL1Y 
>>  
>> 
>> Essentially, if you need read or set multiple lines, it is faster. 
>> Also, it has an improved way to read events as well. 
>> 
>> Slides if you prefer over video: 
>> https://ostconf.com/system/attachments/files/000/001/532/original/Linux_Piter_2018_-_New_GPIO_interface_for_linux_userspace.pdf?1541021776
>>  
>> 
>>  
> 
>> -- 
>> For more options, visit http://beagleboard.org/discuss 
>> 
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "BeagleBoard" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to beagleboard...@googlegroups.com <>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beagleboard/16a18eef-a649-46d9-b126-f774a8eb1522n%40googlegroups.com
>>  
>> .
> 
> 
> -- 
> For more options, visit http://beagleboard.org/discuss 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to beagleboard+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/beagleboard/ab17b85d-7f42-42cb-9793-ed7d04a44e27n%40googlegroups.com
>  
> .

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/A0B87564-F04B-48AA-9D42-0E258010DD3C%40gmail.com.


Re: [beagleboard] libgpiod on Beaglebone AI

2020-08-10 Thread Mark A. Yoder
Interesting   I wrote a c version 
 
and 
the pins are toggle *at the exact same time*.  Now, how to get gpioset to 
work correctly.

--Mark

On Monday, August 10, 2020 at 10:27:08 AM UTC-4 Mark A. Yoder wrote:

> Yes, but the hardware on the am335x can toggle multiple pins on the same 
> chip in the same clock cycle.  Seems like the software should be able to 
> support it.
>
> On Monday, August 10, 2020 at 10:20:10 AM UTC-4 evilw...@gmail.com wrote:
>
>> software takes time to execute.
>>
>>
>> On 8/10/2020 7:09 AM, Mark A. Yoder wrote:
>>
>> I'm starting to play with gpiod on a Beaglebone Black.  One of the 
>> advantages of gpiod is you can toggle multiple pins on the same chip all at 
>> once. 
>> So I try:
>> while true; do 
>> gpioset 1 18=0 19=0
>> gpioset 1 18=1 19=1
>> done
>>
>> This is toggling pins P9_14 and P9_16.  I expect to see the two pins 
>> toggle on at the same time, but what I get is
>> a 4 microsecond delay from P9_14 switching and P9_16 switching.  
>>
>> *Should there be such a long delay? * I'd expect the two to switch at 
>> the same time (which is what happens when toggle pins via the PRU).
>>
>> I do the same experiment with python and I see a 70 us delay.
>>
>> --Mark
>> On Friday, March 27, 2020 at 3:58:21 PM UTC-4 Drew Fustini wrote:
>>
>>> On Fri, Mar 27, 2020 at 8:45 PM John Allwine  
>>> wrote: 
>>> > 
>>> > I don't intend to toggle a GPIO as fast as possible (except to test), 
>>> but from a performance standpoint that demonstration seemed to indicate 
>>> that there are issues with sysfs. Hopefully, libgpiod will prove to be 
>>> better! 
>>>
>>> Bartosz explains the differences and improvements that new gpiod 
>>> interface provides in this talk: 
>>> https://www.youtube.com/watch?v=cdTLewJCL1Y 
>>>
>>> Essentially, if you need read or set multiple lines, it is faster. 
>>> Also, it has an improved way to read events as well. 
>>>
>>> Slides if you prefer over video: 
>>>
>>> https://ostconf.com/system/attachments/files/000/001/532/original/Linux_Piter_2018_-_New_GPIO_interface_for_linux_userspace.pdf?1541021776
>>>  
>>>
>> -- 
>> For more options, visit http://beagleboard.org/discuss
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "BeagleBoard" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to beagleboard...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beagleboard/16a18eef-a649-46d9-b126-f774a8eb1522n%40googlegroups.com
>>  
>> 
>> .
>>
>>
>>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/ab17b85d-7f42-42cb-9793-ed7d04a44e27n%40googlegroups.com.


Re: [beagleboard] libgpiod on Beaglebone AI

2020-08-10 Thread Mark A. Yoder
Yes, but the hardware on the am335x can toggle multiple pins on the same 
chip in the same clock cycle.  Seems like the software should be able to 
support it.

On Monday, August 10, 2020 at 10:20:10 AM UTC-4 evilw...@gmail.com wrote:

> software takes time to execute.
>
>
> On 8/10/2020 7:09 AM, Mark A. Yoder wrote:
>
> I'm starting to play with gpiod on a Beaglebone Black.  One of the 
> advantages of gpiod is you can toggle multiple pins on the same chip all at 
> once. 
> So I try:
> while true; do 
> gpioset 1 18=0 19=0
> gpioset 1 18=1 19=1
> done
>
> This is toggling pins P9_14 and P9_16.  I expect to see the two pins 
> toggle on at the same time, but what I get is
> a 4 microsecond delay from P9_14 switching and P9_16 switching.  
>
> *Should there be such a long delay? * I'd expect the two to switch at the 
> same time (which is what happens when toggle pins via the PRU).
>
> I do the same experiment with python and I see a 70 us delay.
>
> --Mark
> On Friday, March 27, 2020 at 3:58:21 PM UTC-4 Drew Fustini wrote:
>
>> On Fri, Mar 27, 2020 at 8:45 PM John Allwine  
>> wrote: 
>> > 
>> > I don't intend to toggle a GPIO as fast as possible (except to test), 
>> but from a performance standpoint that demonstration seemed to indicate 
>> that there are issues with sysfs. Hopefully, libgpiod will prove to be 
>> better! 
>>
>> Bartosz explains the differences and improvements that new gpiod 
>> interface provides in this talk: 
>> https://www.youtube.com/watch?v=cdTLewJCL1Y 
>>
>> Essentially, if you need read or set multiple lines, it is faster. 
>> Also, it has an improved way to read events as well. 
>>
>> Slides if you prefer over video: 
>>
>> https://ostconf.com/system/attachments/files/000/001/532/original/Linux_Piter_2018_-_New_GPIO_interface_for_linux_userspace.pdf?1541021776
>>  
>>
> -- 
> For more options, visit http://beagleboard.org/discuss
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to beagleboard...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/beagleboard/16a18eef-a649-46d9-b126-f774a8eb1522n%40googlegroups.com
>  
> 
> .
>
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/2a0cf82e-d223-4cfe-a623-27687edc3b4bn%40googlegroups.com.


Re: [beagleboard] libgpiod on Beaglebone AI

2020-08-10 Thread evilwulfie

software takes time to execute.

On 8/10/2020 7:09 AM, Mark A. Yoder wrote:
I'm starting to play with gpiod on a Beaglebone Black.  One of the 
advantages of gpiod is you can toggle multiple pins on the same chip 
all at once.

So I try:
while true; do
    gpioset 1 18=0 19=0
    gpioset 1 18=1 19=1
done

This is toggling pins P9_14 and P9_16.  I expect to see the two pins 
toggle on at the same time, but what I get is

a 4 microsecond delay from P9_14 switching and P9_16 switching.

*Should there be such a long delay? * I'd expect the two to switch at 
the same time (which is what happens when toggle pins via the PRU).


I do the same experiment with python and I see a 70 us delay.

--Mark
On Friday, March 27, 2020 at 3:58:21 PM UTC-4 Drew Fustini wrote:

On Fri, Mar 27, 2020 at 8:45 PM John Allwine
 wrote:
>
> I don't intend to toggle a GPIO as fast as possible (except to
test), but from a performance standpoint that demonstration seemed
to indicate that there are issues with sysfs. Hopefully, libgpiod
will prove to be better!

Bartosz explains the differences and improvements that new gpiod
interface provides in this talk:
https://www.youtube.com/watch?v=cdTLewJCL1Y

Essentially, if you need read or set multiple lines, it is faster.
Also, it has an improved way to read events as well.

Slides if you prefer over video:

https://ostconf.com/system/attachments/files/000/001/532/original/Linux_Piter_2018_-_New_GPIO_interface_for_linux_userspace.pdf?1541021776


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google 
Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to beagleboard+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/16a18eef-a649-46d9-b126-f774a8eb1522n%40googlegroups.com 
.


--
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/68f5cf4e-279c-afed-3878-a99c12f52542%40gmail.com.


Re: [beagleboard] libgpiod on Beaglebone AI

2020-08-10 Thread Mark A. Yoder
I'm starting to play with gpiod on a Beaglebone Black.  One of the 
advantages of gpiod is you can toggle multiple pins on the same chip all at 
once.
So I try:
while true; do 
gpioset 1 18=0 19=0
gpioset 1 18=1 19=1
done

This is toggling pins P9_14 and P9_16.  I expect to see the two pins toggle 
on at the same time, but what I get is
a 4 microsecond delay from P9_14 switching and P9_16 switching.  

*Should there be such a long delay? * I'd expect the two to switch at the 
same time (which is what happens when toggle pins via the PRU).

I do the same experiment with python and I see a 70 us delay.

--Mark
On Friday, March 27, 2020 at 3:58:21 PM UTC-4 Drew Fustini wrote:

> On Fri, Mar 27, 2020 at 8:45 PM John Allwine  
> wrote:
> >
> > I don't intend to toggle a GPIO as fast as possible (except to test), 
> but from a performance standpoint that demonstration seemed to indicate 
> that there are issues with sysfs. Hopefully, libgpiod will prove to be 
> better!
>
> Bartosz explains the differences and improvements that new gpiod
> interface provides in this talk:
> https://www.youtube.com/watch?v=cdTLewJCL1Y
>
> Essentially, if you need read or set multiple lines, it is faster.
> Also, it has an improved way to read events as well.
>
> Slides if you prefer over video:
>
> https://ostconf.com/system/attachments/files/000/001/532/original/Linux_Piter_2018_-_New_GPIO_interface_for_linux_userspace.pdf?1541021776
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/16a18eef-a649-46d9-b126-f774a8eb1522n%40googlegroups.com.


Re: [beagleboard] libgpiod on Beaglebone AI

2020-03-27 Thread Drew Fustini
On Fri, Mar 27, 2020 at 8:45 PM John Allwine  wrote:
>
> I don't intend to toggle a GPIO as fast as possible (except to test), but 
> from a performance standpoint that demonstration seemed to indicate that 
> there are issues with sysfs. Hopefully, libgpiod will prove to be better!

Bartosz explains the differences and improvements that new gpiod
interface provides in this talk:
https://www.youtube.com/watch?v=cdTLewJCL1Y

Essentially, if you need read or set multiple lines, it is faster.
Also, it has an improved way to read events as well.

Slides if you prefer over video:
https://ostconf.com/system/attachments/files/000/001/532/original/Linux_Piter_2018_-_New_GPIO_interface_for_linux_userspace.pdf?1541021776

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAEf4M_BwFgyLyvTQ0wpV2dKuv%3Df_DcwUrRGtPwwVT7dxPOKLtQ%40mail.gmail.com.


Re: [beagleboard] libgpiod on Beaglebone AI

2020-03-27 Thread John Allwine
I don't intend to toggle a GPIO as fast as possible (except to test), but 
from a performance standpoint that demonstration seemed to indicate that 
there are issues with sysfs. Hopefully, libgpiod will prove to be better!

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/ed9dad7f-b877-41cb-b55f-c9bc9600c9ea%40googlegroups.com.


Re: [beagleboard] libgpiod on Beaglebone AI

2020-03-27 Thread William Hermans
On Fri, Mar 27, 2020 at 11:46 AM Drew Fustini  wrote:

> On Fri, Mar 27, 2020 at 4:48 PM John Allwine 
> wrote:
> >
> > That was it! gpioget gpiochip3 10 worked.
>
> It would be interesting to know if libgpiod proves fast enough for
> your application.  It has C++ and Python bindings that allow you to
> set and get multiple lines on a gpiochip with a single ioctl().
>
> I am in communication with Bartosz, who made the libgpiod userspace
> library and utilities, and Linus Walleij who created the gpiod
> interface (which includes the gpiochip character devices).  They both
> seem open minded to improving interfaces to address real-world use
> cases.
>
Personally. I think trying to toggle a GPIO as fast as possible in Linux is
the wrong way to go about it. According to what I've read(and I have no
personal desire to test it). An empty ioctl() has 63ns latency. Add that on
top of gpiod's time. Then it starts to add up. Not to mention: how
proficient a given developer is when writing performant code.

So, for doing anything blazing fast, we're back full circle. However, I
think it would be better to use/buy hardware specialized for the task at
hand. With that said, there is nothing wrong with experimenting. Until you
let the blue smoke out. . .

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORptFxx%3DHy7Rxi085HzUwXMnv4oc1t_N6pO%3DrmqQZDngEQ%40mail.gmail.com.


Re: [beagleboard] libgpiod on Beaglebone AI

2020-03-27 Thread Drew Fustini
On Fri, Mar 27, 2020 at 4:48 PM John Allwine  wrote:
>
> That was it! gpioget gpiochip3 10 worked.

It would be interesting to know if libgpiod proves fast enough for
your application.  It has C++ and Python bindings that allow you to
set and get multiple lines on a gpiochip with a single ioctl().

I am in communication with Bartosz, who made the libgpiod userspace
library and utilities, and Linus Walleij who created the gpiod
interface (which includes the gpiochip character devices).  They both
seem open minded to improving interfaces to address real-world use
cases.

thanks,
drew

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAEf4M_CwHFenvJGEiDtdJ3pTbmHy7bdxt%3DMW5zfhDT_nP5D7%2BA%40mail.gmail.com.


Re: [beagleboard] libgpiod on Beaglebone AI

2020-03-27 Thread John Allwine
That was it! gpioget gpiochip3 10 worked.

Thanks Robert!

On Friday, March 27, 2020 at 9:42:15 AM UTC-6, RobertCNelson wrote:
>
> On Fri, Mar 27, 2020 at 10:34 AM John Allwine  > wrote: 
> > 
> > I'm looking into using libgpiod to control the GPIO on the Beaglebone AI 
> in user space. I'm starting small and trying to use the included command 
> line tools gpioget and gpioset, but not having any success. 
> > 
> > The Beaglebone AI System Manual lists what looks like the gpio chip and 
> line under pinmux mode 14. P8.19 looks to be gpiochip4 line 10. Am I 
> reading that right? 
> > 
> > I have P8.19 configured in a device tree overlay to be an INPUT_PULLUP, 
> pinmuxed to mode 14. I have a button wired up to P8.19, which shorts it to 
> GND. I have verified that the button works using sysfs P8.19 GPIO number is 
> 106, also listed in the same table from the system manual): 
> > 
> > echo 106 > /sys/class/gpio/export 
> > cat /sys/class/gpio/gpio106/value 
> > 
> > The last command outputs 1 when the button is not depressed, 0 when it 
> is, as expected. I'm unable to use gpioget to see the same results: 
> > 
> > gpioget gpiochip4 10 
> > 
> > When I run that, I always get back 0. Any thoughts? 
>
> You can use gpioinfo to dump the whole pin list.. 
>
> sudo gpioinfo 
>
> But, 106 = 3*32 +10 - which should be gpiochip3 10, as long as the 
> gpio's are linear.. 
>
> You can also run: 
>
> sudo /opt/scripts/device/bone/show-pins.pl 
>
> Which is nicely documented, only using the legacy method.. 
>
> Regards, 
>
> -- 
> Robert Nelson 
> https://rcn-ee.com/ 
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/27d5abc0-0292-40ae-8a2f-d4efd2437d35%40googlegroups.com.


Re: [beagleboard] libgpiod on Beaglebone AI

2020-03-27 Thread Robert Nelson
On Fri, Mar 27, 2020 at 10:34 AM John Allwine  wrote:
>
> I'm looking into using libgpiod to control the GPIO on the Beaglebone AI in 
> user space. I'm starting small and trying to use the included command line 
> tools gpioget and gpioset, but not having any success.
>
> The Beaglebone AI System Manual lists what looks like the gpio chip and line 
> under pinmux mode 14. P8.19 looks to be gpiochip4 line 10. Am I reading that 
> right?
>
> I have P8.19 configured in a device tree overlay to be an INPUT_PULLUP, 
> pinmuxed to mode 14. I have a button wired up to P8.19, which shorts it to 
> GND. I have verified that the button works using sysfs P8.19 GPIO number is 
> 106, also listed in the same table from the system manual):
>
> echo 106 > /sys/class/gpio/export
> cat /sys/class/gpio/gpio106/value
>
> The last command outputs 1 when the button is not depressed, 0 when it is, as 
> expected. I'm unable to use gpioget to see the same results:
>
> gpioget gpiochip4 10
>
> When I run that, I always get back 0. Any thoughts?

You can use gpioinfo to dump the whole pin list..

sudo gpioinfo

But, 106 = 3*32 +10 - which should be gpiochip3 10, as long as the
gpio's are linear..

You can also run:

sudo /opt/scripts/device/bone/show-pins.pl

Which is nicely documented, only using the legacy method..

Regards,

-- 
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYi3N5Y1fZ-oey5T7FtivBDn32vRAH_EZYVXPsqXdY6cMg%40mail.gmail.com.