skm project

Fork of MotionSensor by Components

Revision:
0:dbc8909af0eb
Child:
1:821b100de6e1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MotionSensor.h	Wed Apr 23 16:23:55 2014 +0000
@@ -0,0 +1,36 @@
+
+#ifndef MOTIONSENSOR_H
+#define MOTIONSENSOR_H
+
+#include <stdint.h>
+
+typedef struct MotionSensorDataCounts
+{
+    int16_t x, y, z;
+} MotionSensorDataCounts;
+
+typedef struct MotionSensorDataUnits
+{
+    float x, y, z;
+} MotionSensorDataUnits;
+ 
+class MotionSensor
+{
+public:
+    virtual MotionSesnor();
+    virtual void enable(void) = 0;
+    virtual void disable(void) = 0;
+    virtual uint32_t sampleRate(uint32_t frequency) = 0;
+    virtual uint32_t whoAmI(void) = 0;
+    virtual int32_t dataReady(void) = 0;
+    virtual uint16_t getX(void) = 0;
+    virtual uint16_t getY(void) = 0;
+    virtual uint16_t getZ(void) = 0;
+    virtual float getX(void) = 0;
+    virtual float getY(void) = 0;
+    virtual float getZ(void) = 0;
+    virtual void getAxis(MotionSensorDataCounts data) = 0;
+    virtual void getAxis(MotionSensorDataUnits data) = 0;
+};
+
+#endif