skm project

Fork of MotionSensor by Components

Committer:
JimCarver
Date:
Wed Apr 23 22:00:18 2014 +0000
Revision:
2:efad17aa7c8e
Parent:
1:821b100de6e1
Child:
3:4d6e28d4a18a
Preliminary Version

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:
JimCarver 2:efad17aa7c8e 20 //virtual MotionSensor();
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;
JimCarver 2:efad17aa7c8e 25 virtual uint32_t dataReady(void) = 0;
JimCarver 2:efad17aa7c8e 26 virtual void getX(int16_t * x) = 0;
JimCarver 2:efad17aa7c8e 27 virtual void getY(int16_t * y) = 0;
JimCarver 2:efad17aa7c8e 28 virtual void getZ(int16_t * z) = 0;
JimCarver 2:efad17aa7c8e 29 virtual void getX(float * x) = 0;
JimCarver 2:efad17aa7c8e 30 virtual void getY(float * y) = 0;
JimCarver 2:efad17aa7c8e 31 virtual void getZ(float * z) = 0;
JimCarver 1:821b100de6e1 32 virtual void getAxis(MotionSensorDataCounts * data) = 0;
JimCarver 1:821b100de6e1 33 virtual void getAxis(MotionSensorDataUnits * data) = 0;
sam_grove 0:dbc8909af0eb 34 };
sam_grove 0:dbc8909af0eb 35
sam_grove 0:dbc8909af0eb 36 #endif