summaryrefslogtreecommitdiff
path: root/gyroscope.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'gyroscope.hpp')
-rw-r--r--gyroscope.hpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/gyroscope.hpp b/gyroscope.hpp
index 627aa8c..b57eafa 100644
--- a/gyroscope.hpp
+++ b/gyroscope.hpp
@@ -17,21 +17,18 @@ namespace RegisterAddresses
const int OUT_X_L = 0x28;
}
-class ReadGyroscopeData
-{
-public:
- int16_t x, y, z;
-};
-
class Gyroscope
{
public:
- int gyroscope_id;
- Gyroscope(int gyroscope_id);
- ReadGyroscopeData read();
- void writeRegistry(uint8_t registry, uint8_t value);
+ void setup(int id);
+ void readCoordinates(int16_t *x, int16_t *y, int16_t *z);
+ void writeRegistry(int8_t registry, int8_t value);
static int initialize();
- static int testRegistry(int gyroscope_id, uint8_t registry);
+ static int testRegistry(int gyroscope_id, int8_t registry);
+
+private:
+ int _gyroscope_id;
+ int16_t _read_next_coordinate();
};
#endif \ No newline at end of file