SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
bhi260ap_klio_recognition.ino File Reference

@license MIT License More...

#include <Wire.h>
#include <SPI.h>
#include <Arduino.h>
#include <ImuDrv.hpp>
#include <BoschFirmware.h>
Include dependency graph for bhi260ap_klio_recognition.ino:

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 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 []
 
volatile bool isInterruptTriggered = false
 

Detailed Description

@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.

Author
Lewis He (lewis.nosp@m.he@o.nosp@m.utloo.nosp@m.k.co.nosp@m.m)
Date
2025-02-02
Note
Changed from Boschsensortec API https://github.com/boschsensortec/BHY2_SensorAPI

Definition in file bhi260ap_klio_recognition.ino.

Macro Definition Documentation

◆ BHI260_IRQ

#define BHI260_IRQ   8

Definition at line 78 of file bhi260ap_klio_recognition.ino.

◆ BHI260_RST

#define BHI260_RST   -1

Definition at line 83 of file bhi260ap_klio_recognition.ino.

◆ BHI260_SCL

#define BHI260_SCL   3

Definition at line 73 of file bhi260ap_klio_recognition.ino.

◆ BHI260_SDA

#define BHI260_SDA   2

Definition at line 69 of file bhi260ap_klio_recognition.ino.

◆ BOSCH_BHI260_KLIO

#define BOSCH_BHI260_KLIO

Definition at line 90 of file bhi260ap_klio_recognition.ino.

◆ USE_I2C_INTERFACE

#define USE_I2C_INTERFACE

Definition at line 40 of file bhi260ap_klio_recognition.ino.

◆ USING_SENSOR_IRQ_METHOD

#define USING_SENSOR_IRQ_METHOD

Definition at line 131 of file bhi260ap_klio_recognition.ino.

Function Documentation

◆ dataReadyISR()

void dataReadyISR ( )

Definition at line 137 of file bhi260ap_klio_recognition.ino.

References isInterruptTriggered.

Referenced by setup().

◆ loop()

void loop ( )

Definition at line 287 of file bhi260ap_klio_recognition.ino.

References bhy, and isInterruptTriggered.

◆ progress_callback()

void progress_callback ( uint32_t  total,
uint32_t  transferred,
void *  user_data 
)

Definition at line 144 of file bhi260ap_klio_recognition.ino.

◆ setup()

Variable Documentation

◆ action1_pattern

uint8_t action1_pattern[]
Initial value:
= {
0x52, 0x42, 0x31, 0x06, 0x03, 0xfd, 0xad, 0x80,
0x40, 0x0a, 0xd7, 0x23, 0x3c, 0x78, 0xe2, 0x44,
0xbf, 0x63, 0xe1, 0x0d, 0xc0, 0x19, 0x39, 0x97,
0xbf, 0xdb, 0x93, 0x04, 0x3f, 0xce, 0x07, 0xb7,
0x3e, 0x5e, 0xda, 0xf0, 0x3d, 0xe3, 0x6f, 0x8f,
0x3e, 0x65, 0x7c, 0x4f, 0x40, 0x46, 0x3f, 0xb4,
0x3f, 0xdf, 0xd1, 0x3d, 0xbf, 0xfa, 0x5a, 0x82,
0xbf, 0x35, 0xf6, 0x16, 0x3e, 0xbe, 0x70, 0x82,
0x40, 0xaa, 0x21, 0x70, 0x41, 0xcb, 0x27, 0xf0,
0x40, 0x19, 0x06, 0xd9, 0xbf, 0x3a, 0x10, 0xa7,
0xbf, 0x27, 0x07, 0x31, 0x3f, 0x27, 0x23, 0xc9,
0xbd, 0x44, 0x29, 0x2f, 0x40, 0xa6, 0x61, 0x97,
0xc0, 0x29, 0x5d, 0x21, 0xbe, 0x82, 0xd4, 0x0d,
0x3e, 0xc0, 0xf0, 0x15, 0x3d, 0x00, 0xbc, 0xda,
0x3d, 0x14, 0x0c, 0xc5, 0xbd, 0x46, 0xa0, 0x03,
0x3e, 0xca, 0x5c, 0x95, 0x3d, 0x24, 0xe5, 0x13,
0x3c, 0x70, 0x0a, 0x81, 0x3c, 0x69, 0x22, 0xd6,
0x3c, 0x51, 0xa4, 0xdf, 0x3e, 0x4c, 0xa8, 0x55,
0xbf, 0xe1, 0xe8, 0xc7, 0xbd, 0xe8, 0x7c, 0xbe,
0x3d, 0xf7, 0x5b, 0x21, 0x3c
}

Definition at line 107 of file bhi260ap_klio_recognition.ino.

Referenced by setup().

◆ action1_pattern_id

uint8_t action1_pattern_id = 1

Definition at line 106 of file bhi260ap_klio_recognition.ino.

Referenced by setup().

◆ bhy

Definition at line 86 of file bhi260ap_klio_recognition.ino.

Referenced by loop(), and setup().

◆ force_update_flash_firmware

bool force_update_flash_firmware = true

Definition at line 101 of file bhi260ap_klio_recognition.ino.

Referenced by setup().

◆ isInterruptTriggered

volatile bool isInterruptTriggered = false

Definition at line 135 of file bhi260ap_klio_recognition.ino.

Referenced by dataReadyISR(), and loop().

◆ klio

Referenced by setup().