aboutsummaryrefslogtreecommitdiffstats
path: root/cphidgetaccelerometer.h
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2012-04-14 12:56:48 +0100
committerJonathan McCrohan <jmccrohan@gmail.com>2012-04-14 12:56:48 +0100
commit0b624384cd52be20e61284551d832b499d7b7707 (patch)
tree6f95a4bbef47abc9720b96c0722e8f632aef228a /cphidgetaccelerometer.h
downloadlibphidget21-0b624384cd52be20e61284551d832b499d7b7707.tar.gz
Imported Upstream version 2.1.8.20120216upstream/2.1.8.20120216
Diffstat (limited to 'cphidgetaccelerometer.h')
-rw-r--r--cphidgetaccelerometer.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/cphidgetaccelerometer.h b/cphidgetaccelerometer.h
new file mode 100644
index 0000000..7b4cdd7
--- /dev/null
+++ b/cphidgetaccelerometer.h
@@ -0,0 +1,85 @@
+#ifndef __CPHIDGETACCELEROMETER
+#define __CPHIDGETACCELEROMETER
+#include "cphidget.h"
+
+/** \defgroup phidaccel Phidget Accelerometer
+ * \ingroup phidgets
+ * Calls specific to the Phidget Accelerometer. See the product manual for more specific API details, supported functionality, units, etc.
+ * @{
+ */
+
+DPHANDLE(Accelerometer)
+CHDRSTANDARD(Accelerometer)
+
+/**
+ * Gets the number of acceleration axes supported by this accelerometer.
+ * @param phid An attached phidget accelerometer handle.
+ * @param count The axis count.
+ */
+CHDRGET(Accelerometer,AxisCount,int *count)
+
+/**
+ * Gets the current acceleration of an axis.
+ * @param phid An attached phidget accelerometer handle.
+ * @param index The acceleration index.
+ * @param acceleration The acceleration.
+ */
+CHDRGETINDEX(Accelerometer,Acceleration,double *acceleration)
+/**
+ * Gets the maximum accleration supported by an axis.
+ * @param phid An attached phidget accelerometer handle.
+ * @param index The acceleration index
+ * @param max The maximum acceleration
+ */
+CHDRGETINDEX(Accelerometer,AccelerationMax,double *max)
+/**
+ * Gets the minimum acceleraiton supported by an axis.
+ * @param phid An attached phidget accelerometer handle.
+ * @param index The acceleration index
+ * @param min The minimum acceleraion
+ */
+CHDRGETINDEX(Accelerometer,AccelerationMin,double *min)
+/**
+ * Sets an acceleration change event handler. This is called when the acceleration changes by more then the change trigger.
+ * @param phid A phidget accelerometer handle.
+ * @param fptr Callback function pointer.
+ * @param userPtr A pointer for use by the user - this value is passed back into the callback function.
+ */
+CHDREVENTINDEX(Accelerometer,AccelerationChange,double acceleration)
+/**
+ * Gets the change trigger for an axis.
+ * @param phid An attached phidget accelerometer handle.
+ * @param index The acceleration index
+ * @param trigger The change trigger.
+ */
+CHDRGETINDEX(Accelerometer,AccelerationChangeTrigger,double *trigger)
+/**
+ * Sets the change trigger for an axis.
+ * @param phid An attached phidget accelerometer handle.
+ * @param index The acceleration index
+ * @param trigger The change trigger.
+ */
+CHDRSETINDEX(Accelerometer,AccelerationChangeTrigger,double trigger)
+
+#ifndef REMOVE_DEPRECATED
+DEP_CHDRGET("Deprecated - use CPhidgetAccelerometer_getAxisCount",Accelerometer,NumAxis,int *)
+#endif
+
+#ifndef EXTERNALPROTO
+#define ACCEL_MAXAXES 3
+struct _CPhidgetAccelerometer {
+ CPhidget phid;
+ int (CCONV *fptrAccelerationChange)(CPhidgetAccelerometerHandle, void *, int, double);
+ void *fptrAccelerationChangeptr;
+
+ double axis[ACCEL_MAXAXES];
+ double axisChangeTrigger[ACCEL_MAXAXES];
+ double axisLastTrigger[ACCEL_MAXAXES];
+
+ double accelerationMax, accelerationMin;
+} typedef CPhidgetAccelerometerInfo;
+#endif
+
+/** @} */
+
+#endif