Quoting Luca <[EMAIL PROTECTED]>:
> Hi,
> I was trying to make to work directly l i2c with python with the
> calls ioctl.
Nice idea :)
> File "pcf8591_ioctl.py", line 168, in i2c_open
> fcntl.ioctl(i2c_fd, _IO(ETRAXGPIO_IOCTYPE, IO_SETGET_OUTPUT), 0,
> iomask)
> TypeError: ioctl requires a file or file descriptor, an integer and
> optionally a integer or buffer argument
Look at your _IO definition:
> def _IO(type,nr):
> _IOC(_IOC_NONE,(type),(nr),0)
You forgot the return statement:
def _IO(type,nr):
return _IOC(_IOC_NONE,(type),(nr),0)
BTW, all of your function have this problem.
HTH,
Ant9000