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

@license MIT License More...

#include <Wire.h>
#include <SPI.h>
#include <Arduino.h>
#include <ImuDrv.hpp>
#include <Commander.h>
#include <BoschFirmware.h>
Include dependency graph for bhi260ap_gpio.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_GPIO
 
#define USING_SENSOR_IRQ_METHOD
 

Functions

void initialiseCommander ()
 
void dataReadyISR ()
 
void progress_callback (uint32_t total, uint32_t transferred, void *user_data)
 
void setup ()
 
void loop ()
 
bool helpHandler (Commander &Cmdr)
 
bool setGpioLevel (Commander &Cmdr)
 
bool getGpioLevel (Commander &Cmdr)
 
bool disGpioMode (Commander &Cmdr)
 

Variables

Commander cmd
 
SensorBHI260AP bhy
 
bool force_update_flash_firmware = true
 
volatile bool isInterruptTriggered = false
 
uint32_t check_millis = 0
 
const commandList_t masterCommands []
 

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-01-04
Note
Changed from Boschsensortec API https://github.com/boschsensortec/BHY2_SensorAPI

Definition in file bhi260ap_gpio.ino.

Macro Definition Documentation

◆ BHI260_IRQ

#define BHI260_IRQ   8

Definition at line 81 of file bhi260ap_gpio.ino.

◆ BHI260_RST

#define BHI260_RST   -1

Definition at line 86 of file bhi260ap_gpio.ino.

◆ BHI260_SCL

#define BHI260_SCL   3

Definition at line 76 of file bhi260ap_gpio.ino.

◆ BHI260_SDA

#define BHI260_SDA   2

Definition at line 72 of file bhi260ap_gpio.ino.

◆ BOSCH_BHI260_GPIO

#define BOSCH_BHI260_GPIO

Definition at line 94 of file bhi260ap_gpio.ino.

◆ USE_I2C_INTERFACE

#define USE_I2C_INTERFACE

Definition at line 43 of file bhi260ap_gpio.ino.

◆ USING_SENSOR_IRQ_METHOD

#define USING_SENSOR_IRQ_METHOD

Definition at line 109 of file bhi260ap_gpio.ino.

Function Documentation

◆ dataReadyISR()

void dataReadyISR ( )

Definition at line 115 of file bhi260ap_gpio.ino.

References isInterruptTriggered.

Referenced by setup().

◆ disGpioMode()

bool disGpioMode ( Commander &  Cmdr)

Definition at line 326 of file bhi260ap_gpio.ino.

References bhy, and SensorBHI260AP::disableGpio().

◆ getGpioLevel()

bool getGpioLevel ( Commander &  Cmdr)

Definition at line 304 of file bhi260ap_gpio.ino.

References bhy, SensorBHI260AP::digitalRead(), and level.

◆ helpHandler()

bool helpHandler ( Commander &  Cmdr)

Definition at line 258 of file bhi260ap_gpio.ino.

◆ initialiseCommander()

void initialiseCommander ( )

Definition at line 249 of file bhi260ap_gpio.ino.

References cmd, and masterCommands.

Referenced by setup().

◆ loop()

void loop ( )

Definition at line 219 of file bhi260ap_gpio.ino.

References bhy, cmd, and isInterruptTriggered.

◆ progress_callback()

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

Definition at line 122 of file bhi260ap_gpio.ino.

◆ setGpioLevel()

bool setGpioLevel ( Commander &  Cmdr)

Definition at line 288 of file bhi260ap_gpio.ino.

References bhy, SensorBHI260AP::digitalWrite(), and level.

◆ setup()

Variable Documentation

◆ bhy

Definition at line 89 of file bhi260ap_gpio.ino.

Referenced by disGpioMode(), getGpioLevel(), loop(), setGpioLevel(), and setup().

◆ check_millis

uint32_t check_millis = 0

Definition at line 217 of file bhi260ap_gpio.ino.

◆ cmd

Commander cmd

Definition at line 36 of file bhi260ap_gpio.ino.

Referenced by initialiseCommander(), loop(), and setup().

◆ force_update_flash_firmware

bool force_update_flash_firmware = true

Definition at line 106 of file bhi260ap_gpio.ino.

Referenced by setup().

◆ isInterruptTriggered

volatile bool isInterruptTriggered = false

Definition at line 113 of file bhi260ap_gpio.ino.

Referenced by dataReadyISR(), and loop().

◆ masterCommands

const commandList_t masterCommands[]
Initial value:
= {
{"help", helpHandler, "help"},
{"set gpio", setGpioLevel, "set gpio level"},
{"get gpio", getGpioLevel, "get gpio level"},
{"dis gpio", disGpioMode, "disable gpio"},
}
bool helpHandler(Commander &Cmdr)
bool getGpioLevel(Commander &Cmdr)
bool disGpioMode(Commander &Cmdr)
bool setGpioLevel(Commander &Cmdr)

Definition at line 242 of file bhi260ap_gpio.ino.

Referenced by initialiseCommander().