Check Documentation/gpio.txt from kernel sources. It explains how the
sysfs interface works.
Tomi
>
> Does anybody know how to get this code to work in c? I am using the
> code sourcery G++ compiler.
Don't use that, angstrom is not compiled with a CSL compiler, so
you're facing lots of compatibility issues when using harry potter
toolchains (apart from bugs like -Os, NEON, right shifts and non-qemu
platforms not working)
regards,
Koen
if that's the case, i suspect a number of web sites should update
their recommendations. if you google on something like "angstrom
beagleboard compiler", you find a number of sites like this:
http://garrenblog.blogspot.com/2008/10/adventures-in-beagleboard-land-compiler.html
which read, "The compiler used with the Beagleboard is the one from
Codesourcery." so if people should be using a different one, a link
to that one should probably be more prominently displayed everywhere.
rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.
http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================
>
> On Fri, 13 Feb 2009, Koen Kooi wrote:
>
>>
>> Op 13 feb 2009, om 18:11 heeft aero386 het volgende geschreven:
>>
>>> Do you have a recommendation for a compiler? Before you responded
>>> that was the one I should put onto the board. I don't mind using a
>>> different one I just don't know what one to use.
>>
>> I recommended using the angstrom one, which isn't CSL for sure.
>
> if that's the case, i suspect a number of web sites should update
> their recommendations. if you google on something like "angstrom
> beagleboard compiler", you find a number of sites like this:
>
> http://garrenblog.blogspot.com/2008/10/adventures-in-beagleboard-land-compiler.html
>
> which read, "The compiler used with the Beagleboard is the one from
> Codesourcery." so if people should be using a different one, a link
> to that one should probably be more prominently displayed everywhere.
Just use the toolchain OE builds for you or install a native one from
the feeds on the beagle itself, you can't go wrong that way. I can't
stop people from posting nonsense to wikis and blogs, no do I want to.
regards,
Koen
>
>> Just use the toolchain OE builds for you or install a native one from
>> the feeds on the beagle itself, you can't go wrong that way. I can't
>> stop people from posting nonsense to wikis and blogs, no do I want
>> to.
>
> I still have not gotten OE to work Yet. I am just using the angstrom
> 2.6.28 from
>
> http://www.angstrom-distribution.org/demo/beagleboard/
>
> ...LOL Oh you know what I might be using the right compiler, I assumed
> that g++ stood for code sourcery g++. I followed this....
>
> Op 13 jan 2009, om 18:35 heeft skate...@bellsouth.net het volgende
> geschreven:
>
>> Sorry for making so many dumb requests but...I was wondering if koen
>> had made an angstrom image with a decent gui c++ compiler that had a
>> library with easy access to the gpio and usb ports and such? And if
>> so
>> where can I download it, and what is the compiler called in
>> Angstrom?
>
> "opkg install task-native-sdk" in any image and the compiler is
> called
> 'g++"
>
> regards,
>
> Koen
>
> Statement that you had made. So Do I have the right compiler?
Yes
regards,
Koen
I wrote a small lib for myself to use the GPIO pins from C++ in a mucheasier way, wrote a few examples to drive LCD displays as wellincluding a nokia 6100 lcd using SPI
http://www.youtube.com/watch?v=0JYtD60L9o4&feature=plcp
On Thursday, July 5, 2012 8:44:51 PM UTC+12, Darryl wrote:Sorry for resurrecting an ancient thread, but a few places link to here, and so I thought I'd mention a couple of things (NOTE: the following pertains to the beaglebone, but I suspect that they might apply to the beagleboard, too):
- TI has more comprehensive information at: http://processors.wiki.ti.com/index.php/GPIO_Driver_Guide In particular, there's information that describes how to control the pin direction.
- You can't control the beaglebone LEDs using GPIO (w/the default Angstrom distribution), because an LED driver is being used. Instead, you control the LEDs via something like:
# Turn off LED 1:
echo 0 > /sys/class/leds/beaglebone::usr1/brightness
# Turn on LED 1:
echo 255 > /sys/class/leds/beaglebone::usr1/brightness
The four LEDs on the beaglebone are:/sys/class/leds/beaglebone::usr0/brightness
/sys/class/leds/beaglebone::usr1/brightness
/sys/class/leds/beaglebone::usr2/brightness
/sys/class/leds/beaglebone::usr3/brightnessHOWEVER, the usr0 LED is currently used by the heartbeat, and so you shouldn't touch it, unless you know what you are doing.
Yes, the "brightness" value does go from 0-255, but the beaglebone LEDs are purely binary -- there's no brightness control. As a result, any non-zero brightness value will turn on the LED. Because of this, good programming practice dictates that the "on" value should be 255.
-- To join: http://beagleboard.org/discuss
To unsubscribe from this group, send email to:
beagleboard...@googlegroups.com
Frequently asked questions: http://beagleboard.org/faq