From 4456ca8827c59d8711e76bd644336d5b3cd344dd Mon Sep 17 00:00:00 2001 From: px4dev Date: Sat, 25 Aug 2012 00:12:11 -0700 Subject: Sensor IOCTL reorganization. Common sensor operations are now shared across sensor drivers. Revamp hmc5883, ms5611 and mpu6000 driver startup and test code. --- apps/drivers/drv_gyro.h | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'apps/drivers/drv_gyro.h') 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 #include +#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 */ -- cgit v1.2.3