Device support for ICM20948 IMU sensor. More...
Device support for ICM20948 IMU sensor.
#include <icm20948.h>
Classes | |
struct | Config |
struct | Icm20948Vect |
Public Types | |
enum | icm20948_accel_range_t { ICM20948_ACCEL_RANGE_2_G , ICM20948_ACCEL_RANGE_4_G , ICM20948_ACCEL_RANGE_8_G , ICM20948_ACCEL_RANGE_16_G } |
enum | icm20948_gyro_range_t { ICM20948_GYRO_RANGE_250_DPS , ICM20948_GYRO_RANGE_500_DPS , ICM20948_GYRO_RANGE_1000_DPS , ICM20948_GYRO_RANGE_2000_DPS } |
enum | ak09916_data_rate_t { AK09916_MAG_DATARATE_SHUTDOWN = 0x0 , AK09916_MAG_DATARATE_SINGLE = 0x1 , AK09916_MAG_DATARATE_10_HZ = 0x2 , AK09916_MAG_DATARATE_20_HZ = 0x4 , AK09916_MAG_DATARATE_50_HZ = 0x6 , AK09916_MAG_DATARATE_100_HZ = 0x8 } |
enum | Result { OK = 0 , ERR } |
Public Member Functions | |
Icm20948 () | |
~Icm20948 () | |
Result | Init (Config config) |
void | Reset () |
uint8_t | GetMagId () |
Result | SetupMag () |
uint8_t | ReadMagRegister (uint8_t mag_reg_addr) |
bool | WriteMagRegister (uint8_t mag_reg_addr, uint8_t value) |
void | ScaleValues () |
void | SetAccelRateDivisor (uint16_t new_accel_divisor) |
icm20948_accel_range_t | GetAccelRange () |
uint8_t | ReadAccelRange () |
void | WriteAccelRange (uint8_t new_accel_range) |
void | SetAccelRange (icm20948_accel_range_t new_accel_range) |
void | SetGyroRateDivisor (uint8_t new_gyro_divisor) |
icm20948_gyro_range_t | GetGyroRange () |
void | SetGyroRange (icm20948_gyro_range_t new_gyro_range) |
void | WriteGyroRange (uint8_t new_gyro_range) |
uint8_t | ReadGyroRange () |
ak09916_data_rate_t | GetMagDataRate () |
bool | SetMagDataRate (ak09916_data_rate_t rate) |
void | SetBank (uint8_t bank_number) |
uint8_t | ReadExternalRegister (uint8_t slv_addr, uint8_t reg_addr) |
bool | WriteExternalRegister (uint8_t slv_addr, uint8_t reg_addr, uint8_t value) |
uint8_t | AuxillaryRegisterTransaction (bool read, uint8_t slv_addr, uint8_t reg_addr, uint8_t value) |
void | Process () |
Icm20948Vect | GetAccelVect () |
Icm20948Vect | GetGyroVect () |
Icm20948Vect | GetMagVect () |
float | GetTemp () |
uint8_t | Read8 (uint8_t reg) |
void | Write8 (uint8_t reg, uint8_t value) |
void | Write16 (uint8_t reg, uint16_t value) |
void | ReadReg (uint8_t reg, uint8_t *buff, uint8_t size) |
uint8_t | ReadBits (uint8_t reg, uint8_t bits, uint8_t shift) |
void | WriteBits (uint8_t reg, uint8_t data, uint8_t bits, uint8_t shift) |
void | SetI2CBypass (bool bypass_i2c) |
Result | EnableI2CMaster (bool enable_i2c_master) |
Result | ConfigureI2CMaster (void) |
void | ResetI2CMaster (void) |
Result | AuxI2CBusSetupFailed (void) |
Result | GetTransportError () |
enum daisy::Icm20948::ak09916_data_rate_t |
Data rates/modes for the embedded AsahiKASEI AK09916 3-axis magnetometer
enum daisy::Icm20948::icm20948_accel_range_t |
enum daisy::Icm20948::icm20948_gyro_range_t |
enum daisy::Icm20948::Result |
|
inline |
|
inline |
|
inline |
|
inline |
Read / Write a single byte to a given register address for an I2C slave device on the auxiliary I2C bus
slv_addr | the 7-bit I2C address of the slave device |
reg_addr | the register address to write to |
value | the value to write |
|
inline |
Set the I2C clock rate for the auxillary I2C bus to 345.60kHz and disable repeated start
|
inline |
Enable or disable the I2C mastercontroller
enable_i2c_master | true: enable false: disable |
|
inline |
Get the accelerometer's measurement range.
icm20948_accel_range_t
).
|
inline |
|
inline |
Get the gyro's measurement range.
icm20948_gyro_range_t
).
|
inline |
|
inline |
Get the current magnetometer measurement rate
|
inline |
|
inline |
|
inline |
|
inline |
Get and reset the transport error flag
|
inline |
Initialize the Icm20948 device
config | Configuration settings |
|
inline |
Updates the measurement data for all sensors simultaneously
|
inline |
Reads an 8 bit value
reg | the register address to read from |
|
inline |
Get the accelerometer's measurement range.
icm20x_accel_range_t
).
|
inline |
|
inline |
Read a single byte from a given register address for an I2C slave device on the auxiliary I2C bus
slv_addr | the 7-bit I2C address of the slave device |
reg_addr | the register address to read from |
|
inline |
Get the gyro's measurement range.
icm20x_gyro_range_t
).
|
inline |
slv_addr | |
mag_reg_addr | |
num_finished_checks |
|
inline |
Read from a reg address a defined number of bytes
|
inline |
Reset the internal registers and restores the default settings
|
inline |
Reset the I2C master
|
inline |
|
inline |
Sets the accelerometer's measurement range.
new_accel_range | Measurement range to be set. Must be an icm20948_accel_range_t . |
|
inline |
Sets the accelerometer's data rate divisor.
new_accel_divisor | The accelerometer's data rate divisor (uint16_t ). This 12-bit value must be <= 4095 |
|
inline |
Sets register bank.
bank_number | The bank to set to active |
|
inline |
Sets the gyro's measurement range.
new_gyro_range | Measurement range to be set. Must be an icm20948_gyro_range_t . |
|
inline |
Sets the gyro's data rate divisor.
new_gyro_divisor | The gyro's data rate divisor (uint8_t ). |
|
inline |
Sets the bypass status of the I2C master bus support.
bypass_i2c | Set to true to bypass the internal I2C master circuitry, connecting the external I2C bus to the main I2C bus. Set to false to re-connect |
|
inline |
Set the magnetometer measurement rate
rate | The rate to set. |
|
inline |
|
inline |
Writes a 16 bit value MSB first
reg | the register address to write to |
value | the value to write to the register |
|
inline |
Writes an 8 bit value
reg | the register address to write to |
value | the value to write to the register |
|
inline |
Sets the accelerometer's measurement range.
new_accel_range | Measurement range to be set. Must be an icm20x_accel_range_t . |
|
inline |
|
inline |
Write a single byte to a given register address for an I2C slave device on the auxiliary I2C bus
slv_addr | the 7-bit I2C address of the slave device |
reg_addr | the register address to write to |
value | the value to write |
|
inline |
Sets the gyro's measurement range.
new_gyro_range | Measurement range to be set. Must be an icm20x_gyro_range_t . |
|
inline |