: lis302dl-wakeup-configuration.patch
Setup accelerometer interrupt to wake the device up
From: Simon Kagstrom <simon.kagstrom@gmail.com>
The threshold implementation recently broke this functionality. This
patch reinstates it again and simplifies the code a bit. It only
supports one of the two lis302dl interrupt sources now (which is the
only connected one on the openmoko). If you need to configure both, buy
an Iphone!
(Or flame this patch)
Note that, as before, the device immediately wakes up when put to sleep
with the wakeup configured. The interface is therefore not currently
very useful, but to use it do e.g.,
echo 1 1 1 180 0 1 > wakeup
The value is of the form
X Y Z THRESHOLD DURATION SPEC
X, Y and Z are threshold values, given as a value > 0, < 0 or 0 to
specify if an interrupt should be generated for high or low thresholds
or neither (off). THRESHOLD specifies the threshold that must be
exceeded, in mg. DURATION specifies the time in milliseconds for which
the acceleration should be measured. SPEC is either '1' or '0' and
specifies if the thresholds should be taken all together or one at a
time ('and' or 'or' mode).
Echoing '0' to the file turns off the interrupts.
Signed-off-by: Simon Kagstrom <simon.kagstrom@gmail.com>