aboutsummaryrefslogtreecommitdiff
path: root/apps/drivers/drv_gyro.h
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2012-08-25 00:12:11 -0700
committerpx4dev <px4@purgatory.org>2012-08-25 00:12:11 -0700
commit4456ca8827c59d8711e76bd644336d5b3cd344dd (patch)
treebc1f646e83d3649459540b75a752d0a7c3b164d9 /apps/drivers/drv_gyro.h
parentf901a35bd4393523c48a73a805b0f5d451cec35d (diff)
downloadpx4-firmware-4456ca8827c59d8711e76bd644336d5b3cd344dd.tar.gz
px4-firmware-4456ca8827c59d8711e76bd644336d5b3cd344dd.tar.bz2
px4-firmware-4456ca8827c59d8711e76bd644336d5b3cd344dd.zip
Sensor IOCTL reorganization. Common sensor operations are now shared across sensor drivers.
Revamp hmc5883, ms5611 and mpu6000 driver startup and test code.
Diffstat (limited to 'apps/drivers/drv_gyro.h')
-rw-r--r--apps/drivers/drv_gyro.h34
1 files changed, 19 insertions, 15 deletions
diff --git a/apps/drivers/drv_gyro.h b/apps/drivers/drv_gyro.h
index 2f1dab6ba..48c63d5f4 100644
--- a/apps/drivers/drv_gyro.h
+++ b/apps/drivers/drv_gyro.h
@@ -41,6 +41,7 @@
#include <stdint.h>
#include <sys/ioctl.h>
+#include "drv_sensor.h"
#include "drv_orb_dev.h"
#define GYRO_DEVICE_PATH "/dev/gyro"
@@ -81,28 +82,31 @@ ORB_DECLARE(sensor_gyro);
* ioctl() definitions
*/
-#define _GYROIOCBASE (0x2200)
+#define _GYROIOCBASE (0x2300)
#define _GYROIOC(_n) (_IOC(_GYROIOCBASE, _n))
-/** set the driver polling rate to (arg) Hz, or one of the GYRO_POLLRATE constants */
-#define GYROIOCSPOLLRATE _GYROIOC(0)
-
-#define GYRO_POLLRATE_MANUAL 1000000 /**< poll when read */
-#define GYRO_POLLRATE_EXTERNAL 1000001 /**< poll when device signals ready */
-
-/** set the internal queue depth to (arg) entries, must be at least 1 */
-#define GYROIOCSQUEUEDEPTH _GYROIOC(1)
-
/** set the gyro internal sample rate to at least (arg) Hz */
-#define GYROIOCSSAMPLERATE _GYROIOC(2)
+#define GYROIOCSSAMPLERATE _GYROIOC(0)
+
+/** return the gyro internal sample rate in Hz */
+#define GYROIOCGSAMPLERATE _GYROIOC(1)
/** set the gyro internal lowpass filter to no lower than (arg) Hz */
-#define GYROIOCSLOWPASS _GYROIOC(3)
+#define GYROIOCSLOWPASS _GYROIOC(2)
-/** set the report format to (arg); zero is the standard, 1-10 are reserved, all others are driver-specific. */
-#define GYROIOCSREPORTFORMAT _GYROIOC(4)
+/** set the gyro internal lowpass filter to no lower than (arg) Hz */
+#define GYROIOCGLOWPASS _GYROIOC(3)
/** set the gyro scaling constants to (arg) */
-#define GYROIOCSSCALE _GYROIOC(5)
+#define GYROIOCSSCALE _GYROIOC(4)
+
+/** get the gyro scaling constants into (arg) */
+#define GYROIOCGSCALE _GYROIOC(5)
+
+/** set the gyro measurement range to handle at least (arg) g */
+#define GYROIOCSRANGE _GYROIOC(6)
+
+/** get the current gyro measurement range */
+#define GYROIOCGRANGE _GYROIOC(7)
#endif /* _DRV_GYRO_H */