1#ifndef ICM20948_DEVLAB_H
2#define ICM20948_DEVLAB_H
190 bool beginI2C(uint8_t address = 0x69, TwoWire &i2cPort = Wire, uint32_t i2cSpeed = 400000);
192 bool beginSPI(uint8_t csPin, SPIClass &spiPort = SPI, uint32_t spiSpeed = 1000000);
274 bool readAccel(
float &x,
float &y,
float &z);
286 bool readGyro(
float &x,
float &y,
float &z);
311 bool readMag(
float &x,
float &y,
float &z);
430 bool getDLPF(uint8_t &dlpf,
bool &bypass);
615 bool setSensors(
bool accel_on,
bool gyro_on,
bool temp_on);
633 bool getSensors(
bool &accel_on,
bool &gyro_on,
bool &temp_on);
651 bool setGyroOffset(uint16_t offsetX, uint16_t offsetY, uint16_t offsetZ);
669 bool getGyroOffset(int16_t &offsetX, int16_t &offsetY, int16_t &offsetZ);
687 bool setAccelOffset(int16_t offsetX, int16_t offsetY, int16_t offsetZ);
705 bool getAccelOffset(int16_t &offsetX, int16_t &offsetY, int16_t &offsetZ);
791 bool auxWriteByte(uint8_t slaveAddr, uint8_t reg, uint8_t data);
812 bool auxReadByte(uint8_t slaveAddr, uint8_t reg, uint8_t &data);
848 bool auxConfigSlave(uint8_t slaveAddr, uint8_t reg, uint8_t numBytes);
906 float mg_per_lsb = 16384.0f;
907 float degree_per_second = 131.072f;
909 bool writeSlave4(uint8_t reg, uint8_t value);
910 bool readSlave4(uint8_t reg, uint8_t &value);
@ MODE_SINGLE_MEASUREMENT
bool readGyro(float &x, float &y, float &z)
bool setMagOpMode(ICM20948_Op_Mode opMode)
bool setDLPF(ICM20948_Gyro_DLPF dlpf, bool bypass)
bool auxWriteByte(uint8_t slaveAddr, uint8_t reg, uint8_t data)
bool setGyroDivRate(uint8_t divisor)
bool setClock(ICM20948_Clock_Source clock)
bool setAccelScale(ICM20948_Accel_FullScale fullScale)
bool auxReadByte(uint8_t slaveAddr, uint8_t reg, uint8_t &data)
bool applyBasicDefaults()
bool auxRead12bit(uint16_t &raw)
bool readAccel(float &x, float &y, float &z)
bool intEnableConfig(const ICM20948_IntEnableConfig &cfg)
bool getGyroOffset(int16_t &offsetX, int16_t &offsetY, int16_t &offsetZ)
bool beginSPI(uint8_t csPin, SPIClass &spiPort=SPI, uint32_t spiSpeed=1000000)
bool auxReadResponse(uint8_t slaveAddr, uint8_t &data)
bool getGyroScale(uint8_t &fullScale)
bool setAccelAveraging(ICM20948_Accel_Average avg)
bool checkIntStatus(ICM20948_IntStatus &status)
bool setGyroOffset(uint16_t offsetX, uint16_t offsetY, uint16_t offsetZ)
bool setGyroScale(ICM20948_Gyro_FullScale fullScale)
bool setLowPower(bool enable)
bool setGyroSampleRate(float sampleRate)
bool getGyroSampleRate(float &sampleRate)
bool setGyroAveraging(ICM20948_Gyro_Average avg)
bool setAccelOffset(int16_t offsetX, int16_t offsetY, int16_t offsetZ)
bool getSensors(bool &accel_on, bool &gyro_on, bool &temp_on)
bool readWhoAmI(uint8_t &whoAmI)
bool auxReadSensorData(uint8_t *buf, uint8_t len)
bool beginI2C(uint8_t address=0x69, TwoWire &i2cPort=Wire, uint32_t i2cSpeed=400000)
bool getAccelDLPF(uint8_t &dlpf, bool &bypass)
bool getLowPower(bool &enable)
bool selfTestGyro(bool x, bool y, bool z)
bool getAccelSampleRate(float &sampleRate)
bool readMag(float &x, float &y, float &z)
bool readTemperature(float &temperature)
bool selectBank(uint8_t bank)
bool auxMasterEnable(uint8_t clkFreq)
bool intInit(const ICM20948_IntPinConfig &cfg)
bool getDLPF(uint8_t &dlpf, bool &bypass)
bool auxConfigSlave(uint8_t slaveAddr, uint8_t reg, uint8_t numBytes)
bool auxWriteCommand(uint8_t slaveAddr, uint8_t cmd)
bool getClock(uint8_t &clock)
bool setAccelDLPF(uint8_t dlpf, bool bypass)
bool setAccelDivRate(uint16_t divisor)
bool getAccelScale(uint8_t &fullScale)
bool selfTestAccel(bool x, bool y, bool z)
bool getAccelAveraging(uint8_t &avg)
bool getAccelOffset(int16_t &offsetX, int16_t &offsetY, int16_t &offsetZ)
bool setSensors(bool accel_on, bool gyro_on, bool temp_on)
bool setAccelSampleRate(uint16_t sampleRate)