|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
@license MIT License More...
#include <Wire.h>#include <SPI.h>#include <Arduino.h>#include <ImuDrv.hpp>#include <BoschFirmware.h>Go to the source code of this file.
Macros | |
| #define | USE_I2C_INTERFACE |
| #define | BHI260_SDA 2 |
| #define | BHI260_SCL 3 |
| #define | BHI260_IRQ 8 |
| #define | BHI260_RST -1 |
| #define | USING_DATA_HELPER |
| #define | BOSCH_APP30_SHUTTLE_BHI260_FW |
| #define | USING_SENSOR_IRQ_METHOD |
Functions | |
| SensorQuaternion | quaternion (bhy) |
| void | dataReadyISR () |
| void | progress_callback (uint32_t total, uint32_t transferred, void *user_data) |
| void | setup () |
| Parse the quaternion data from the sensor and convert it to Euler angles. | |
| void | loop () |
Variables | |
| SensorBHI260AP | bhy |
| bool | force_update_flash_firmware = true |
| volatile bool | isInterruptTriggered = false |
@license MIT License
Copyright (c) 2025 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 bhi260ap_euler.ino.
| #define BHI260_IRQ 8 |
Definition at line 78 of file bhi260ap_euler.ino.
| #define BHI260_RST -1 |
Definition at line 83 of file bhi260ap_euler.ino.
| #define BHI260_SCL 3 |
Definition at line 73 of file bhi260ap_euler.ino.
| #define BHI260_SDA 2 |
Definition at line 69 of file bhi260ap_euler.ino.
| #define BOSCH_APP30_SHUTTLE_BHI260_FW |
Definition at line 101 of file bhi260ap_euler.ino.
| #define USE_I2C_INTERFACE |
Definition at line 40 of file bhi260ap_euler.ino.
| #define USING_DATA_HELPER |
Definition at line 94 of file bhi260ap_euler.ino.
| #define USING_SENSOR_IRQ_METHOD |
Definition at line 132 of file bhi260ap_euler.ino.
| void dataReadyISR | ( | ) |
Definition at line 138 of file bhi260ap_euler.ino.
References isInterruptTriggered.
Referenced by setup().
| void loop | ( | ) |
Definition at line 319 of file bhi260ap_euler.ino.
References bhy, isInterruptTriggered, and quaternion().
| void progress_callback | ( | uint32_t | total, |
| uint32_t | transferred, | ||
| void * | user_data | ||
| ) |
Definition at line 145 of file bhi260ap_euler.ino.
| void setup | ( | ) |
Parse the quaternion data from the sensor and convert it to Euler angles.
This function serves as a callback to handle the sensor data related to the game rotation vector. It takes the raw quaternion data received from the sensor, converts it into Euler angles (roll, pitch, and yaw),
| sensor_id | The ID of the sensor that generated the data. It helps in identifying which specific sensor the data is coming from, especially in systems with multiple sensors. |
| data_ptr | A pointer to the buffer containing the raw quaternion data. The data in this buffer represents the orientation of the sensor in quaternion format. |
| len | The length of the data buffer, indicating the size of the quaternion data in bytes. |
| timestamp | A pointer to a 64 - bit unsigned integer representing the timestamp when the sensor data was captured. This can be used to correlate the data with a specific point in time. |
| user_data | A generic pointer to user - defined data. |
Set the axis remapping for the sensor based on the specified orientation.
This function allows you to configure the sensor's axis remapping according to a specific physical orientation of the chip. By passing one of the values from the SensorRemap enum, you can ensure that the sensor data is correctly interpreted based on how the chip is placed. bst-bhi260ab-ds000.pdf 20.3 Sensing axes and axes remapping
| remap | An enumeration value from SensorRemap that specifies the desired axis remapping. |
Definition at line 189 of file bhi260ap_euler.ino.
References BHI260_IRQ, BHI260_RST, BHI260_SCL, BHI260_SDA, bhy, dataReadyISR(), force_update_flash_firmware, parse_quaternion(), quaternion(), SensorBHI260AP::setBootFromFlash(), SPI_MISO, SPI_MOSI, and SPI_SCK.
| SensorBHI260AP bhy |
Definition at line 86 of file bhi260ap_euler.ino.
| bool force_update_flash_firmware = true |
Definition at line 129 of file bhi260ap_euler.ino.
Referenced by setup().
| volatile bool isInterruptTriggered = false |
Definition at line 136 of file bhi260ap_euler.ino.
Referenced by dataReadyISR(), and loop().