libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
icm20948.h File Reference

Go to the source code of this file.

Classes

class  daisy::Icm20948I2CTransport
 
struct  daisy::Icm20948I2CTransport::Config
 
class  daisy::Icm20948SpiTransport
 
struct  daisy::Icm20948SpiTransport::Config
 
class  daisy::Icm20948< Transport >
 Device support for ICM20948 IMU sensor. More...
 
struct  daisy::Icm20948< Transport >::Config
 
struct  daisy::Icm20948< Transport >::Icm20948Vect
 

Namespaces

namespace  daisy
 Hardware defines and helpers for daisy field platform.
 

Macros

#define DSY_ICM20948_H
 
#define I2C_MASTER_RESETS_BEFORE_FAIL    5
 The number of times to try resetting a stuck I2C master before giving up/*#end#*‍/.
 
#define NUM_FINISHED_CHECKS    100
 How many times to poll I2C_SLV4_DONE before giving up and resetting/*#end#*‍/.
 
#define ICM20X_B0_WHOAMI   0x00
 Chip ID register.
 
#define ICM20X_B0_USER_CTRL   0x03
 User Control Reg. Includes I2C Master.
 
#define ICM20X_B0_LP_CONFIG   0x05
 Low Power config.
 
#define ICM20X_B0_REG_INT_PIN_CFG   0xF
 Interrupt config register.
 
#define ICM20X_B0_REG_INT_ENABLE   0x10
 Interrupt enable register 0.
 
#define ICM20X_B0_REG_INT_ENABLE_1   0x11
 Interrupt enable register 1.
 
#define ICM20X_B0_I2C_MST_STATUS    0x17
 Records if I2C master bus data is finished/*#end#*‍/.
 
#define ICM20X_B0_REG_BANK_SEL   0x7F
 register bank selection register
 
#define ICM20X_B0_PWR_MGMT_1   0x06
 primary power management register
 
#define ICM20X_B0_ACCEL_XOUT_H   0x2D
 first byte of accel data
 
#define ICM20X_B0_GYRO_XOUT_H   0x33
 first byte of accel data
 
#define ICM20X_B2_GYRO_SMPLRT_DIV   0x00
 Gyroscope data rate divisor.
 
#define ICM20X_B2_GYRO_CONFIG_1   0x01
 Gyro config for range setting.
 
#define ICM20X_B2_ACCEL_SMPLRT_DIV_1   0x10
 Accel data rate divisor MSByte.
 
#define ICM20X_B2_ACCEL_SMPLRT_DIV_2   0x11
 Accel data rate divisor LSByte.
 
#define ICM20X_B2_ACCEL_CONFIG_1   0x14
 Accel config for setting range.
 
#define ICM20X_B3_I2C_MST_ODR_CONFIG   0x0
 Sets ODR for I2C master bus.
 
#define ICM20X_B3_I2C_MST_CTRL   0x1
 I2C master bus config.
 
#define ICM20X_B3_I2C_MST_DELAY_CTRL   0x2
 I2C master bus config.
 
#define ICM20X_B3_I2C_SLV0_ADDR    0x3
 Sets I2C address for I2C master bus slave 0/*#end#*‍/.
 
#define ICM20X_B3_I2C_SLV0_REG    0x4
 Sets register address for I2C master bus slave 0/*#end#*‍/.
 
#define ICM20X_B3_I2C_SLV0_CTRL   0x5
 Controls for I2C master bus slave 0.
 
#define ICM20X_B3_I2C_SLV0_DO   0x6
 Sets I2C master bus slave 0 data out.
 
#define ICM20X_B3_I2C_SLV4_ADDR    0x13
 Sets I2C address for I2C master bus slave 4/*#end#*‍/.
 
#define ICM20X_B3_I2C_SLV4_REG    0x14
 Sets register address for I2C master bus slave 4/*#end#*‍/.
 
#define ICM20X_B3_I2C_SLV4_CTRL   0x15
 Controls for I2C master bus slave 4.
 
#define ICM20X_B3_I2C_SLV4_DO   0x16
 Sets I2C master bus slave 4 data out.
 
#define ICM20X_B3_I2C_SLV4_DI   0x17
 Sets I2C master bus slave 4 data in.
 
#define ICM20948_CHIP_ID   0xEA
 ICM20948 default device id from WHOAMI.
 
#define ICM20948_I2CADDR_DEFAULT   0x69
 ICM20948 default i2c address.
 
#define ICM20948_MAG_ID   0x09
 The chip ID for the magnetometer.
 
#define ICM20948_UT_PER_LSB   0.15
 mag data LSB value (fixed)
 
#define AK09916_WIA2   0x01
 Magnetometer.
 
#define AK09916_ST1   0x10
 Magnetometer.
 
#define AK09916_HXL   0x11
 Magnetometer.
 
#define AK09916_HXH   0x12
 Magnetometer.
 
#define AK09916_HYL   0x13
 Magnetometer.
 
#define AK09916_HYH   0x14
 Magnetometer.
 
#define AK09916_HZL   0x15
 Magnetometer.
 
#define AK09916_HZH   0x16
 Magnetometer.
 
#define AK09916_ST2   0x18
 Magnetometer.
 
#define AK09916_CNTL2   0x31
 Magnetometer.
 
#define AK09916_CNTL3   0x32
 Magnetometer.
 
#define SENSORS_GRAVITY_EARTH   (9.80665F)
 
#define SENSORS_DPS_TO_RADS   (0.017453293F)
 

Typedefs

using daisy::Icm20948I2C = Icm20948< Icm20948I2CTransport >
 
using daisy::Icm20948Spi = Icm20948< Icm20948SpiTransport >
 

Macro Definition Documentation

◆ AK09916_CNTL2

#define AK09916_CNTL2   0x31

Magnetometer.

◆ AK09916_CNTL3

#define AK09916_CNTL3   0x32

Magnetometer.

◆ AK09916_HXH

#define AK09916_HXH   0x12

Magnetometer.

◆ AK09916_HXL

#define AK09916_HXL   0x11

Magnetometer.

◆ AK09916_HYH

#define AK09916_HYH   0x14

Magnetometer.

◆ AK09916_HYL

#define AK09916_HYL   0x13

Magnetometer.

◆ AK09916_HZH

#define AK09916_HZH   0x16

Magnetometer.

◆ AK09916_HZL

#define AK09916_HZL   0x15

Magnetometer.

◆ AK09916_ST1

#define AK09916_ST1   0x10

Magnetometer.

◆ AK09916_ST2

#define AK09916_ST2   0x18

Magnetometer.

◆ AK09916_WIA2

#define AK09916_WIA2   0x01

Magnetometer.

◆ DSY_ICM20948_H

#define DSY_ICM20948_H

◆ I2C_MASTER_RESETS_BEFORE_FAIL

#define I2C_MASTER_RESETS_BEFORE_FAIL    5

The number of times to try resetting a stuck I2C master before giving up/*#end#*‍/.

◆ ICM20948_CHIP_ID

#define ICM20948_CHIP_ID   0xEA

ICM20948 default device id from WHOAMI.

◆ ICM20948_I2CADDR_DEFAULT

#define ICM20948_I2CADDR_DEFAULT   0x69

ICM20948 default i2c address.

◆ ICM20948_MAG_ID

#define ICM20948_MAG_ID   0x09

The chip ID for the magnetometer.

◆ ICM20948_UT_PER_LSB

#define ICM20948_UT_PER_LSB   0.15

mag data LSB value (fixed)

◆ ICM20X_B0_ACCEL_XOUT_H

#define ICM20X_B0_ACCEL_XOUT_H   0x2D

first byte of accel data

◆ ICM20X_B0_GYRO_XOUT_H

#define ICM20X_B0_GYRO_XOUT_H   0x33

first byte of accel data

◆ ICM20X_B0_I2C_MST_STATUS

#define ICM20X_B0_I2C_MST_STATUS    0x17

Records if I2C master bus data is finished/*#end#*‍/.

◆ ICM20X_B0_LP_CONFIG

#define ICM20X_B0_LP_CONFIG   0x05

Low Power config.

◆ ICM20X_B0_PWR_MGMT_1

#define ICM20X_B0_PWR_MGMT_1   0x06

primary power management register

◆ ICM20X_B0_REG_BANK_SEL

#define ICM20X_B0_REG_BANK_SEL   0x7F

register bank selection register

◆ ICM20X_B0_REG_INT_ENABLE

#define ICM20X_B0_REG_INT_ENABLE   0x10

Interrupt enable register 0.

◆ ICM20X_B0_REG_INT_ENABLE_1

#define ICM20X_B0_REG_INT_ENABLE_1   0x11

Interrupt enable register 1.

◆ ICM20X_B0_REG_INT_PIN_CFG

#define ICM20X_B0_REG_INT_PIN_CFG   0xF

Interrupt config register.

◆ ICM20X_B0_USER_CTRL

#define ICM20X_B0_USER_CTRL   0x03

User Control Reg. Includes I2C Master.

◆ ICM20X_B0_WHOAMI

#define ICM20X_B0_WHOAMI   0x00

Chip ID register.

◆ ICM20X_B2_ACCEL_CONFIG_1

#define ICM20X_B2_ACCEL_CONFIG_1   0x14

Accel config for setting range.

◆ ICM20X_B2_ACCEL_SMPLRT_DIV_1

#define ICM20X_B2_ACCEL_SMPLRT_DIV_1   0x10

Accel data rate divisor MSByte.

◆ ICM20X_B2_ACCEL_SMPLRT_DIV_2

#define ICM20X_B2_ACCEL_SMPLRT_DIV_2   0x11

Accel data rate divisor LSByte.

◆ ICM20X_B2_GYRO_CONFIG_1

#define ICM20X_B2_GYRO_CONFIG_1   0x01

Gyro config for range setting.

◆ ICM20X_B2_GYRO_SMPLRT_DIV

#define ICM20X_B2_GYRO_SMPLRT_DIV   0x00

Gyroscope data rate divisor.

◆ ICM20X_B3_I2C_MST_CTRL

#define ICM20X_B3_I2C_MST_CTRL   0x1

I2C master bus config.

◆ ICM20X_B3_I2C_MST_DELAY_CTRL

#define ICM20X_B3_I2C_MST_DELAY_CTRL   0x2

I2C master bus config.

◆ ICM20X_B3_I2C_MST_ODR_CONFIG

#define ICM20X_B3_I2C_MST_ODR_CONFIG   0x0

Sets ODR for I2C master bus.

◆ ICM20X_B3_I2C_SLV0_ADDR

#define ICM20X_B3_I2C_SLV0_ADDR    0x3

Sets I2C address for I2C master bus slave 0/*#end#*‍/.

◆ ICM20X_B3_I2C_SLV0_CTRL

#define ICM20X_B3_I2C_SLV0_CTRL   0x5

Controls for I2C master bus slave 0.

◆ ICM20X_B3_I2C_SLV0_DO

#define ICM20X_B3_I2C_SLV0_DO   0x6

Sets I2C master bus slave 0 data out.

◆ ICM20X_B3_I2C_SLV0_REG

#define ICM20X_B3_I2C_SLV0_REG    0x4

Sets register address for I2C master bus slave 0/*#end#*‍/.

◆ ICM20X_B3_I2C_SLV4_ADDR

#define ICM20X_B3_I2C_SLV4_ADDR    0x13

Sets I2C address for I2C master bus slave 4/*#end#*‍/.

◆ ICM20X_B3_I2C_SLV4_CTRL

#define ICM20X_B3_I2C_SLV4_CTRL   0x15

Controls for I2C master bus slave 4.

◆ ICM20X_B3_I2C_SLV4_DI

#define ICM20X_B3_I2C_SLV4_DI   0x17

Sets I2C master bus slave 4 data in.

◆ ICM20X_B3_I2C_SLV4_DO

#define ICM20X_B3_I2C_SLV4_DO   0x16

Sets I2C master bus slave 4 data out.

◆ ICM20X_B3_I2C_SLV4_REG

#define ICM20X_B3_I2C_SLV4_REG    0x14

Sets register address for I2C master bus slave 4/*#end#*‍/.

◆ NUM_FINISHED_CHECKS

#define NUM_FINISHED_CHECKS    100

How many times to poll I2C_SLV4_DONE before giving up and resetting/*#end#*‍/.

◆ SENSORS_DPS_TO_RADS

#define SENSORS_DPS_TO_RADS   (0.017453293F)

◆ SENSORS_GRAVITY_EARTH

#define SENSORS_GRAVITY_EARTH   (9.80665F)