Skip to content

Commit 0ac5aad

Browse files
committed
Implement signal process register
Mostly useful for creating new lookup table. In that use case, want to ignore current LUT, accelerometer data, and not rotate by heading
1 parent f973afd commit 0ac5aad

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/sfeQwiicOtos.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,18 @@ sfeTkError_t sfeQwiicOtos::resetTracking()
237237
return _commBus->writeRegisterByte(kOtosRegReset, 0x01);
238238
}
239239

240+
sfeTkError_t sfeQwiicOtos::getSignalProcess(sfe_otos_config_signal_process_t &config)
241+
{
242+
// Read the signal process register
243+
return _commBus->readRegisterByte(kOtosRegSignalProcess, config.value);
244+
}
245+
246+
sfeTkError_t sfeQwiicOtos::setSignalProcess(sfe_otos_config_signal_process_t &config)
247+
{
248+
// Write the signal process register
249+
return _commBus->writeRegisterByte(kOtosRegSignalProcess, config.value);
250+
}
251+
240252
sfeTkError_t sfeQwiicOtos::getOffset(otos_pose2d_t &pose)
241253
{
242254
return readPoseRegs(kOtosRegOffXL, pose, kInt16ToMeter, kInt16ToRad);

src/sfeQwiicOtos.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ const uint8_t kOtosRegScalarXY = 0x04;
2121
const uint8_t kOtosRegScalarH = 0x05;
2222
const uint8_t kOtosRegImuCalib = 0x06;
2323
const uint8_t kOtosRegReset = 0x07;
24+
25+
const uint8_t kOtosRegSignalProcess = 0x0E;
2426
const uint8_t kOtosRegSelfTest = 0x0F;
2527

2628
const uint8_t kOtosRegOffXL = 0x10;
@@ -132,6 +134,18 @@ typedef union {
132134
uint8_t value;
133135
} otos_version_t;
134136

137+
// Signal process register bit fields
138+
typedef union {
139+
struct
140+
{
141+
uint8_t enLut : 1;
142+
uint8_t enAcc : 1;
143+
uint8_t enRot : 1;
144+
uint8_t reserved : 5;
145+
};
146+
uint8_t value;
147+
} sfe_otos_config_signal_process_t;
148+
135149
// Self test register bit fields
136150
typedef union {
137151
struct
@@ -184,6 +198,10 @@ class sfeQwiicOtos
184198

185199
sfeTkError_t resetTracking();
186200

201+
sfeTkError_t getSignalProcess(sfe_otos_config_signal_process_t &config);
202+
203+
sfeTkError_t setSignalProcess(sfe_otos_config_signal_process_t &config);
204+
187205
sfeTkError_t getOffset(otos_pose2d_t &pose);
188206

189207
sfeTkError_t setOffset(otos_pose2d_t &pose);

0 commit comments

Comments
 (0)