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

GPIO



From the code below (from http://mhonarc.axis.se/dev-etrax/msg02558.html), how do I determine which pins are going to be set?  How would I have determined that 0xffff << 8 is referring to the 16 data pins on the parallel ports?  

Also, is oe = 0x1 << 5 for enabling output on the parallel port?  Is this unnecessary if the parallel port is disabled in the kernel?

>   mask = 0xffff << 8;
>   oe = 0x1 << 5;
>   ioctl(altera, _IO(ETRAXGPIO_IOCTYPE, IO_SETGET_OUTPUT), &mask);
>   ioctl(altera, _IO(ETRAXGPIO_IOCTYPE, IO_SETBITS), oe);
>   for (i=0; i<val[1]; i++){
>     for (j=0; j<16; j++){
>       data = mask - (0x1 << j+8);

Thanks,
Dave