[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

/dev/gpiog ???? one bit ??



Hi,

I test the next code:

int main(int argc, char * argv[]) {
 int fd;
 unsigned long data, mask;

  fd= open("/dev/gpiog",O_RDWR);
  if(fd == -1){
    perror("open");
    return -1;
  }

  data = mask = 0xFF << 8;
  ioctl(fd, _IO(ETRAXGPIO_IOCTYPE, IO_SETGET_OUTPUT), &mask);
  if ((mask & data) != data)
  printf("Check your kernel config\n");
  data=0x33 << 8;
  ioctl(fd, _IO(ETRAXGPIO_IOCTYPE, IO_SETBITS ),data);
  close(fd);
  return 1;
}

and haven't problem whith the line   if ((mask & data) != data) ....

I think that must see 0x33 in lp0, but always see 0xff. always 0xff on lp0.

please how can i change the bit 5 on Port G? what instruction?
where is the manual for see the chapter 20?.

Thanks.