33#include "SensorQMI8658.hpp"
34#ifdef ARDUINO_T_BEAM_S3_SUPREME
35#include <XPowersAXP2101.tpp>
95#if defined(ARDUINO_T_BEAM_S3_SUPREME)
97 power.begin(Wire1, AXP2101_SLAVE_ADDRESS, 42, 41);
101 power.setALDO1Voltage(3300); power.enableALDO1();
102 power.setALDO2Voltage(3300); power.enableALDO2();
108 Serial.begin(115200);
119#if defined(SPI_MOSI) && defined(SPI_SCK) && defined(SPI_MISO)
127 Serial.println(
"Failed to find QMI8658 - check your wiring!");
136 Serial.print(
"Device ID:"); Serial.println(
qmi.
getChipID(), HEX);
257 Serial.println(
"Read data now...");
275 Serial.println(
">>>>>>>>>>>>>>>>>>>>>>>>>>>> Disable FIFO...");
280 if (samples_num == 0) {
284 Serial.print(
"--------------[");
285 Serial.print(millis());
286 Serial.print(
"]:data size:");
287 Serial.print(samples_num);
288 Serial.println(
"--------------");
297 Serial.print(
"\t ACCEL.x:"); Serial.print(
accel[
i].
x); Serial.println(
" m2/s");
298 Serial.print(
"\t ACCEL.y:"); Serial.print(
accel[
i].
y); Serial.println(
" m2/s");
299 Serial.print(
"\t ACCEL.z:"); Serial.print(
accel[
i].z); Serial.println(
" m2/s");
304 Serial.print(
"\t GYRO.x:"); Serial.print(
gyro[
i].
x); Serial.println(
" degrees/sec");
305 Serial.print(
"\t GYRO.y:"); Serial.print(
gyro[
i].
y); Serial.println(
" degrees/sec");
306 Serial.print(
"\t GYRO.z:"); Serial.print(
gyro[
i].z); Serial.println(
" degrees/sec");
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.
uint8_t getChipID() override
Get the chip ID / WHO_AM_I value.
void enableINT(IntPin pin, bool enable=true)
Enable or disable the interrupt.
uint16_t readFromFifo(AccelerometerData *accel_data, uint16_t accel_count, GyroscopeData *gyro_data, uint16_t gyro_count) override
Read data from FIFO buffer.
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 isEnableAccelerometer()
Check if the accelerometer is enabled.
bool isEnableGyroscope()
Check if the gyroscope is enabled.
bool configFIFO(FIFO_Mode mode, FIFO_Samples samples=FIFO_SAMPLES_16, IntPin pin=INTERRUPT_PIN_DISABLE, uint8_t trigger_samples=16)
Configure the FIFO.
bool enableGyroscope()
Enable the gyroscope.
bool enableAccelerometer()
Enable the accelerometer.
IMUdata gyro[buffer_size]
const uint16_t buffer_size
IMUdata accel[buffer_size]