SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
sensor/imu/bhi260/SensorBHI260AP.hpp
Go to the documentation of this file.
1
31#pragma once
32
33#include "../../../SensorBuildOpt.h"
34#if !SENSORLIB_EXCLUDE_BHI260
35#include "../../../bosch/BoschSensorBase.hpp"
36
37// The BHI260 I2C address can be either 0x28 or 0x29, depending on the state of the HSDO pin.
38// HSDO pin set low
39static constexpr uint8_t BHI260AP_SLAVE_ADDRESS_L = (0x28);
40// HSDO pin set high
41static constexpr uint8_t BHI260AP_SLAVE_ADDRESS_H = (0x29);
42
43
44class SensorBHI260AP final: public BoschSensorBase
45{
46public:
47
48 // The pin names are named according to the sensor manual.
50 MCSB1 = 1,
51 RESV1 = 2,
52 RESV2 = 3,
53 MCSB2 = 4, //It may be connected to the BMM150 sensor, select according to the actual situation
54 MCSB3 = 5,
55 MCSB4 = 6,
56
57 QSPI_CLK = 8, // If BHI260 carries external flash, it is not available
58 QSPI_CSN = 9, // If BHI260 carries external flash, it is not available
59 QSPI_D0 = 10, // If BHI260 carries external flash, it is not available
60 QSPI_D1 = 11, // If BHI260 carries external flash, it is not available
61 QSPI_D2 = 12, // If BHI260 carries external flash, it is not available
62 QSPI_D3 = 13, // If BHI260 carries external flash, it is not available
63
64 M2SCX = 14,
65 M2SDX = 15,
66 M2SDI = 16,
67 M3SCL = 17, //It may be connected to the BMM150 sensor, select according to the actual situation
68 M3SDA = 18, //It may be connected to the BMM150 sensor, select according to the actual situation
71
72 M1SCX = 127, // Invalid Pin
73 M1SDX = 128, // Invalid Pin
74 M1SDI = 129, // Invalid Pin
75 RESV3 = 130, // Invalid Pin
76 };
77
78 ~SensorBHI260AP() = default;
79 SensorBHI260AP() = default;
80
87 void setBootFromFlash(bool boot_from_flash);
88
96 uint8_t digitalRead(uint8_t pin, bool pullup = false);
97
105 void digitalWrite(uint8_t pin, uint8_t level);
106
113 void disableGpio(uint8_t pin);
114
115protected:
121 uint16_t getConfirmationIDImpl() override;
122};
123
124#endif
uint8_t level
void digitalWrite(uint8_t pin, uint8_t level)
digitalWrite
uint8_t digitalRead(uint8_t pin, bool pullup=false)
digitalRead
SensorBHI260AP()=default
void disableGpio(uint8_t pin)
disableGpio
uint16_t getConfirmationIDImpl() override
Get the confirmation ID for the sensor.
~SensorBHI260AP()=default
void setBootFromFlash(bool boot_from_flash)
setBootFromFlash