Virtual base class for sensors that measure motion
Dependents: FXOS8700Q MAG3110 MMA8451Q MAG3110 ... more
Revision 5:226520fc09bf, committed 2015-06-18
- Comitter:
- sam_grove
- Date:
- Thu Jun 18 22:52:47 2015 +0000
- Parent:
- 4:67e4fd9f47c5
- Commit message:
- update comments and documentation
Changed in this revision
MotionSensor.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 67e4fd9f47c5 -r 226520fc09bf MotionSensor.h --- a/MotionSensor.h Thu Jun 18 16:23:26 2015 +0000 +++ b/MotionSensor.h Thu Jun 18 22:52:47 2015 +0000 @@ -35,6 +35,7 @@ float z; /*!< z-axis counts */ } motion_data_units_t; + /** Motion Sensor Base Class Useful for accessing data in a common way */ @@ -45,67 +46,67 @@ /** Enable the sensor for operation */ virtual void enable(void) const = 0; - + /** disable the sensors operation */ virtual void disable(void) const = 0; - + /** Set the sensor sample rate @param frequency The desires sample frequency @return The amount of error in Hz between desired and actual frequency */ virtual uint32_t sampleRate(uint32_t frequency) const = 0; - + /** Tells of new data is ready @return The amount of data samples ready to be read from a device */ virtual uint32_t dataReady(void) const = 0; - + /** Get the x data in counts @param x A referene to the variable to put the data in, 0 denotes not used @return The x data in counts */ - virtual int16_t getX(const int16_t &x = 0) const = 0; - + virtual int16_t getX(int16_t &x) const = 0; + /** Get the y data in counts @param y A referene to the variable to put the data in, 0 denotes not used @return The y data in counts */ - virtual void getY(const int16_t &y = 0) const = 0; - + virtual int16_t getY(int16_t &y) const = 0; + /** Get the z data in counts @param z A referene to the variable to put the data in, 0 denotes not used @return The z data in counts */ - virtual void getZ(const int16_t &z) const = 0; - + virtual int16_t getZ(int16_t &z) const = 0; + /** Get the x data in units @param x A referene to the variable to put the data in, 0 denotes not used @return The x data in units */ - virtual void getX(const float &x) const = 0; - + virtual float getX(float &x) const = 0; + /** Get the y data in units @param y A referene to the variable to put the data in, 0 denotes not used @return The y data in units */ - virtual void getY(const float &y) const = 0; - + virtual float getY(float &y) const = 0; + /** Get the z data in units @param z A referene to the variable to put the data in, 0 denotes not used @return The z data in units */ - virtual void getZ(const float &z) const = 0; - + virtual float getZ(float &z) const = 0; + /** Get the x,y,z data in counts @param xyz A referene to the variable to put the data in, 0 denotes not used */ - virtual void getAxis(const motion_data_counts_t &xyz) const = 0; - + virtual void getAxis(motion_data_counts_t &xyz) const = 0; + /** Get the x,y,z data in units @param xyz A referene to the variable to put the data in, 0 denotes not used */ - virtual void getAxis(const motion_data_units_t &xyz) const = 0; + virtual void getAxis(motion_data_units_t &xyz) const = 0; }; -#endif +#endif