skm project

Fork of MotionSensor by Components

Committer:
sam_grove
Date:
Wed Apr 23 16:23:55 2014 +0000
Revision:
0:dbc8909af0eb
Child:
1:821b100de6e1
Initial commit

Who changed what in which revision?

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