Hi,
I'm trying to drive gpio[32:63] up and down from linux con dm6446, but
I'm not able to get any result.
I'm using this program I wrote by following sprue25. Can you please
test it? Does it work for you? Or do you have an idea why it doesn't
work?
Thanks in advance,
Ottavio
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
#define PINMUX0 0x01C40000
#define PINMUX1 0x01C40004
#define DIR23 0x01c67038
#define OUT_DATA23 0x01c6703c
#define SET_DATA23 0x01c67040
int main ()
{
int fd;
uint32_t c;
fd = open ("/dev/port", O_RDWR);
if (fd == -1)
{
perror ("open: ");
exit (0);
}
c = 0x00000000;
lseek (fd, PINMUX1, SEEK_SET);
read (fd, &c, 4);
printf ("PINMUX1 %x\n", c);
c = 0x00000000;
lseek (fd, DIR23, SEEK_SET);
write (fd, &c, 4);
lseek (fd, DIR23, SEEK_SET);
read (fd, &c, 4);
printf ("DIR23 %x\n", c);
c = 0xffffffff;
lseek (fd, SET_DATA23, SEEK_SET);
write (fd, &c, 4);
lseek (fd, SET_DATA23, SEEK_SET);
read (fd, &c, 4);
printf ("SET_DATA23 %x\n", c);
c = 0xffffffff;
lseek (fd, OUT_DATA23, SEEK_SET);
write (fd, &c, 4);
lseek (fd, OUT_DATA23, SEEK_SET);
read (fd, &c, 4);
printf ("OUT_DATA23 %x\n", c);
close (fd);
return 0;
}
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source