i2c_ioctl()


Configuring or using I2C

Description

int/string i2c_ioctl(int $i2c_id, string $cmd)

Parameters

refer to the document named PHPoC Device Programming Guide for P40 for the details about commands available on $cmd

Return Value

return value for each command

Example

<?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
?>

See also