ht_ioctl()


Configuring and Operating the designaed hardware timer(HT)

Description

int ht_ioctl(int $ht_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

Reterns return value for each command

Example

<?php
include "/lib/sd_340.php";
ht_ioctl(0, "set div us");            // unit: micro second
ht_ioctl(0, "set mode output pulse"); // setting the HT0's mode to output pulse mode
ht_ioctl(0, "set count 100 100");     // pulse period: width - 200 us, duty cycle - 50%
ht_ioctl(0, "set repc 2");            // number of pulse outputs - 2
ht_ioctl(0, "start");                 // start the HT0
sleep(1);
ht_ioctl(0, "stop");                  // stop the HT0
?>

See also