Re: [beagleboard] config-pin for gpio output

2020-06-05 Thread TJF
Am Freitag, 5. Juni 2020 13:06:48 UTC+2 schrieb Drew Fustini:
>
> How does the library change the pinmux during runtime?
>

It contains a LKM (loadable kernel module) that can set any pin 
configuration (ie. PRU-GPIO with pull-[up,down] at SD card slot) at 
run-time. All members of system group "pruio" have pinmuxing access from 
user space. This concept saves lots of kernel memory and more than six 
seconds boot-time.

Check out the documentation 

.

Regards

-- 
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/86e53921-2c86-43c9-8440-9e9e66be71dco%40googlegroups.com.


Re: [beagleboard] config-pin for gpio output

2020-06-05 Thread Daniel Kulp

The GPIO utils in FPP use a combination 
of /sys/devices/platform/ocp/ocp:%s_pinmux/state 
and /sys/class/gpio/gpio%u/ locations to configure the pin in various 
ways.   See:

https://github.com/FalconChristmas/fpp/blob/master/src/util/BBBUtils.cpp#L228

Some of it is a bit complex as some pins may need to boot up in i2c mode 
but then be flipped to gpio/out. 

The idea of using libgpiod is "ok" but doesn't allow configuring the 
internal pull ups for the input (at least until kernel 5.4 and a newer 
version of libgpiod)

Dan



On Friday, June 5, 2020 at 7:06:48 AM UTC-4, Drew Fustini wrote:
>
> On Fri, Jun 5, 2020 at 6:58 AM TJF > 
> wrote: 
> > 
> > Am Mittwoch, 3. Juni 2020 16:27:38 UTC+2 schrieb RobertCNelson: 
> >> 
> >> The proper way is to use libgpiod tools such as gpioset ;) 
> > 
> > 
> > The proper way is to use libpruio and do pinmuxing single source in the 
> code ;) 
> > 
> > pruio_gpio_setValue(io, P9_11, [0,1]); 
>
> How does the library change the pinmux during runtime? 
>
> Does it use /sys/devices/platform/ocp/ocp:P9_11_pinmux/state? (which 
> is created by bone-pinmux-helper) 
>
> 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/22759d88-d8da-431b-bf4c-6ada232fefc6o%40googlegroups.com.


Re: [beagleboard] config-pin for gpio output

2020-06-05 Thread Drew Fustini
On Fri, Jun 5, 2020 at 6:58 AM TJF  wrote:
>
> Am Mittwoch, 3. Juni 2020 16:27:38 UTC+2 schrieb RobertCNelson:
>>
>> The proper way is to use libgpiod tools such as gpioset ;)
>
>
> The proper way is to use libpruio and do pinmuxing single source in the code 
> ;)
>
> pruio_gpio_setValue(io, P9_11, [0,1]);

How does the library change the pinmux during runtime?

Does it use /sys/devices/platform/ocp/ocp:P9_11_pinmux/state? (which
is created by bone-pinmux-helper)

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_C8Zk3pv0jnf_JyF5UaYUwU9LPmKuzKMaNcaJ3kz0pBLw%40mail.gmail.com.


Re: [beagleboard] config-pin for gpio output

2020-06-04 Thread TJF
Am Mittwoch, 3. Juni 2020 16:27:38 UTC+2 schrieb RobertCNelson:
>
> The proper way is to use libgpiod tools such as gpioset ;) 
>

The proper way is to use libpruio and do pinmuxing single source in the 
code ;)

pruio_gpio_setValue(io, P9_11, [0,1]);

Regards

-- 
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/51c20752-2b74-4051-9bf1-a74ae551e455o%40googlegroups.com.


Re: [beagleboard] config-pin for gpio output

2020-06-04 Thread Mark A. Yoder
Well, my solution, for now, was to write a wrapper[1] for config-pin that 
uses gpioinfo when 'in' or 'out' are used.

--Mark

