summaryrefslogtreecommitdiff
path: root/src/drivers/Bma421.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/Bma421.h')
-rw-r--r--src/drivers/Bma421.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/drivers/Bma421.h b/src/drivers/Bma421.h
index ac5c707..fef4dc0 100644
--- a/src/drivers/Bma421.h
+++ b/src/drivers/Bma421.h
@@ -1,7 +1,11 @@
#pragma once
#include <drivers/Bma421_C/bma4_defs.h>
+#include <drivers/Bma421_C/bma423.h>
namespace Pinetime {
+ namespace System {
+ class SystemTask;
+ }
namespace Drivers {
class TwiMaster;
class Bma421 {
@@ -32,6 +36,16 @@ namespace Pinetime {
bool IsOk() const;
DeviceTypes DeviceType() const;
+ protected:
+ friend class Pinetime::System::SystemTask;
+
+ template <typename X, typename Y, typename Z> inline void ObtainAccel(X& x, Y& y, Z& z) {
+ struct bma4_accel data;
+ bma4_read_accel_xyz(&data, &bma);
+ // Modelled after Process(), x/y swapped
+ x = data.y; y = data.x; z = data.z;
+ }
+
private:
void Reset();