|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
@license MIT License More...
#include <stdint.h>#include <math.h>Go to the source code of this file.
Classes | |
| struct | SensorVector |
| Structure representing a 3D vector with floating-point components. More... | |
| struct | RawVector |
| Structure representing a raw 3D vector with 16-bit integer components. More... | |
| struct | AccelerometerData |
| Structure representing accelerometer data. More... | |
| struct | MagnetometerData |
| Structure representing magnetometer data. More... | |
| struct | GyroscopeData |
| Structure representing gyroscope data. More... | |
| struct | SensorConfig |
| Structure representing sensor configuration parameters. More... | |
| struct | SensorInfo |
| Structure containing sensor identification information. More... | |
Macros | |
| #define | M_PI 3.14159265358979323846f |
@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.
Definition in file SensorDefs.hpp.
| #define M_PI 3.14159265358979323846f |
Definition at line 37 of file SensorDefs.hpp.
|
strong |
Enumeration of accelerometer full-scale range settings.
| Enumerator | |
|---|---|
| FS_2G | ±2g range |
| FS_4G | ±4g range |
| FS_8G | ±8g range |
| FS_16G | ±16g range |
| FS_32G | ±32g range |
| FS_64G | ±64g range |
| FS_128G | ±128g range |
Definition at line 243 of file SensorDefs.hpp.
|
strong |
Enumeration of gyroscope full-scale range settings.
| Enumerator | |
|---|---|
| FS_125_DPS | ±125 °/s |
| FS_250_DPS | ±250 °/s |
| FS_500_DPS | ±500 °/s |
| FS_1000_DPS | ±1000 °/s |
| FS_2000_DPS | ±2000 °/s |
| FS_4000_DPS | ±4000 °/s (if supported) |
Definition at line 318 of file SensorDefs.hpp.
|
strong |
Enumeration of interrupt pin mapping options.
| Enumerator | |
|---|---|
| DISABLE | Disable interrupt output. |
| PIN1 | Interrupt pin 1. |
| PIN2 | Interrupt pin 2. |
Definition at line 256 of file SensorDefs.hpp.
|
strong |
Enumeration defining down-sample ratios for the sensor.
| Enumerator | |
|---|---|
| DSR_1 | 1x down-sample ratio |
| DSR_2 | 2x down-sample ratio |
| DSR_4 | 4x down-sample ratio |
| DSR_8 | 8x down-sample ratio |
Definition at line 300 of file SensorDefs.hpp.
|
strong |
Enumeration defining full-scale range settings for the sensor.
| Enumerator | |
|---|---|
| FS_2G | |
| FS_4G | |
| FS_8G | |
| FS_12G | |
| FS_16G | |
| FS_20G | |
| FS_25G | |
| FS_30G | |
| FS_32G | |
Definition at line 275 of file SensorDefs.hpp.
|
strong |
| Enumerator | |
|---|---|
| LPF_1 | 1 Hz low-pass filter |
| LPF_2 | 2 Hz low-pass filter |
| LPF_4 | 4 Hz low-pass filter |
| LPF_8 | 8 Hz low-pass filter |
| LPF_16 | 16 Hz low-pass filter |
Definition at line 307 of file SensorDefs.hpp.
|
strong |
Enumeration defining over-sample ratios for the sensor.
| Enumerator | |
|---|---|
| OSR_8 | 8x over-sample ratio |
| OSR_4 | 4x over-sample ratio |
| OSR_2 | 2x over-sample ratio |
| OSR_1 | 1x over-sample ratio |
Definition at line 290 of file SensorDefs.hpp.
|
strong |
Enumeration of sensor operation modes.
| Enumerator | |
|---|---|
| SUSPEND | |
| NORMAL | |
| SINGLE_MEASUREMENT | |
| CONTINUOUS_MEASUREMENT | |
Definition at line 233 of file SensorDefs.hpp.
| enum SensorDirection |
| Enumerator | |
|---|---|
| DIRECTION_TOP_RIGHT | |
| DIRECTION_TOP_LEFT | |
| DIRECTION_BOTTOM_LEFT | |
| DIRECTION_BOTTOM_RIGHT | |
| DIRECTION_BOTTOM | |
| DIRECTION_TOP | |
| DIRECTION_UNKNOWN | |
Definition at line 144 of file SensorDefs.hpp.
|
strong |
Enumeration representing different remapping options for the sensor's orientation.
This enum defines various positions and orientations of the sensor chip. Each value corresponds to a specific corner or location of the chip, which can be used to remap the axes of the sensor according to its physical placement.
Top view of the chip, where 'T' stands for top, 'B' stands for bottom,
| TL TR |
|---|
| BL BR |
There is also a bottom view of the chip:
| BT BB |
|---|
| LT RT |
Definition at line 68 of file SensorDefs.hpp.
|
strong |
Enumeration of sensor types.
Definition at line 201 of file SensorDefs.hpp.
|
strong |
Generic tap event type.
| Enumerator | |
|---|---|
| INVALID | |
| SINGLE | |
| DOUBLE | |
Definition at line 265 of file SensorDefs.hpp.