SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
sensor/imu/qmi8658/SensorQMI8658.hpp
Go to the documentation of this file.
1
30#pragma once
31
32#include "../../../SensorBuildOpt.h"
33#if !SENSORLIB_EXCLUDE_QMI8658
34
35#include <functional>
36#include "../../ImuBase.hpp"
37#include "../../../platform/comm/ComplexDeviceWithHal.hpp"
38
39static constexpr uint8_t QMI8658_L_SLAVE_ADDRESS = 0x6B;
40static constexpr uint8_t QMI8658_H_SLAVE_ADDRESS = 0x6A;
41
46{
47public:
48
52 enum class AccelRange : uint8_t {
53 FS_2G,
54 FS_4G,
55 FS_8G,
56 FS_16G,
57 };
58
62 enum class AccelODR : uint8_t {
63 ODR_7Hz,
64 ODR_14Hz,
65 ODR_28Hz,
66 ODR_56Hz,
67 ODR_112Hz,
68 ODR_224Hz,
69 ODR_448Hz,
70 ODR_896Hz,
78 };
79
83 enum class GyroRange : uint8_t {
84 FS_16DPS,
85 FS_32DPS,
86 FS_64DPS,
87 FS_128DPS,
88 FS_256DPS,
89 FS_512DPS,
92 };
93
97 enum class GyroODR : uint8_t {
98 ODR_7Hz,
99 ODR_14Hz,
100 ODR_28Hz,
101 ODR_56Hz,
102 ODR_112Hz,
103 ODR_224Hz,
104 ODR_448Hz,
105 ODR_896Hz,
106 ODR_1792Hz,
107 ODR_3584Hz,
108 ODR_7168Hz,
109 };
110
114 enum class LpfMode : uint8_t {
115 MODE_0,
116 MODE_1,
117 MODE_2,
118 MODE_3,
119 OFF = 0xFF,
120 };
121
125 enum class FifoMode : uint8_t {
126 BYPASS,
127 FIFO,
128 STREAM,
129 };
130
134 enum class FifoSamples : uint8_t {
135 SAMPLES_16,
136 SAMPLES_32,
137 SAMPLES_64,
139 };
140
143
147 enum class TapPriority : uint8_t {
154 };
155
159 enum class MotionType : uint8_t {
160 ANY_MOTION = 0,
161 NO_MOTION = 1,
162 SIGNIFICANT = 2,
163 };
164
175 enum class Layout : uint8_t {
176 LAYOUT_DEFAULT = 0,
177 LAYOUT_ROTATE_90 = 1,
180 LAYOUT_FLIP_Z = 4,
181 LAYOUT_FLIP_Z_90 = 5,
184 };
185
189 using MotionCallback = std::function<void()>;
190
194 using TapCallback = std::function<void(TapEvent event)>;
195
199 using DataReadyCallback = std::function<void()>;
200
215
216 // ==================== Constructor / Destructor ====================
217
222
226 ~SensorQMI8658() override;
227
228 // ==================== ImuBase Interface Implementation ====================
229
234 bool reset() override;
235
240 bool selfTest() override;
241
246 bool isPresent() override;
247
252 uint8_t getChipID() override;
253
258 uint32_t getFirmwareVersion() override;
259
265 bool setOperationMode(OperationMode mode) override;
266
271 float getTemperature() override;
272
277 uint32_t getTimestamp() override;
278
284 bool isDataReady(uint8_t mask = static_cast<uint8_t>(ImuBase::DataReadyMask::BOTH)) override;
285
291 bool readAccel(AccelerometerData &out) override;
292
297 bool enableAccel() override;
298
303 bool disableAccel() override;
304
309 bool isAccelEnabled() override;
310
316 bool setAccelFullScaleRange(AccelFullScaleRange range) override;
317
323 bool setAccelOutputDataRate(float data_rate_hz) override;
324
332 bool readAccelRaw(int16_t &x, int16_t &y, int16_t &z) override;
333
339 bool readGyro(GyroscopeData &out) override;
340
345 bool enableGyro() override;
346
351 bool disableGyro() override;
352
357 bool isGyroEnabled() override;
358
364 bool setGyroFullScaleRange(GyroFullScaleRange range) override;
365
371 bool setGyroOutputDataRate(float data_rate_hz) override;
372
380 bool readGyroRaw(int16_t &x, int16_t &y, int16_t &z) override;
381
386 bool enableSyncMode() override;
387
392 bool disableSyncMode() override;
393
400 bool configureFifo(bool enable, uint8_t watermark_samples = 16) override;
401
410 uint16_t readFromFifo(AccelerometerData *accel_data, uint16_t accel_count,
411 GyroscopeData *gyro_data, uint16_t gyro_count) override;
412
413 // ==================== Accelerometer Configuration ====================
414
424 bool configAccel(AccelFullScaleRange range, float data_rate_hz, LpfMode lpf = LpfMode::MODE_0);
425
426 // ==================== Gyroscope Configuration ====================
427
437 bool configGyro(GyroFullScaleRange range, float data_rate_hz, LpfMode lpf = LpfMode::MODE_0);
438
439 // ==================== Interrupt Configuration ====================
440
446 bool enableInterrupt(IntPin pin);
447
453 bool disableInterrupt(IntPin pin);
454
462 bool enableDataReadyInterrupt(IntPin pin = IntPin::PIN2);
463
468 uint8_t getInterruptStatus();
469
474 void setPins(int pin);
475
480 void setIntPin(int pin);
481
482 // ==================== FIFO Operations ====================
483
493 uint8_t watermark_samples = 16);
494
499 bool resetFifo();
500
505 uint8_t getFifoStatus();
506
507 // ==================== Synchronization ====================
508
514
520
521 // ==================== Calibration ====================
522
530 bool calibrate(uint16_t *gyro_x_gain = nullptr, uint16_t *gyro_y_gain = nullptr,
531 uint16_t *gyro_z_gain = nullptr);
532
540 bool writeCalibration(uint16_t gyro_x_gain, uint16_t gyro_y_gain, uint16_t gyro_z_gain);
541
548 void setAccelOffset(int16_t x, int16_t y, int16_t z);
549
556 void setGyroOffset(int16_t x, int16_t y, int16_t z);
557
558 // ==================== Self-Test ====================
559
564 bool selfTestAccel();
565
570 bool selfTestGyro();
571
572 // ==================== Motion Detection ====================
573
583 bool configMotionDetect(MotionType type, float threshold_x, float threshold_y,
584 float threshold_z, uint8_t duration);
585
596
602 bool enableMotionDetect(IntPin pin = IntPin::PIN1);
603
608 bool disableMotionDetect();
609
617 bool configWakeOnMotion(uint8_t threshold = 200, float odr_hz = 128.0f,
618 IntPin pin = IntPin::PIN2);
619
630 bool configWakeOnMotionAdvanced(uint8_t threshold, float odr_hz, IntPin pin,
631 uint8_t default_pin_value, uint8_t blanking_time,
632 AccelFullScaleRange acc_range);
633
634 // ==================== Legacy Compatibility API ====================
635 // Keep old API signatures here only, so they can be removed together later.
636 bool configAccel(AccelRange range, AccelODR odr, LpfMode lpf = LpfMode::MODE_0);
637 bool configAccel(AccelRange range, float data_rate_hz, LpfMode lpf = LpfMode::MODE_0);
638 bool configGyro(GyroRange range, GyroODR odr, LpfMode lpf = LpfMode::MODE_0);
639 bool configGyro(GyroRange range, float data_rate_hz, LpfMode lpf = LpfMode::MODE_0);
640 bool configWakeOnMotion(uint8_t threshold, AccelODR odr, IntPin pin);
641 bool configWakeOnMotion(uint8_t threshold, AccelODR odr, IntPin pin,
642 uint8_t default_pin_value, uint8_t blanking_time,
643 AccelRange acc_range);
644
645 // ==================== Tap Detection ====================
646
657 bool configTap(TapPriority priority, uint8_t peak_window, uint16_t tap_window,
658 uint16_t double_tap_window, float peak_mag_threshold, float quiet_threshold);
659
667
673 bool enableTap(IntPin pin = IntPin::PIN1);
674
679 bool disableTap();
680
686
687 // ==================== Pedometer ====================
688
701 bool configPedometer(uint16_t sample_count, uint16_t peak_to_peak, uint16_t peak_threshold,
702 uint16_t time_up, uint8_t time_low = 20, uint8_t entry_count = 10,
703 uint8_t fix_precision = 0, uint8_t sig_count = 4);
704
711 bool configPedometerDefault(float odr = 125.0f);
712
718 bool enablePedometer(IntPin pin = IntPin::DISABLE);
719
724 bool disablePedometer();
725
730 uint32_t getStepCount();
731
736 bool resetStepCount();
737
738 // ==================== Callbacks ====================
739
745
750 void setNoMotionCallback(MotionCallback callback);
751
757
763
768 void setTapCallback(TapCallback callback);
769
775
781
787
793
797 void setCallbacks(const EventCallbacks &cbs);
798
803
807 const EventCallbacks &getCallbacks() const;
808
809 // ==================== Utility ====================
810
815 uint16_t update();
816
820 void dumpRegisters();
821
827 void getChipUsid(uint8_t *buffer, uint8_t length);
828
833 float getAccelScale();
834
839 float getGyroScale();
840
841 // ==================== Axis Conversion ====================
842
847 void setAxisLayout(Layout layout);
848
853 Layout getAxisLayout() const;
854
860 void axisConvert(int16_t accel_data[3], int16_t gyro_data[3]);
861
862 // ==================== Static Calibration ====================
863
871 void enableStaticCalibration(bool enable);
872
877 bool isStaticCalibrationEnabled() const;
878
883 bool isStaticCalibrationComplete() const;
884
891 bool processStaticCalibration(int16_t accel_data[3], int16_t gyro_data[3]);
892
898 void getStaticCalibrationOffsets(int16_t accel_offset[3], int16_t gyro_offset[3]);
899
904
905 // ==================== Dynamic Gyroscope Calibration ====================
906
914 void enableDynamicGyroCalibration(bool enable);
915
921
926 void getDynamicGyroCalibrationOffsets(int16_t gyro_offset[3]);
927
933 void processDynamicCalibration(int16_t accel_data[3], int16_t gyro_data[3]);
934
935 // ==================== Hardware Self-Test ====================
936
943 bool hardwareSelfTest(bool includeAccel = true, bool includeGyro = true);
944
950 void getHardwareSelfTestResults(float accel_result[3], float gyro_result[3]);
951
952protected:
953 bool initImpl(uint8_t param) override;
954 int writeCommand(uint8_t cmd, uint32_t timeout_ms = 1000);
955 uint8_t mgToBytes(float mg);
956
961 bool applyMotionConfig();
962
963 float odrToFloat(float odr);
964 uint8_t findClosestAccelOdr(float hz);
965 uint8_t findClosestGyroOdr(float hz);
966 uint8_t findClosestAccelLpOdr(float hz);
967
968 static constexpr uint8_t STATUS_TAP_EVENT = sensorlib::_bv(1);
969 static constexpr uint8_t STATUS_WOM_EVENT = sensorlib::_bv(2);
970 static constexpr uint8_t STATUS_PEDOMETER_EVENT = sensorlib::_bv(4);
971 static constexpr uint8_t STATUS_ANY_MOTION_EVENT = sensorlib::_bv(5);
972 static constexpr uint8_t STATUS_NO_MOTION_EVENT = sensorlib::_bv(6);
973 static constexpr uint8_t STATUS_SIGNIFICANT_MOTION = sensorlib::_bv(7);
974
981
985 uint8_t _motion_any_thr[3];
986 uint8_t _motion_no_thr[3];
991
996 uint8_t _fifo_mode;
998
1006
1008
1010 uint8_t _usid[6];
1011
1013
1016
1018
1019 static constexpr uint16_t MAX_STATIC_CALI_SAMPLES = 100;
1024 int32_t _gyro_cali_sum[3];
1027
1028 static constexpr uint8_t DYN_CAL_BUFFER_SIZE = 10;
1029 static constexpr uint8_t DYN_CAL_STATIC_COUNT = 12;
1037 int32_t _dyn_gyro_sum[3];
1041
1042 static constexpr float HW_ST_ACCEL_THRESHOLD_MG = 200.0f;
1043 static constexpr float HW_ST_GYRO_THRESHOLD_DPS = 300.0f;
1046};
1047
1048#endif
OperationMode
Enumeration of sensor operation modes.
GyroFullScaleRange
Enumeration of gyroscope full-scale range settings.
AccelFullScaleRange
Enumeration of accelerometer full-scale range settings.
InterruptPinMap
Enumeration of interrupt pin mapping options.
Abstract IMU device interface for polymorphic IMU sensor implementations.
Definition ImuBase.hpp:43
QMI8658 IMU sensor driver class.
bool configGyro(GyroFullScaleRange range, float data_rate_hz, LpfMode lpf=LpfMode::MODE_0)
Configure the gyroscope with specified parameters.
GyroODR
Gyroscope output data rate enumeration.
static constexpr uint8_t DYN_CAL_BUFFER_SIZE
bool reset() override
Reset the IMU sensor to its default state.
bool resetFifo()
Reset the FIFO.
static constexpr uint8_t STATUS_TAP_EVENT
bool configPedometer(uint16_t sample_count, uint16_t peak_to_peak, uint16_t peak_threshold, uint16_t time_up, uint8_t time_low=20, uint8_t entry_count=10, uint8_t fix_precision=0, uint8_t sig_count=4)
Configure pedometer parameters.
float _accel_speed_buffer[DYN_CAL_BUFFER_SIZE]
bool readGyro(GyroscopeData &out) override
Read gyroscope data.
void setAccelOffset(int16_t x, int16_t y, int16_t z)
Set accelerometer host delta offsets.
bool setOperationMode(OperationMode mode) override
Set IMU operation mode.
bool disableTap()
Disable tap detection.
bool readGyroRaw(int16_t &x, int16_t &y, int16_t &z) override
Read raw gyroscope data without scaling.
float getTemperature() override
Get the temperature reading from the sensor.
uint8_t getInterruptStatus()
Get interrupt status.
static constexpr uint8_t STATUS_WOM_EVENT
float getGyroScaleFromRange(GyroFullScaleRange range)
void getStaticCalibrationOffsets(int16_t accel_offset[3], int16_t gyro_offset[3])
Get static calibration offsets.
void setSignificantMotionCallback(MotionCallback callback)
Set callback for significant motion event.
bool isGyroEnabled() override
Check if gyroscope is enabled.
bool isDataReady(uint8_t mask=static_cast< uint8_t >(ImuBase::DataReadyMask::BOTH)) override
Check if requested IMU data is available.
uint8_t findClosestAccelLpOdr(float hz)
bool configMotionDetectDefault(MotionType type)
Configure motion detection with default parameters.
static constexpr uint16_t MAX_STATIC_CALI_SAMPLES
uint32_t getStepCount()
Get pedometer step count.
bool disableMotionDetect()
Disable motion detection.
int writeCommand(uint8_t cmd, uint32_t timeout_ms=1000)
bool setAccelOutputDataRate(float data_rate_hz) override
Set accelerometer output data rate.
void setDataLockingCallback(DataReadyCallback callback)
Set callback for data locking.
std::function< void(TapEvent event)> TapCallback
Callback function type for tap events.
uint8_t getAccelRangeRegValue(AccelFullScaleRange range)
bool enableAccel() override
Enable the accelerometer.
static constexpr uint8_t STATUS_SIGNIFICANT_MOTION
static constexpr float HW_ST_ACCEL_THRESHOLD_MG
bool configFifo(FifoMode mode, FifoSamples samples=FifoSamples::SAMPLES_16, uint8_t watermark_samples=16)
Configure FIFO with specified mode.
bool isStaticCalibrationComplete() const
Get the current static calibration status.
bool processStaticCalibration(int16_t accel_data[3], int16_t gyro_data[3])
Process static calibration with current sensor data.
float getAccelScale()
Get the accelerometer scale factor.
void resetStaticCalibration()
Reset static calibration.
uint8_t getChipID() override
Get the chip ID / WHO_AM_I value.
bool disableSyncMode() override
Disable synchronous sampling mode.
bool enableSyncMode() override
Enable synchronous sampling mode.
void setIntPin(int pin)
Backward-compatible alias of setPins.
float odrToFloat(float odr)
AccelODR
Accelerometer output data rate enumeration.
@ ODR_LP_21Hz
Low power 21 Hz.
@ ODR_LP_11Hz
Low power 11 Hz.
@ ODR_LP_128Hz
Low power 128 Hz.
@ ODR_LP_3Hz
Low power 3 Hz.
bool disableLockingMechanism()
Disable the data locking mechanism.
bool disableAccel() override
Disable the accelerometer.
bool selfTestGyro()
Perform gyroscope self-test.
void processDynamicCalibration(int16_t accel_data[3], int16_t gyro_data[3])
Process dynamic calibration with current sensor data.
bool enableInterrupt(IntPin pin)
Enable interrupt on specified pin.
void enableStaticCalibration(bool enable)
Start static calibration.
bool readAccel(AccelerometerData &out) override
Read accelerometer data.
void getDynamicGyroCalibrationOffsets(int16_t gyro_offset[3])
Get dynamic gyroscope calibration offsets.
uint8_t findClosestAccelOdr(float hz)
bool enablePedometer(IntPin pin=IntPin::DISABLE)
Enable pedometer.
@ STREAM
Stream mode (overwrites oldest)
@ BYPASS
Bypass mode (FIFO disabled)
@ FIFO
FIFO mode (stops when full)
void setTapCallback(TapCallback callback)
Set callback for tap event.
bool enableGyro() override
Enable the gyroscope.
bool configTap(TapPriority priority, uint8_t peak_window, uint16_t tap_window, uint16_t double_tap_window, float peak_mag_threshold, float quiet_threshold)
Configure tap detection parameters.
bool disableGyro() override
Disable the gyroscope.
~SensorQMI8658() override
Destroy the SensorQMI8658 object.
uint16_t readFromFifo(AccelerometerData *accel_data, uint16_t accel_count, GyroscopeData *gyro_data, uint16_t gyro_count) override
Read data from FIFO buffer.
bool enableDataReadyInterrupt(IntPin pin=IntPin::PIN2)
Enable data ready interrupt.
bool enableLockingMechanism()
Enable the data locking mechanism.
uint32_t getFirmwareVersion() override
Get the firmware version.
void setNoMotionCallback(MotionCallback callback)
Set callback for no-motion event.
static constexpr float HW_ST_GYRO_THRESHOLD_DPS
TapEvent getTapStatus()
Get tap status.
static constexpr uint8_t STATUS_ANY_MOTION_EVENT
bool isPresent() override
Check if the IMU sensor is responding.
uint8_t getGyroRangeRegValue(GyroFullScaleRange range)
GyroRange
Gyroscope full-scale range enumeration.
@ FS_128DPS
±128 degrees per second
@ FS_512DPS
±512 degrees per second
@ FS_32DPS
±32 degrees per second
@ FS_2048DPS
±2048 degrees per second
@ FS_1024DPS
±1024 degrees per second
@ FS_256DPS
±256 degrees per second
@ FS_64DPS
±64 degrees per second
@ FS_16DPS
±16 degrees per second
bool isAccelEnabled() override
Check if accelerometer is enabled.
bool configureFifo(bool enable, uint8_t watermark_samples=16) override
Configure the FIFO buffer.
EventCallbacks & getCallbacks()
Get current callbacks.
void enableDynamicGyroCalibration(bool enable)
Enable dynamic gyroscope calibration.
Layout getAxisLayout() const
Get the current axis layout setting.
float _gyro_speed_buffer[DYN_CAL_BUFFER_SIZE]
SensorQMI8658()
Construct a new SensorQMI8658 object.
bool enableTap(IntPin pin=IntPin::PIN1)
Enable tap detection.
void setGyroOffset(int16_t x, int16_t y, int16_t z)
Set gyroscope host delta offsets.
float getAccelScaleFromRange(AccelFullScaleRange range)
LpfMode
Low-pass filter mode enumeration.
@ MODE_0
2.66% of output data rate
@ OFF
Disable low-pass filter.
@ MODE_3
13.37% of output data rate
@ MODE_2
5.39% of output data rate
@ MODE_1
3.63% of output data rate
AccelRange
Accelerometer full-scale range enumeration.
bool enableMotionDetect(IntPin pin=IntPin::PIN1)
Enable motion detection on specified pin.
uint8_t findClosestGyroOdr(float hz)
bool initImpl(uint8_t param) override
bool isDynamicGyroCalibrationEnabled() const
Check if dynamic gyro calibration is enabled.
bool setGyroFullScaleRange(GyroFullScaleRange range) override
Set gyroscope full scale range.
MotionType
Motion detection type enumeration.
@ ANY_MOTION
Any motion detection.
@ NO_MOTION
No motion detection.
@ SIGNIFICANT
Significant motion detection.
bool setGyroOutputDataRate(float data_rate_hz) override
Set gyroscope output data rate.
void setAccelDataReadyCallback(DataReadyCallback callback)
Set callback for accelerometer data ready.
void setPedometerCallback(MotionCallback callback)
Set callback for pedometer event.
std::function< void()> DataReadyCallback
Callback function type for data ready events.
bool selfTest() override
Perform self-test on the IMU sensor.
void setAnyMotionCallback(MotionCallback callback)
Set callback for any-motion event.
void dumpRegisters()
Dump control registers for debugging.
bool resetStepCount()
Reset pedometer counter.
bool configAccel(AccelFullScaleRange range, float data_rate_hz, LpfMode lpf=LpfMode::MODE_0)
Configure the accelerometer with specified parameters.
uint16_t update()
Update sensor status and process events.
float getGyroScale()
Get the gyroscope scale factor.
void getHardwareSelfTestResults(float accel_result[3], float gyro_result[3])
Get hardware self-test results.
static constexpr uint8_t STATUS_PEDOMETER_EVENT
bool configTapDefault(TapPriority priority=TapPriority::X_GT_Y_GT_Z)
Configure tap detection with default parameters.
bool readAccelRaw(int16_t &x, int16_t &y, int16_t &z) override
Read raw accelerometer data without scaling.
uint8_t getFifoStatus()
Get FIFO status.
uint32_t getTimestamp() override
Get the timestamp from the sensor.
std::function< void()> MotionCallback
Callback function type for motion events.
bool setAccelFullScaleRange(AccelFullScaleRange range) override
Set accelerometer full scale range.
void setCallbacks(const EventCallbacks &cbs)
Set all event callbacks at once.
void setPins(int pin)
Set interrupt pin.
bool configWakeOnMotion(uint8_t threshold=200, float odr_hz=128.0f, IntPin pin=IntPin::PIN2)
Configure wake-on-motion (WoM) feature.
bool configPedometerDefault(float odr=125.0f)
Configure pedometer with default parameters.
bool disablePedometer()
Disable pedometer.
void setGyroDataReadyCallback(DataReadyCallback callback)
Set callback for gyroscope data ready.
bool hardwareSelfTest(bool includeAccel=true, bool includeGyro=true)
Perform hardware self-test on both sensors.
TapPriority
Tap detection axis priority enumeration.
void setAxisLayout(Layout layout)
Set the sensor axis layout for coordinate transformation.
bool configWakeOnMotionAdvanced(uint8_t threshold, float odr_hz, IntPin pin, uint8_t default_pin_value, uint8_t blanking_time, AccelFullScaleRange acc_range)
Configure wake-on-motion (WoM) with full vendor parameters.
bool isStaticCalibrationEnabled() const
Check if static calibration is enabled.
void setWakeOnMotionCallback(MotionCallback callback)
Set callback for wake-on-motion event.
void axisConvert(int16_t accel_data[3], int16_t gyro_data[3])
Apply axis conversion to raw sensor data.
bool selfTestAccel()
Perform accelerometer self-test.
static constexpr uint8_t STATUS_NO_MOTION_EVENT
static constexpr uint8_t DYN_CAL_STATIC_COUNT
bool writeCalibration(uint16_t gyro_x_gain, uint16_t gyro_y_gain, uint16_t gyro_z_gain)
Write previously saved gyro calibration gains.
void getChipUsid(uint8_t *buffer, uint8_t length)
Get sensor USID (unique chip ID).
Layout
Sensor axis layout enumeration for coordinate transformation.
@ LAYOUT_ROTATE_90
Rotated 90 degrees: X=forward, Y=left, Z=up.
@ LAYOUT_FLIP_Z
Flipped: X=right, Y=backward, Z=down.
@ LAYOUT_FLIP_Z_90
Flipped + 90: X=backward, Y=left, Z=down.
@ LAYOUT_FLIP_Z_180
Flipped + 180: X=left, Y=forward, Z=down.
@ LAYOUT_ROTATE_270
Rotated 270 degrees: X=backward, Y=right, Z=up.
@ LAYOUT_ROTATE_180
Rotated 180 degrees: X=left, Y=backward, Z=up.
@ LAYOUT_DEFAULT
Default orientation: X=right, Y=forward, Z=up.
@ LAYOUT_FLIP_Z_270
Flipped + 270: X=forward, Y=right, Z=down.
FifoSamples
FIFO sample count enumeration.
bool configMotionDetect(MotionType type, float threshold_x, float threshold_y, float threshold_z, uint8_t duration)
Configure motion detection parameters.
bool disableInterrupt(IntPin pin)
Disable interrupt on specified pin.
uint8_t mgToBytes(float mg)
void calibrate()
constexpr uint32_t _bv(uint8_t b)
Definition SensorLib.h:62
Structure representing accelerometer data.
Structure representing gyroscope data.
Grouped callbacks for QMI8658 events.
int16_t x[5]
int16_t y[5]