Re: [beagleboard] /sys/class/gpio vs. DTB
Yeah, as I was saying, I actually do remember how to do that, and successfully did. I still end up having to do the export and then other sysfs stuff to set the values. Which, as I think about it, setting the values in the DTB is not so useful.* I do need to turn things on and off only under software control. But it'd be nice to get rid of the export step. *There are a couple of GPIOs that turn regulators on and enable some of my audio circuitry. In theory, I can build the device tree including those, and then the audio APIs turn them on automatically when audio is enabled. But I've had limited success with getting that right. > On Apr 3, 2016, at 17:26 , William Hermanswrote: > > Here Rick, maybe this will refresh you on the subject. > http://stackoverflow.com/questions/16872763/configuring-pins-mode-beaglebone > second answer I think talks about device tree files, while the first one > talks about some crazy script method . . . > > But essentially, and I'm no expert here, and from the second answer . . . > > pinctrl-single,pins = < > 0x070 0x2f /* P9_11 30 INPUT MODE7 none */ > 0x074 0x2f /* P9_13 31 INPUT MODE7 none */ > 0x040 0x2f /* P9_15 48 INPUT MODE7 none */ > 0x15c 0x2f /* P9_17 05 INPUT MODE7 none */ > >; > > This in it's self does a lot of explaining here. Check out the comments for > each pin, and mode. > > On Sun, Apr 3, 2016 at 5:18 PM, Rick Mann wrote: > > > On Apr 3, 2016, at 17:07 , William Hermans wrote: > > > > Yes, it can be done. I thought you had all this down before ? You can > > configure what mode the pin is actually used for - The several different > > peripheral types per pin, or GPIO + pull up/down or neither, and pin > > direction. > > Sorry, I haven't been able to touch this since last summer, and I don't > always remember what I figured out. I do recall that I can set up the pin, > but I've never figured out for sure how to set the output state. > > Also, I've never succeeded in getting a full DTB working (one that sets up my > pins, ADC, PRU, and audio). I'm hoping enough progress has been made in the > kernels that I can finally get there. And I'm getting closer, just not quite > there yet. > > -- > Rick Mann > rm...@latencyzero.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. > For more options, visit https://groups.google.com/d/optout. > > > -- > 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. > For more options, visit https://groups.google.com/d/optout. -- Rick Mann rm...@latencyzero.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. For more options, visit https://groups.google.com/d/optout.
Re: [beagleboard] /sys/class/gpio vs. DTB
Here Rick, maybe this will refresh you on the subject. http://stackoverflow.com/questions/16872763/configuring-pins-mode-beaglebone second answer I think talks about device tree files, while the first one talks about some crazy script method . . . But essentially, and I'm no expert here, and from the second answer . . . pinctrl-single,pins = < 0x070 0x2f /* P9_11 30 INPUT MODE7 none */ 0x074 0x2f /* P9_13 31 INPUT MODE7 none */ 0x040 0x2f /* P9_15 48 INPUT MODE7 none */ 0x15c 0x2f /* P9_17 05 INPUT MODE7 none */ >; This in it's self does a lot of explaining here. Check out the comments for each pin, and mode. On Sun, Apr 3, 2016 at 5:18 PM, Rick Mannwrote: > > > On Apr 3, 2016, at 17:07 , William Hermans wrote: > > > > Yes, it can be done. I thought you had all this down before ? You can > configure what mode the pin is actually used for - The several different > peripheral types per pin, or GPIO + pull up/down or neither, and pin > direction. > > Sorry, I haven't been able to touch this since last summer, and I don't > always remember what I figured out. I do recall that I can set up the pin, > but I've never figured out for sure how to set the output state. > > Also, I've never succeeded in getting a full DTB working (one that sets up > my pins, ADC, PRU, and audio). I'm hoping enough progress has been made in > the kernels that I can finally get there. And I'm getting closer, just not > quite there yet. > > -- > Rick Mann > rm...@latencyzero.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. > For more options, visit https://groups.google.com/d/optout. > -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [beagleboard] /sys/class/gpio vs. DTB
> On Apr 3, 2016, at 17:07 , William Hermanswrote: > > Yes, it can be done. I thought you had all this down before ? You can > configure what mode the pin is actually used for - The several different > peripheral types per pin, or GPIO + pull up/down or neither, and pin > direction. Sorry, I haven't been able to touch this since last summer, and I don't always remember what I figured out. I do recall that I can set up the pin, but I've never figured out for sure how to set the output state. Also, I've never succeeded in getting a full DTB working (one that sets up my pins, ADC, PRU, and audio). I'm hoping enough progress has been made in the kernels that I can finally get there. And I'm getting closer, just not quite there yet. -- Rick Mann rm...@latencyzero.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. For more options, visit https://groups.google.com/d/optout.
Re: [beagleboard] /sys/class/gpio vs. DTB
> > *configure a few GPIOs for my application. Is this something that can be > accomplished entirely via DTB?* > > * # cd /sys/class/gpio* > > * # echo 50 > export* > * # echo 115 > export* > * # echo out > gpio50/direction* > * # echo out > gpio115/direction* > > * # echo 1 > gpio50/value* > * # echo 1 > gpio115/value* > > * # echo 0 > gpio50/value* > * # echo 0 > gpio115/value* > > * That is, setting which GPIOs are enabled, setting their direction, and > setting their output state?* > > * Thanks,* > Yes, it can be done. I thought you had all this down before ? You can configure what mode the pin is actually used for - The several different peripheral types per pin, or GPIO + pull up/down or neither, and pin direction. On Sun, Apr 3, 2016 at 4:52 PM, John Synewrote: > Why not do it in your applications? > > http://derekmolloy.ie/kernel-gpio-programming-buttons-and-leds/ > > Regards, > John > > > > > > On Apr 3, 2016, at 4:14 PM, Rick Mann wrote: > > > > I configure a few GPIOs for my application. Is this something that can > be accomplished entirely via DTB? > > > > # cd /sys/class/gpio > > > > # echo 50 > export > > # echo 115 > export > > # echo out > gpio50/direction > > # echo out > gpio115/direction > > > > # echo 1 > gpio50/value > > # echo 1 > gpio115/value > > > > # echo 0 > gpio50/value > > # echo 0 > gpio115/value > > > > That is, setting which GPIOs are enabled, setting their direction, and > setting their output state? > > > > Thanks, > > > > -- > > Rick Mann > > rm...@latencyzero.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. > > For more options, visit https://groups.google.com/d/optout. > > -- > 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. > For more options, visit https://groups.google.com/d/optout. > -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [beagleboard] /sys/class/gpio vs. DTB
Why not do it in your applications? http://derekmolloy.ie/kernel-gpio-programming-buttons-and-leds/ Regards, John > On Apr 3, 2016, at 4:14 PM, Rick Mannwrote: > > I configure a few GPIOs for my application. Is this something that can be > accomplished entirely via DTB? > > # cd /sys/class/gpio > > # echo 50 > export > # echo 115 > export > # echo out > gpio50/direction > # echo out > gpio115/direction > > # echo 1 > gpio50/value > # echo 1 > gpio115/value > > # echo 0 > gpio50/value > # echo 0 > gpio115/value > > That is, setting which GPIOs are enabled, setting their direction, and > setting their output state? > > Thanks, > > -- > Rick Mann > rm...@latencyzero.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. > For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.