Configuring and Operating the designaed hardware timer(HT)
int ht_ioctl(int $ht_id, string $cmd)
refer to the document named PHPoC Device Programming Guide for P40 for the details about commands available on $cmd
Reterns return value for each command
<?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
?>