ht_ioctl()


指定HT(hardware timer)的设定及使用

Description

int ht_ioctl(int $ht_id, string $cmd)

Parameters

在$cmd上可使用的命令种类及使用方法请参考 PHPoC Device Programming Guide for P40

Return Value

根据命令返还的值

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