diff options
author | px4dev <px4@purgatory.org> | 2012-08-25 00:12:11 -0700 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2012-08-25 00:12:11 -0700 |
commit | 4456ca8827c59d8711e76bd644336d5b3cd344dd (patch) | |
tree | bc1f646e83d3649459540b75a752d0a7c3b164d9 /apps/drivers/drv_accel.h | |
parent | f901a35bd4393523c48a73a805b0f5d451cec35d (diff) | |
download | px4-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_accel.h')
-rw-r--r-- | apps/drivers/drv_accel.h | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/apps/drivers/drv_accel.h b/apps/drivers/drv_accel.h index 65ef8420f..47d366bc4 100644 --- a/apps/drivers/drv_accel.h +++ b/apps/drivers/drv_accel.h @@ -41,6 +41,7 @@ #include <stdint.h> #include <sys/ioctl.h> +#include "drv_sensor.h" #include "drv_orb_dev.h" #define ACCEL_DEVICE_PATH "/dev/accel" @@ -78,33 +79,37 @@ ORB_DECLARE(sensor_accel); /* * ioctl() definitions + * + * Accelerometer drivers also implement the generic sensor driver + * interfaces from drv_sensor.h */ -#define _ACCELIOCBASE (0x2000) +#define _ACCELIOCBASE (0x2100) #define _ACCELIOC(_n) (_IOC(_ACCELIOCBASE, _n)) -/** set the driver polling rate to (arg) Hz, or one of the ACC_POLLRATE constants */ -#define ACCELIOCSPOLLRATE _ACCELIOC(0) - -#define ACC_POLLRATE_MANUAL 1000000 /**< poll when read */ -#define ACC_POLLRATE_EXTERNAL 1000001 /**< poll when device signals ready */ - -/** set the internal queue depth to (arg) entries, must be at least 1 */ -#define ACCELIOCSQUEUEDEPTH _ACCELIOC(1) /** set the accel internal sample rate to at least (arg) Hz */ -#define ACCELIOCSSAMPLERATE _ACCELIOC(2) +#define ACCELIOCSSAMPLERATE _ACCELIOC(0) + +/** return the accel internal sample rate in Hz */ +#define ACCELIOCGSAMPLERATE _ACCELIOC(1) /** set the accel internal lowpass filter to no lower than (arg) Hz */ -#define ACCELIOCSLOWPASS _ACCELIOC(3) +#define ACCELIOCSLOWPASS _ACCELIOC(2) -/** set the report format to (arg); zero is the standard, 1-10 are reserved, all others are driver-specific. */ -#define ACCELIOCSREPORTFORMAT _ACCELIOC(4) +/** return the accel internal lowpass filter in Hz */ +#define ACCELIOCGLOWPASS _ACCELIOC(3) /** set the accel scaling constants to the structure pointed to by (arg) */ #define ACCELIOCSSCALE _ACCELIOC(5) +/** get the accel scaling constants into the structure pointed to by (arg) */ +#define ACCELIOCGSCALE _ACCELIOC(6) + /** set the accel measurement range to handle at least (arg) g */ -#define ACCELIORANGE _ACCELIOC(6) +#define ACCELIOCSRANGE _ACCELIOC(7) + +/** get the current accel measurement range */ +#define ACCELIOCGRANGE _ACCELIOC(8) #endif /* _DRV_ACCEL_H */ |