33#include "SensorQMI8658.hpp"
34#ifdef ARDUINO_T_BEAM_S3_SUPREME
35#include <XPowersAXP2101.tpp>
92#if defined(ARDUINO_T_BEAM_S3_SUPREME)
94 power.begin(Wire1, AXP2101_SLAVE_ADDRESS, 42, 41);
98 power.setALDO1Voltage(3300); power.enableALDO1();
99 power.setALDO2Voltage(3300); power.enableALDO2();
105 Serial.begin(115200);
118#if defined(SPI_MOSI) && defined(SPI_SCK) && defined(SPI_MISO)
126 Serial.println(
"Failed to find QMI8658 - check your wiring!");
133 Serial.print(
"Device ID:");
136 uint16_t gX_gain = 0, gY_gain = 0, gZ_gain = 0;
149 Serial.println(
"All calibrations are completed");
154 Serial.print(
"Calibration failed, please leave the sensor alone and keep quiet! , Will try again in ");
156 Serial.println(
" seconds");
163 Serial.print(
"Calibration data ->");
164 Serial.print(
"Gyro-X gain : "); Serial.println(gX_gain);
165 Serial.print(
"Gyro-Y gain : "); Serial.println(gY_gain);
166 Serial.print(
"Gyro-Z gain : "); Serial.println(gZ_gain);
171 Serial.println(
"Write calibrations successfully");
173 Serial.println(
"Write calibrations failed!");
254 Serial.println(
"Read data now...");
262 Serial.print(
"ACCEL.x:");
264 Serial.print(
",ACCEL.y:");
266 Serial.print(
",ACCEL.z:");
271 Serial.print(
"GYRO.x:");
273 Serial.print(
",GYRO.y:");
275 Serial.print(
",GYRO.z:");
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 getGyroscope(float &x, float &y, float &z)
Get the raw gyroscope data.
void dumpCtrlRegister()
Dump the control register values.
uint8_t getChipID() override
Get the chip ID / WHO_AM_I value.
bool configAccelerometer(AccelRange range, AccelODR odr, LpfMode lpfOdr=LPF_MODE_0)
Configure the accelerometer.
bool configGyroscope(GyroRange range, GyroODR odr, LpfMode lpfOdr=LPF_MODE_0)
Configure the gyroscope.
bool enableGyroscope()
Enable the gyroscope.
bool enableAccelerometer()
Enable the accelerometer.
bool getDataReady()
Check if new data is available.
bool writeCalibration(uint16_t gyro_x_gain, uint16_t gyro_y_gain, uint16_t gyro_z_gain)
Write previously saved gyro calibration gains.
bool calibration(uint16_t *gX_gain=NULL, uint16_t *gY_gain=NULL, uint16_t *gZ_gain=NULL)
Set Gyroscope calibration gains.
bool getAccelerometer(float &x, float &y, float &z)
Get the accelerometer data.