Hi
I am trying to set iog24 as an output line.
I have also the sx18 expansionboard.
A led call d2 is on input/output line iog24.
I'm trying to make it work.
I tried this source code
#include "stdio.h"
#include "stdlib.h"
#include "unistd.h"
#include "sys/ioctl.h"
#include "fcntl.h"
#include "asm/etraxgpio.h"
int main(void){
int fd;
int iomask;
if ((fd = open("/dev/gpiog", O_RDWR))<0) {
printf("Open error on /dev/gpiog\n");
exit(0);
}
else{
printf("open ok \n");
}
iomask= 1<<24;
printf("try to set iog24 as output \n");
ioctl(fd,_IO(ETRAXGPIO_IOCTYPE,IO_SETBITS),iomask);
close(fd);
}
Did I do something wrong or have I forgotten something?
thanks