summaryrefslogtreecommitdiff
path: root/gyroscope.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-11-23 13:58:00 +0100
committerHampusM <hampus@hampusmat.com>2021-11-23 13:58:00 +0100
commit4fdb27130e3c53c9a55cc73b8975aae733a03e90 (patch)
treee1aa9aa6dc75d7cbbb91f969faaa0d8baa0d334c /gyroscope.hpp
parentc4d200330b71276abee2d2c18906991e0f4e5c13 (diff)
feat: make basic stuff work
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