12-31-2015, 04:31 AM
Pages: 1 2
12-31-2015, 10:28 AM
We need GPIO exposed in /sys/class via some sort of kernel module like on the Pi (sorry to bring up the pi but that's the model that PineA64 is going to have to strive to be like for community support)
The GPIO on the Odroid C1 (which uses an allwinnder quad core SOC) requires code written in C to access the GPIO (I haven't seen access via a /sys/class/GPIO or anything) but the Pcduino series, which also use the Allwinner SOC, does have a kernel module for /sys/class access. Hopefully it won't take much to mimic this behavior. I'd be willing to port the code needed to support the GPIO and other pin-specific functions.
But to more directly answer igna09, once we have access to the GPIO via filesystem (i.e. /sys/class GPIO) it will be possible to control them from a webserver using CGI-BIN in python, php, etc. Here's an example of a web-based control for the Pi: http://www.instructables.com/id/Simple-a.../?ALLSTEPS
It wouldn't be too hard to adjust the code for the pin convention the GPIO for the allwinner uses.
After that it will be possible to make an IR receiver module that is compatible with LIRC.
The GPIO on the Odroid C1 (which uses an allwinnder quad core SOC) requires code written in C to access the GPIO (I haven't seen access via a /sys/class/GPIO or anything) but the Pcduino series, which also use the Allwinner SOC, does have a kernel module for /sys/class access. Hopefully it won't take much to mimic this behavior. I'd be willing to port the code needed to support the GPIO and other pin-specific functions.
(12-31-2015, 10:28 AM)o9guy Wrote: [ -> ]We need GPIO exposed in /sys/class via some sort of kernel module like on the Pi (sorry to bring up the pi but that's the model that PineA64 is going to have to strive to be like for community support)
The GPIO on the Odroid C1 (which uses an allwinnder quad core SOC) requires code written in C to access the GPIO (I haven't seen access via a /sys/class/GPIO or anything) but the Pcduino series, which also use the Allwinner SOC, does have a kernel module for /sys/class access. Hopefully it won't take much to mimic this behavior. I'd be willing to port the code needed to support the GPIO and other pin-specific functions.
But to more directly answer igna09, once we have access to the GPIO via filesystem (i.e. /sys/class GPIO) it will be possible to control them from a webserver using CGI-BIN in python, php, etc. Here's an example of a web-based control for the Pi: http://www.instructables.com/id/Simple-a.../?ALLSTEPS
It wouldn't be too hard to adjust the code for the pin convention the GPIO for the allwinner uses.
After that it will be possible to make an IR receiver module that is compatible with LIRC.
02-07-2016, 01:56 PM
I don't mind programming in C, in fact I actually prefer it , however I am curious as to if there is a library for the GPIO yet, something like wiringPi.h?
02-07-2016, 08:25 PM
(02-07-2016, 01:56 PM)limitlesscodes Wrote: [ -> ]I don't mind programming in C, in fact I actually prefer it , however I am curious as to if there is a library for the GPIO yet, something like wiringPi.h?
If you prefers programming in C, cgeck out this link that generate by Sunxi community: http://linux-sunxi.org/GPIO
02-10-2016, 12:25 AM
(02-07-2016, 08:25 PM)tllim Wrote: [ -> ](02-07-2016, 01:56 PM)limitlesscodes Wrote: [ -> ]I don't mind programming in C, in fact I actually prefer it , however I am curious as to if there is a library for the GPIO yet, something like wiringPi.h?
If you prefers programming in C, cgeck out this link that generate by Sunxi community: http://linux-sunxi.org/GPIO
Thanks much!, are there any updates as to when ubuntu will "officially" be supported?
02-10-2016, 06:53 PM
(02-10-2016, 12:25 AM)limitlesscodes Wrote: [ -> ](02-07-2016, 08:25 PM)tllim Wrote: [ -> ](02-07-2016, 01:56 PM)limitlesscodes Wrote: [ -> ]I don't mind programming in C, in fact I actually prefer it , however I am curious as to if there is a library for the GPIO yet, something like wiringPi.h?
If you prefers programming in C, cgeck out this link that generate by Sunxi community: http://linux-sunxi.org/GPIO
Thanks much!, are there any updates as to when ubuntu will "officially" be supported?
Once the Kernel up, looking forward to happen on this month.
02-14-2016, 05:49 PM
Hey Pine64 backers! I am having difficulty figuring out how I would use C to take user input, button presses, and light LEDs with the GPIO, I understand C fairly well but have no experience with interfacing with"GPIO." Here is the best program I could think of although I believe there is a much better way to do this:
Also what determines the pin number? Thanks for your help!
Code:
/*
*Simple pulsing of GPIO example
*/
#include <stdio.h>
#include <string.h>
FILE *zero, *one;
int main(int argc, char *argv[])
{
zero = fopen("/sys/class/gpio/gpio206/value", "w");
one = fopen("/sys/class/gpio/gpio206/value", "w");
while(1)
{
fputs("0\n", zero);
fflush(zero);
fputs("1\n", one);
fflush(one);
}
}
02-14-2016, 07:12 PM
(02-14-2016, 05:49 PM)limitlesscodes Wrote: [ -> ]Hey Pine64 backers! I am having difficulty figuring out how I would use C to take user input, button presses, and light LEDs with the GPIO, I understand C fairly well but have no experience with interfacing with"GPIO." Here is the best program I could think of although I believe there is a much better way to do this:
Also what determines the pin number? Thanks for your help!Code:/*
*Simple pulsing of GPIO example
*/
#include <stdio.h>
#include <string.h>
FILE *zero, *one;
int main(int argc, char *argv[])
{
zero = fopen("/sys/class/gpio/gpio206/value", "w");
one = fopen("/sys/class/gpio/gpio206/value", "w");
while(1)
{
fputs("0\n", zero);
fflush(zero);
fputs("1\n", one);
fflush(one);
}
}
You've got the right general idea. See http://falsinsoft.blogspot.com/2012/11/a...space.html and
http://linux-sunxi.org/GPIO
02-15-2016, 06:05 PM
(02-14-2016, 07:12 PM)patrickhwood Wrote: [ -> ]I read through them, so from what I am able to understand my program would only work if the kernel supports GPIO access from sysfs, will the Pine64 support this(I really hope to hear yes)? Also, say I am trying to blink an LED, can you be so kind as to tell my a pin number on the GPIO that can do that?(02-14-2016, 05:49 PM)limitlesscodes Wrote: [ -> ]Hey Pine64 backers! I am having difficulty figuring out how I would use C to take user input, button presses, and light LEDs with the GPIO, I understand C fairly well but have no experience with interfacing with"GPIO." Here is the best program I could think of although I believe there is a much better way to do this:
Also what determines the pin number? Thanks for your help!Code:/*
*Simple pulsing of GPIO example
*/
#include <stdio.h>
#include <string.h>
FILE *zero, *one;
int main(int argc, char *argv[])
{
zero = fopen("/sys/class/gpio/gpio206/value", "w");
one = fopen("/sys/class/gpio/gpio206/value", "w");
while(1)
{
fputs("0\n", zero);
fflush(zero);
fputs("1\n", one);
fflush(one);
}
}
You've got the right general idea. See http://falsinsoft.blogspot.com/2012/11/a...space.html and
http://linux-sunxi.org/GPIO
02-16-2016, 03:15 PM
Alright, so I kind of figured out pin assignment using the GPIO image on the wiki. I still would like to know what PC, PD, PH, etc. means and when to use them vs. others. Also I would like to know if there is any better way of exporting the pins through C rather than doing something like: and
Code:
//near beginning of file
system("echo 71 > /sys/class/gpio/export")
Code:
//near end of file
system("echo 71 > /sys/class/gpio/unexport")
Pages: 1 2