summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorRobin Howard <robin@rhoward.id.au>2024-04-19 16:00:57 +1000
committerRobin Howard <robin@rhoward.id.au>2024-04-19 16:03:53 +1000
commite39754ba105213c133407e2dacb5fd31f3873e4c (patch)
tree062378c965c00ff3fb49a584ed1c8a82ac27bcce /src/drivers
parent354ba0325a9df220f05486712662c20b2ca0e0d0 (diff)
downloadtangara-fw-e39754ba105213c133407e2dacb5fd31f3873e4c.tar.gz
Fix DRV2065L register usage: we were accidentally setting control2 when we meant control3.
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/haptics.cpp1
-rw-r--r--src/drivers/include/haptics.hpp26
2 files changed, 14 insertions, 13 deletions
diff --git a/src/drivers/haptics.cpp b/src/drivers/haptics.cpp
index 46136e62..ccc9e599 100644
--- a/src/drivers/haptics.cpp
+++ b/src/drivers/haptics.cpp
@@ -10,6 +10,7 @@
#include <cstdint>
#include <initializer_list>
#include <mutex>
+#include <variant>
#include "assert.h"
#include "driver/gpio.h"
diff --git a/src/drivers/include/haptics.hpp b/src/drivers/include/haptics.hpp
index 6cfcbb0d..cf970977 100644
--- a/src/drivers/include/haptics.hpp
+++ b/src/drivers/include/haptics.hpp
@@ -214,7 +214,7 @@ class Haptics {
};
struct ControlMask {
- // Control1
+ // FeedbackControl
static constexpr uint8_t kNErmLra = 0b10000000;
// Control3
static constexpr uint8_t kErmOpenLoop = 0b00100000;
@@ -257,12 +257,12 @@ class Haptics {
// A bunch of different options, not grouped
// in any particular sensible way
- kControl1 = 0x1A,
- kControl2 = 0x1B,
- kControl3 = 0x1C,
- kControl4 = 0x1D,
- kControl5 = 0x1E,
- kControl6 = 0x1F,
+ kFeedbackControl = 0x1A,
+ kControl1 = 0x1B,
+ kControl2 = 0x1C,
+ kControl3 = 0x1D,
+ kControl4 = 0x1E,
+ kControl5 = 0x1F,
kSupplyVoltageMonitor = 0x21, // "VBAT"
kLraResonancePeriod = 0x22,
@@ -295,12 +295,12 @@ class Haptics {
kOverdriveClampVoltage = 0x8C,
kAutoCalibrationCompensationResult = 0x0C,
kAutoCalibrationBackEmfResult = 0x6C,
- kControl1 = 0x36,
- kControl2 = 0x93,
- kControl3 = 0xF5,
- kControl4 = 0xA0,
- kControl5 = 0x20,
- kControl6 = 0x80,
+ kFeedbackControl = 0x36,
+ kControl1 = 0x93,
+ kControl2 = 0xF5,
+ kControl3 = 0xA0,
+ kControl4 = 0x20,
+ kControl5 = 0x80,
kSupplyVoltageMonitor = 0,
kLraResonancePeriod = 0,
};