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.println(
"[SYNC] Data locked and ready!");
127 Serial.
begin(115200);
132 Serial.println(
"QMI8658 Synchronous Mode Example");
134#ifdef USE_I2C_INTERFACE
136 Serial.println(
"Failed to initialize QMI8658!");
143#ifdef USE_SPI_INTERFACE
146 Serial.println(
"Failed to initialize QMI8658!");
180 Serial.println(
"Synchronous mode enabled. Data is synchronized!");
193 serialPrintFmt(
"[%u] 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.
void setDataLockingCallback(DataReadyCallback callback)
Set callback for data locking.
bool enableAccel() override
Enable the accelerometer.
bool enableSyncMode() override
Enable synchronous sampling mode.
bool readAccel(AccelerometerData &out) override
Read accelerometer data.
bool enableGyro() override
Enable the gyroscope.
bool enableDataReadyInterrupt(IntPin pin=IntPin::PIN2)
Enable data ready interrupt.
bool enableLockingMechanism()
Enable the data locking mechanism.
bool configAccel(AccelFullScaleRange range, float data_rate_hz, LpfMode lpf=LpfMode::MODE_0)
Configure the accelerometer with specified parameters.
uint32_t getTimestamp() override
Get the timestamp from the sensor.
void setPins(int pin)
Set interrupt pin.
IMUdata gyro[buffer_size]
IMUdata accel[buffer_size]
void dataLockingCallback()
Structure representing accelerometer data.
Structure representing gyroscope data.