GPIO based LEDs with USR LED functions

51 views
Skip to first unread message

michael c

unread,
May 4, 2017, 2:19:10 AM5/4/17
to BeagleBoard
i really thought i would find this online someplace but,
can i use the trigger and heartbeat type functions on a LED connected to GPIO on my custom board based on the BBB design?
this would save me time in my code that is already quite busy.
i noticed some example from 3.14 kernel days
i'm 4.4.62 and ubuntu 16.04
and controlling them from c code.

thanks so much, 
Michael

William Hermans

unread,
May 4, 2017, 3:07:30 AM5/4/17
to beagl...@googlegroups.com
Can you ask a more specific question ? It seems as though as you;re asking if you can use the sysfs file system to control USR0-USR3 ?
 The answer is yes, you can, but it largely depends on which drivers you're loading with your hardware. Using /dev/mem/ + mmap all you need to know if the memory map for the GPIO pins. But for sysfs access, you need to load certain drivers at boot.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/2cd59eb1-ec6f-4c29-a548-072ba0633aee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

abraxas1

unread,
May 4, 2017, 3:53:46 AM5/4/17
to beagl...@googlegroups.com
excellent, thanks.
this is my first exposure to overlays etc... now i see about sysfs.
i'll just blink leds in my code. using threads won't suck up hardly any processor time.
ciao,


On Thu, May 4, 2017 at 12:07 AM William Hermans <yyr...@gmail.com> wrote:
Can you ask a more specific question ? It seems as though as you;re asking if you can use the sysfs file system to control USR0-USR3 ?
 The answer is yes, you can, but it largely depends on which drivers you're loading with your hardware. Using /dev/mem/ + mmap all you need to know if the memory map for the GPIO pins. But for sysfs access, you need to load certain drivers at boot.

On Wed, May 3, 2017 at 11:19 PM, michael c <abra...@gmail.com> wrote:
i really thought i would find this online someplace but,
can i use the trigger and heartbeat type functions on a LED connected to GPIO on my custom board based on the BBB design?
this would save me time in my code that is already quite busy.
i noticed some example from 3.14 kernel days
i'm 4.4.62 and ubuntu 16.04
and controlling them from c code.

thanks so much, 
Michael

--
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.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/V_xNqTVXtbU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORq-qjC62rrD6yoo-W5twFWsdGN%2BrhXDPNSxDduPTEiayw%40mail.gmail.com.

William Hermans

unread,
May 4, 2017, 4:10:21 AM5/4/17
to beagl...@googlegroups.com
OK so assuming you have everything loaded as per the normal Debian image . . .
root@wgd:~# ls /sys/class/leds/
beaglebone:green:usr0  beaglebone:green:usr1  beaglebone:green:usr2  beaglebone:green:usr3


This is the path you're looking for then:
root@wgd:~# ls /sys/class/leds/beaglebone:green:usr0
brightness  device  invert  max_brightness  power  subsystem  trigger  uevent

You can work with individual led files from there. Which I do not remember how closely this matched to earlier kernels . . . It's been a long time for me since I've worked with anything but kernel 4.x . . .


On Thu, May 4, 2017 at 12:53 AM, abraxas1 <abra...@gmail.com> wrote:
excellent, thanks.
this is my first exposure to overlays etc... now i see about sysfs.
i'll just blink leds in my code. using threads won't suck up hardly any processor time.
ciao,


On Thu, May 4, 2017 at 12:07 AM William Hermans <yyr...@gmail.com> wrote:
Can you ask a more specific question ? It seems as though as you;re asking if you can use the sysfs file system to control USR0-USR3 ?
 The answer is yes, you can, but it largely depends on which drivers you're loading with your hardware. Using /dev/mem/ + mmap all you need to know if the memory map for the GPIO pins. But for sysfs access, you need to load certain drivers at boot.

On Wed, May 3, 2017 at 11:19 PM, michael c <abra...@gmail.com> wrote:
i really thought i would find this online someplace but,
can i use the trigger and heartbeat type functions on a LED connected to GPIO on my custom board based on the BBB design?
this would save me time in my code that is already quite busy.
i noticed some example from 3.14 kernel days
i'm 4.4.62 and ubuntu 16.04
and controlling them from c code.

thanks so much, 
Michael

--
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+unsubscribe@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/V_xNqTVXtbU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard+unsubscribe@googlegroups.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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAHSSfWPZ%3D6%2BDOENYgi%2Bmw3ghad-STYHL5CdyJN3XWQyzgtGn7Q%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages