|
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 | BOSCH_BHI260_KLIO |
| #define | USING_SENSOR_IRQ_METHOD |
Functions | |
| void | dataReadyISR () |
| void | progress_callback (uint32_t total, uint32_t transferred, void *user_data) |
| void | recognition_event_callback (uint8_t pattern_id, float count, void *user_data) |
| Callback function for KLIO sensor recognition events. | |
| void | beginRecognition () |
| void | setup () |
| void | loop () |
Variables | |
| SensorBHI260AP | bhy |
| SensorBHI260AP_Klio | klio (bhy) |
| bool | force_update_flash_firmware = true |
| uint8_t | action1_pattern_id = 1 |
| uint8_t | action1_pattern [] |
| uint8_t | action2_pattern_id = 2 |
| const uint8_t | action2_pattern [] |
| 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_klio_recognize_multiple.ino.
| #define BHI260_IRQ 8 |
Definition at line 78 of file bhi260ap_klio_recognize_multiple.ino.
| #define BHI260_RST -1 |
Definition at line 83 of file bhi260ap_klio_recognize_multiple.ino.
| #define BHI260_SCL 3 |
Definition at line 73 of file bhi260ap_klio_recognize_multiple.ino.
| #define BHI260_SDA 2 |
Definition at line 69 of file bhi260ap_klio_recognize_multiple.ino.
| #define BOSCH_BHI260_KLIO |
Definition at line 90 of file bhi260ap_klio_recognize_multiple.ino.
| #define USE_I2C_INTERFACE |
Definition at line 40 of file bhi260ap_klio_recognize_multiple.ino.
| #define USING_SENSOR_IRQ_METHOD |
Definition at line 156 of file bhi260ap_klio_recognize_multiple.ino.
| void beginRecognition | ( | ) |
Definition at line 216 of file bhi260ap_klio_recognize_multiple.ino.
References action1_pattern, action1_pattern_id, action2_pattern, action2_pattern_id, SensorBHI260AP_Klio::enable(), klio, SensorBHI260AP_Klio::recognition(), and SensorBHI260AP_Klio::writeMultiplePatterns().
Referenced by recognition_event_callback(), and setup().
| void dataReadyISR | ( | ) |
Definition at line 162 of file bhi260ap_klio_recognize_multiple.ino.
References isInterruptTriggered.
Referenced by setup().
| void loop | ( | ) |
Definition at line 357 of file bhi260ap_klio_recognize_multiple.ino.
References bhy, and isInterruptTriggered.
| void progress_callback | ( | uint32_t | total, |
| uint32_t | transferred, | ||
| void * | user_data | ||
| ) |
Definition at line 169 of file bhi260ap_klio_recognize_multiple.ino.
| void recognition_event_callback | ( | uint8_t | pattern_id, |
| float | count, | ||
| void * | user_data | ||
| ) |
Callback function for KLIO sensor recognition events.
This function serves as a callback that gets triggered when the KLIO sensor successfully recognizes a pattern. It's designed to handle the recognition event and provide information about the recognized pattern.
| pattern_id | The unique identifier of the recognized pattern. Each pattern in the KLIO sensor's recognition library is assigned a distinct ID, and this parameter indicates which specific pattern has been recognized. |
| count | A floating point value representing the number of actions with the recognized pattern |
| user_data | A generic pointer to user - defined data. This can be used to pass additional context or information from the calling code to the callback function. |
Definition at line 194 of file bhi260ap_klio_recognize_multiple.ino.
References beginRecognition(), SensorBHI260AP_Klio::disable(), and klio.
Referenced by setup().
| void setup | ( | ) |
Definition at line 258 of file bhi260ap_klio_recognize_multiple.ino.
References SensorBHI260AP_Klio::begin(), beginRecognition(), BHI260_IRQ, BHI260_RST, BHI260_SCL, BHI260_SDA, bhy, dataReadyISR(), force_update_flash_firmware, klio, recognition_event_callback(), SensorBHI260AP::setBootFromFlash(), SensorBHI260AP_Klio::setRecognitionCallback(), SPI_MISO, SPI_MOSI, and SPI_SCK.
| uint8_t action1_pattern[] |
Definition at line 106 of file bhi260ap_klio_recognize_multiple.ino.
Referenced by beginRecognition().
| uint8_t action1_pattern_id = 1 |
Definition at line 105 of file bhi260ap_klio_recognize_multiple.ino.
Referenced by beginRecognition().
| const uint8_t action2_pattern[] |
Definition at line 132 of file bhi260ap_klio_recognize_multiple.ino.
Referenced by beginRecognition().
| uint8_t action2_pattern_id = 2 |
Definition at line 131 of file bhi260ap_klio_recognize_multiple.ino.
Referenced by beginRecognition().
| SensorBHI260AP bhy |
Definition at line 86 of file bhi260ap_klio_recognize_multiple.ino.
| bool force_update_flash_firmware = true |
Definition at line 101 of file bhi260ap_klio_recognize_multiple.ino.
Referenced by setup().
| volatile bool isInterruptTriggered = false |
Definition at line 160 of file bhi260ap_klio_recognize_multiple.ino.
Referenced by dataReadyISR(), and loop().
| SensorBHI260AP_Klio klio(bhy) | ( | bhy | ) |
Referenced by beginRecognition(), recognition_event_callback(), and setup().