[1] 
https://github.com/MarkAYoder/PRUCookbook/blob/v2.0/docs/common/config-pin.sh

On Wednesday, June 3, 2020 at 10:27:38 AM UTC-4, RobertCNelson wrote:
>
> On Wed, Jun 3, 2020 at 9:15 AM Mark A. Yoder <> wrote: 
> > 
> > So is, 
> >  echo out > /sys/class/gpio/gpio30/direction 
> > 
> > The proper way to set it to output? 
>
> The proper way is to use libgpiod tools such as gpioset ;) 
>
> sudo gpioset gpiochip0 30=1 
>
> But that old way still woks. 
>
> 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/80eeb3ac-bdff-4bf4-82d0-43781dbe8371%40googlegroups.com.


Re: [beagleboard] config-pin for gpio output

2020-06-03 Thread Robert Nelson
On Wed, Jun 3, 2020 at 9:15 AM Mark A. Yoder  wrote:
>
> So is,
>  echo out > /sys/class/gpio/gpio30/direction
>
> The proper way to set it to output?

The proper way is to use libgpiod tools such as gpioset ;)

sudo gpioset gpiochip0 30=1

But that old way still woks.

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/CAOCHtYjsqVfgo_P_JZgZvK2naosBMXZphUAut4xKQJpgJ7VJjA%40mail.gmail.com.


Re: [beagleboard] config-pin for gpio output

2020-06-03 Thread Mark A. Yoder
So is,  
 echo out > /sys/class/gpio/gpio30/direction

The proper way to set it to output?

--Mark

On Wednesday, June 3, 2020 at 9:45:00 AM UTC-4, RobertCNelson wrote:
>
> On Wed, Jun 3, 2020 at 8:16 AM Mark A. Yoder  wrote: 
> > 
> > In the day I did: 
> > 
> > config-pin P9_11 out 
> > 
> > to make it a gpio output.  Now it appears I have to do: 
> > 
> > config-pin P9_11 gpio 
> > 
> > But how do I make it an output?  Must I do: 
> > 
> > echo out > /sys/class/gpio/gpio30/direction  ? 
>
> The concept of out/in is not currently supported in the c based 
> re-write of config-pin used in Buster.. 
>
>
> https://github.com/beagleboard/bb.org-overlays/tree/master/tools/pmunts_muntsos
>  
>
>
> https://github.com/beagleboard/bb.org-overlays/blob/master/tools/beaglebone-universal-io/config-pin#L1088-L1108
>  
>
> 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/9ec1351c-9cfe-4e82-9b34-9b099dc2c33c%40googlegroups.com.


Re: [beagleboard] config-pin for gpio output

2020-06-03 Thread Robert Nelson
On Wed, Jun 3, 2020 at 8:16 AM Mark A. Yoder  wrote:
>
> In the day I did:
>
> config-pin P9_11 out
>
> to make it a gpio output.  Now it appears I have to do:
>
> config-pin P9_11 gpio
>
> But how do I make it an output?  Must I do:
>
> echo out > /sys/class/gpio/gpio30/direction  ?

The concept of out/in is not currently supported in the c based
re-write of config-pin used in Buster..

https://github.com/beagleboard/bb.org-overlays/tree/master/tools/pmunts_muntsos

https://github.com/beagleboard/bb.org-overlays/blob/master/tools/beaglebone-universal-io/config-pin#L1088-L1108

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/CAOCHtYi2YMw%3DdEY-TjoNREDHz%3D-8aLBZ-dGsfPBKyOG8Dcgd4w%40mail.gmail.com.


[beagleboard] config-pin for gpio output

2020-06-03 Thread Mark A. Yoder
In the day I did:

*config-pin P9_11 out*

to make it a gpio output.  Now it appears I have to do:

*config-pin P9_11 gpio*

But how do I make it an output?  Must I do:

*echo out > /sys/class/gpio/gpio30/direction*  ?

--Mark

-- 
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/850578e5-9a98-466c-8f0e-8409f70254e3%40googlegroups.com.