API Reference¶
qwiic_icm20948¶
Python module for the [SparkFun 9DoF IMU Breakout - ICM-20948 (Qwiic)](https://www.sparkfun.com/products/15335)
This python package is a port of the existing [SparkFun ICM-20948 Arduino Library](https://github.com/sparkfun/SparkFun_ICM-20948_ArduinoLibrary)
This package can be used in conjunction with the overall [SparkFun qwiic Python Package](https://github.com/sparkfun/Qwiic_Py)
New to qwiic? Take a look at the entire [SparkFun qwiic ecosystem](https://www.sparkfun.com/qwiic).
-
class
qwiic_icm20948.QwiicIcm20948(address=None, i2c_driver=None)[source]¶ Parameters: - address – The I2C address to use for the device. If not provided, the default address is used.
- i2c_driver – An existing i2c driver object. If not provided a driver object is created.
Returns: The ICM20948 device object.
Return type: Object
-
ToSignedInt(input)[source]¶ Takes an input data of 16 bits, and returns the signed 32 bit int version of this data
Returns: Signed 32 bit integer Return type: int
-
begin()[source]¶ Initialize the operation of the ICM20948 module
Returns: Returns true of the initializtion was successful, otherwise False. Return type: bool
-
connected¶ Determine if a ICM20948 device is conntected to the system..
Returns: True if the device is connected, otherwise False. Return type: bool
-
dataReady()[source]¶ Returns status of RAW_DATA_0_RDY_INT the ICM90248 module
Returns: Returns true if raw data is ready, otherwise False. Return type: bool
-
enableDlpfAccel(on)[source]¶ Enables or disables the accelerometer DLPF of the ICM90248 module
Returns: Returns true if the DLPF mode setting write was successful, otherwise False. Return type: bool
-
enableDlpfGyro(on)[source]¶ Enables or disables the Gyro DLPF of the ICM90248 module
Returns: Returns true if the DLPF mode setting write was successful, otherwise False. Return type: bool
-
getAgmt()[source]¶ Reads and updates raw values from accel, gyro, mag and temp of the ICM90248 module
Returns: Returns True if I2C readBlock was successful, otherwise False. Return type: bool
-
i2cMasterConfigureSlave(slave, addr, reg, len, Rw, enable, data_only, grp, swap)[source]¶ Configures Master/slave settings for the ICM20948 as master, and slave in slots 0-3
Returns: Returns true if the configuration was successful, otherwise False. Return type: bool
-
i2cMasterEnable(enable)[source]¶ Enables or disables I2C Master
Returns: Returns true if the setting write was successful, otherwise False. Return type: bool
-
i2cMasterPassthrough(passthrough)[source]¶ Enables or disables I2C Master Passthrough
Returns: Returns true if the setting write was successful, otherwise False. Return type: bool
-
i2cMasterReset()[source]¶ Resets I2C Master Module
Returns: Returns true if the i2c write was successful, otherwise False. Return type: bool
-
isConnected()[source]¶ Determine if a ICM20948 device is conntected to the system..
Returns: True if the device is connected, otherwise False. Return type: bool
-
lowPower(on)[source]¶ Sets the ICM20948 module in or out of low power mode
Returns: Returns true if the power mode setting write was successful, otherwise False. Return type: bool
-
magWhoIAm()[source]¶ Checks to see that the Magnatometer returns the correct ID value
Returns: Returns true if the check was successful, otherwise False. Return type: bool
-
setBank(bank)[source]¶ Sets the bank register of the ICM20948 module
Returns: Returns true if the bank was a valid value and it was set, otherwise False. Return type: bool
-
setDLPFcfgAccel(dlpcfg)[source]¶ Sets the digital low pass filter for the accel in the ICM20948 module
Returns: Returns true if the dlp setting write was successful, otherwise False. Return type: bool
-
setDLPFcfgGyro(dlpcfg)[source]¶ Sets the digital low pass filter for the gyro in the ICM20948 module
Returns: Returns true if the dlp setting write was successful, otherwise False. Return type: bool
-
setFullScaleRangeAccel(mode)[source]¶ Sets the full scale range for the accel in the ICM20948 module
Returns: Returns true if the full scale range setting write was successful, otherwise False. Return type: bool
-
setFullScaleRangeGyro(mode)[source]¶ Sets the full scale range for the gyro in the ICM20948 module
Returns: Returns true if the full scale range setting write was successful, otherwise False. Return type: bool
-
setSampleMode(sensors, mode)[source]¶ Sets the sample mode of the ICM90248 module
Returns: Returns true if the sample mode setting write was successful, otherwise False. Return type: bool
-
sleep(on)[source]¶ Sets the ICM20948 module in or out of sleep mode
Returns: Returns true if the sleep setting write was successful, otherwise False. Return type: bool