Configuring or using I2C
int/string i2c_ioctl(int $i2c_id, string $cmd)
refer to the document named PHPoC Device Programming Guide for P40 for the details about commands available on $cmd
return value for each command
<?php
include "/lib/sd_340.php";
i2c_ioctl(0, "set saddr 0x0e"); // configuring I2C slave's device address
i2c_ioctl(0, "set mode sm"); // configuring I2C mode (standard mode)
i2c_ioctl(0, "req read 0"); // reading data from the I2C
i2c_ioctl(0, "req write"); // writing data to the I2C
?>