RTEMS GPIO usage issue
Marjorie Dugrand
marjorie.dugrand at gmail.com
Tue Jun 3 16:48:48 UTC 2014
Hi All,
I am currently working on a FPGA Nexys3, I synthesized on it a processor
Leon3, above which I put an OS RTEMS.
I faced a lot of difficulties developing RTEMS applications, so I
decided to focus on interacting with the LEDs and switches of the
Nexys3, but even this I can't seem to be able to implement. I think I
understood the methods I had to use, and designed a little test of my
own :
#include <rtems.h>
#include <gpiolib.h>
#include <stdio.h>
#include <stdlib.h>
#define LED_ADR IO_L2P_CMPCLK
int main() {
void * port;
int val = 0;
printf("Attempting to open the port\n");
gpiolib_initialize();
port = gpiolib_open(LED_ADR);
if (port == NULL) {
printf("ok not working\n");
exit(-1);
}
printf("Opening succeded\n");
printf("Attempting to write in the port\n");
gpiolib_set(port,0,0);
printf("Writing succeeded\n");
printf("Attempting to read the port\n");
gpiolib_get(port, &val);
printf("Reading succeeded\n");
printf("value : %d\n, val);
printf("Attempting to close the port\n");
gpiolib_close(port);
printf("Port closed\n");
return 0;
}
but I spent days trying to find out the adress of the ports I would
like to open,
and searched all over the Internet (including all the available
documentation),
with no success.
I would really like it if someone could help me.
Many thanks,
Marjorie Dugrand
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20140603/99b4d9d2/attachment.html>
More information about the devel
mailing list