.

Dependents:   FXOS8700Q

Committer:
b50559
Date:
Thu Aug 13 22:10:38 2015 +0000
Revision:
0:c239681dfe64
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
b50559 0:c239681dfe64 1
b50559 0:c239681dfe64 2 #ifndef MOTIONSENSOR_H
b50559 0:c239681dfe64 3 #define MOTIONSENSOR_H
b50559 0:c239681dfe64 4
b50559 0:c239681dfe64 5 #include <stdint.h>
b50559 0:c239681dfe64 6
b50559 0:c239681dfe64 7 typedef struct MotionSensorDataCounts
b50559 0:c239681dfe64 8 {
b50559 0:c239681dfe64 9 int16_t x, y, z;
b50559 0:c239681dfe64 10 } MotionSensorDataCounts;
b50559 0:c239681dfe64 11
b50559 0:c239681dfe64 12 typedef struct MotionSensorDataUnits
b50559 0:c239681dfe64 13 {
b50559 0:c239681dfe64 14 float x, y, z;
b50559 0:c239681dfe64 15 } MotionSensorDataUnits;
b50559 0:c239681dfe64 16
b50559 0:c239681dfe64 17 class MotionSensor
b50559 0:c239681dfe64 18 {
b50559 0:c239681dfe64 19 public:
b50559 0:c239681dfe64 20 //virtual MotionSensor();
b50559 0:c239681dfe64 21 virtual void enable(void) = 0;
b50559 0:c239681dfe64 22 virtual void disable(void) = 0;
b50559 0:c239681dfe64 23 virtual uint32_t sampleRate(uint32_t frequency) = 0;
b50559 0:c239681dfe64 24 virtual uint32_t whoAmI(void) = 0;
b50559 0:c239681dfe64 25 virtual uint32_t dataReady(void) = 0;
b50559 0:c239681dfe64 26 virtual void getX(int16_t * x) = 0;
b50559 0:c239681dfe64 27 virtual void getY(int16_t * y) = 0;
b50559 0:c239681dfe64 28 virtual void getZ(int16_t * z) = 0;
b50559 0:c239681dfe64 29 virtual void getX(float * x) = 0;
b50559 0:c239681dfe64 30 virtual void getY(float * y) = 0;
b50559 0:c239681dfe64 31 virtual void getZ(float * z) = 0;
b50559 0:c239681dfe64 32 virtual void getAxis(MotionSensorDataCounts &data) = 0;
b50559 0:c239681dfe64 33 virtual void getAxis(MotionSensorDataUnits &data) = 0;
b50559 0:c239681dfe64 34 };
b50559 0:c239681dfe64 35
b50559 0:c239681dfe64 36 #endif
b50559 0:c239681dfe64 37