|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
@license MIT License More...
Go to the source code of this file.
Macros | |
| #define | USE_I2C_INTERFACE |
| #define | IMU_SDA 17 |
| #define | IMU_SCL 18 |
| #define | IMU_IRQ 33 |
Functions | |
| void | setupPower () |
| void | womCallback () |
| void | applyWomConfig () |
| void | printWomHelp () |
| void | handleWomCommands () |
| void | setup () |
| void | loop () |
Variables | |
| SensorQMI8658 | imu |
| uint32_t | lastPollMs = 0 |
| volatile bool | isInterruptTriggered = false |
| constexpr uint32_t | kPollIntervalMs = 50 |
| uint8_t | womThreshold = 150 |
| float | womOdrHz = 11.0f |
| uint8_t | womDefaultPinValue = 1 |
| uint8_t | womBlankingTime = 0x20 |
| AccelFullScaleRange | womRange = AccelFullScaleRange::FS_8G |
| SensorQMI8658::IntPin | womIntPin = SensorQMI8658::IntPin::PIN2 |
@license MIT License
Copyright (c) 2026 lewis he
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Wake-on-motion example using SensorQMI8658.
This example demonstrates how to:
@important WoM Notes:
configWakeOnMotionAdvanced(...) exposes vendor-style parameters: threshold, ODR, interrupt route, default pin level, blanking time, accel range.Definition in file qmi8658_wake_on_motion.ino.
| #define IMU_IRQ 33 |
Definition at line 91 of file qmi8658_wake_on_motion.ino.
| #define IMU_SCL 18 |
Definition at line 85 of file qmi8658_wake_on_motion.ino.
| #define IMU_SDA 17 |
Definition at line 81 of file qmi8658_wake_on_motion.ino.
| #define USE_I2C_INTERFACE |
Definition at line 57 of file qmi8658_wake_on_motion.ino.
| void applyWomConfig | ( | ) |
Definition at line 142 of file qmi8658_wake_on_motion.ino.
References SensorQMI8658::configWakeOnMotionAdvanced(), FS_2G, FS_4G, FS_8G, imu, womBlankingTime, womDefaultPinValue, womIntPin, womOdrHz, womRange, and womThreshold.
Referenced by handleWomCommands(), and setup().
| void handleWomCommands | ( | ) |
Definition at line 175 of file qmi8658_wake_on_motion.ino.
References applyWomConfig(), cmd, FS_16G, FS_2G, FS_4G, FS_8G, printWomHelp(), womBlankingTime, womDefaultPinValue, womOdrHz, womRange, and womThreshold.
Referenced by loop().
| void loop | ( | ) |
Definition at line 294 of file qmi8658_wake_on_motion.ino.
References handleWomCommands(), imu, isInterruptTriggered, kPollIntervalMs, lastPollMs, and SensorQMI8658::update().
| void printWomHelp | ( | ) |
Definition at line 163 of file qmi8658_wake_on_motion.ino.
Referenced by handleWomCommands(), and setup().
| void setup | ( | ) |
Definition at line 244 of file qmi8658_wake_on_motion.ino.
References applyWomConfig(), ComplexDeviceWithHal::begin(), imu, IMU_CS, IMU_IRQ, IMU_SCL, IMU_SDA, isInterruptTriggered, printWomHelp(), SensorQMI8658::setPins(), setupPower(), SensorQMI8658::setWakeOnMotionCallback(), SPI_MISO, SPI_MOSI, SPI_SCK, and womCallback().
| void setupPower | ( | ) |
Definition at line 108 of file qmi8658_wake_on_motion.ino.
Referenced by setup().
| void womCallback | ( | ) |
Definition at line 136 of file qmi8658_wake_on_motion.ino.
Referenced by setup().
| SensorQMI8658 imu |
Definition at line 123 of file qmi8658_wake_on_motion.ino.
Referenced by applyWomConfig(), loop(), and setup().
| volatile bool isInterruptTriggered = false |
Definition at line 127 of file qmi8658_wake_on_motion.ino.
|
constexpr |
Definition at line 128 of file qmi8658_wake_on_motion.ino.
Referenced by loop().
| uint32_t lastPollMs = 0 |
Definition at line 126 of file qmi8658_wake_on_motion.ino.
Referenced by loop().
| uint8_t womBlankingTime = 0x20 |
Definition at line 132 of file qmi8658_wake_on_motion.ino.
Referenced by applyWomConfig(), and handleWomCommands().
| uint8_t womDefaultPinValue = 1 |
Definition at line 131 of file qmi8658_wake_on_motion.ino.
Referenced by applyWomConfig(), and handleWomCommands().
| SensorQMI8658::IntPin womIntPin = SensorQMI8658::IntPin::PIN2 |
Definition at line 134 of file qmi8658_wake_on_motion.ino.
Referenced by applyWomConfig().
| float womOdrHz = 11.0f |
Definition at line 130 of file qmi8658_wake_on_motion.ino.
Referenced by applyWomConfig(), and handleWomCommands().
| AccelFullScaleRange womRange = AccelFullScaleRange::FS_8G |
Definition at line 133 of file qmi8658_wake_on_motion.ino.
Referenced by applyWomConfig(), and handleWomCommands().
| uint8_t womThreshold = 150 |
Definition at line 129 of file qmi8658_wake_on_motion.ino.
Referenced by applyWomConfig(), and handleWomCommands().