49#if !defined(USE_I2C_INTERFACE) && !defined(USE_SPI_INTERFACE)
50#define USE_I2C_INTERFACE
53#if defined(USE_SPI_INTERFACE)
87#ifdef ARDUINO_T_BEAM_S3_SUPREME
88#include <XPowersAXP2101.tpp>
91static void serialPrintFmt(
const char *fmt, ...)
96 vsnprintf(
buf,
sizeof(
buf), fmt, args);
103#if defined(ARDUINO_T_BEAM_S3_SUPREME)
104 XPowersAXP2101 power;
105 power.begin(Wire1, AXP2101_SLAVE_ADDRESS, 42, 41);
106 power.disableALDO1();
107 power.disableALDO2();
109 power.setALDO1Voltage(3300);
111 power.setALDO2Voltage(3300);
122 Serial.
begin(115200);
127 Serial.println(
"QMI8658 Basic Read Example");
129#ifdef USE_I2C_INTERFACE
131 Serial.println(
"Failed to initialize QMI8658!");
138#ifdef USE_SPI_INTERFACE
141 Serial.println(
"Failed to initialize QMI8658!");
148 Serial.print(
"Firmware Version: 0x");
168 Serial.println(
"\n--- Accelerometer & Gyroscope Data ---");
169 Serial.println(
"Format: ACCEL(m/s2) | GYRO(deg/s)");
181 serialPrintFmt(
"Accel: %7.3f %7.3f %7.3f | Gyro: %8.3f %8.3f %8.3f\n",
bool begin(CommInterface interface, SensorCommCustom::CustomCallback callback, SensorCommCustomHal::CustomHalCallback hal_callback, uint8_t addr=0)
Initialize the sensor using custom callback interface.
QMI8658 IMU sensor driver class.
bool configGyro(GyroFullScaleRange range, float data_rate_hz, LpfMode lpf=LpfMode::MODE_0)
Configure the gyroscope with specified parameters.
bool readGyro(GyroscopeData &out) override
Read gyroscope data.
bool isDataReady(uint8_t mask=static_cast< uint8_t >(ImuBase::DataReadyMask::BOTH)) override
Check if requested IMU data is available.
bool enableAccel() override
Enable the accelerometer.
bool readAccel(AccelerometerData &out) override
Read accelerometer data.
bool enableGyro() override
Enable the gyroscope.
uint32_t getFirmwareVersion() override
Get the firmware version.
@ MODE_0
2.66% of output data rate
bool configAccel(AccelFullScaleRange range, float data_rate_hz, LpfMode lpf=LpfMode::MODE_0)
Configure the accelerometer with specified parameters.
IMUdata gyro[buffer_size]
IMUdata accel[buffer_size]
Structure representing accelerometer data.
Structure representing gyroscope data.