Difference between revisions of "Hammer Buzzer Driver"
Line 1: | Line 1: | ||
== UserSpace Access == | == UserSpace Access == | ||
− | the buzzer on the carrier board can be accessed from userspace via the sysfs interface. example interfaces are in /sys/devices/platform/tct_hammer-beeper.0/input:input1 .the directory include a file entry "beep" and "duration". to generate a beep echo a non zero value to the beep file entry: | + | the buzzer on the carrier board can be accessed from userspace via the sysfs interface. example interfaces are in the directory marked /sys/devices/platform/tct_hammer-beeper.0/input:input1. the directory include a file entry "beep" and "duration". to generate a beep echo a non zero value to the beep file entry: |
echo 4096 > /sys/devices/platform/tct_hammer-beeper.0/input\:input1/beep | echo 4096 > /sys/devices/platform/tct_hammer-beeper.0/input\:input1/beep |
Revision as of 08:13, 29 January 2008
UserSpace Access
the buzzer on the carrier board can be accessed from userspace via the sysfs interface. example interfaces are in the directory marked /sys/devices/platform/tct_hammer-beeper.0/input:input1. the directory include a file entry "beep" and "duration". to generate a beep echo a non zero value to the beep file entry:
echo 4096 > /sys/devices/platform/tct_hammer-beeper.0/input\:input1/beep
a tone will be generated for the length set in the duration file. to see what the current value is do:
cat /sys/devices/platform/tct_hammer-beeper.0/input\:input1/duration
the duration is measured in .01 seconds, i.e. a value of 100 is 1 second. if the value of duration is set for zero, the tone will be generated continuously until a zero value is echo'd to the beep entry:
echo 0 > /sys/devices/platform/tct_hammer-beeper.0/input\:input1/duration
echo 4096 > /sys/devices/platform/tct_hammer-beeper.0/input\:input1/beep
(tone generated)
echo 0 > /sys/devices/platform/tct_hammer-beeper.0/input\:input1/beep
(tone stops)