#ifndef ICM20645_H #define ICM20645_H #include #define ICM20645_ACCESS_BY_GSE_I2C #ifdef ICM20645_ACCESS_BY_GSE_I2C #define ICM20645_I2C_SLAVE_ADDR (0xD2) /* mtk i2c not allow to probe two same address */ #else #define ICM20645_I2C_SLAVE_ADDR 0xD0 #endif #define REG_USER_CTRL 0x03 #define REG_BANK_SEL 0x7F #define BANK_SEL_0 0x00 #define BANK_SEL_1 0x10 #define BANK_SEL_2 0x20 #define BANK_SEL_3 0x30 #define ICM20645_REG_LP_CONFIG 0x05 #define ICM20645_REG_PWR_CTL 0x06 #define ICM20645_REG_POWER_CTL2 0x07 #define BIT_PWR_GYRO_STBY 0x07 #define BIT_GYRO_LP_EN 0x10 #define BIT_LP_EN 0x20 #define BIT_CLK_PLL 0x01 /* ICM20645 Register Map (Please refer to ICM20645 Specifications) */ #define ICM20645_REG_DEVID 0x00 #define ICM20645_REG_SAMRT_DIV 0x00 #define ICM20645_REG_CFG 0x01 /*set external sync, full-scale range and sample rate, low pass filter bandwidth*/ #define SHIFT_GYRO_FS_SEL 1 /*full-scale range and sample rate*/ #define ICM20645_GYRO_CFG2 0x02 #define GYRO_AVGCFG_1X 0 #define GYRO_AVGCFG_2X 1 #define GYRO_AVGCFG_4X 2 #define GYRO_AVGCFG_8X 3 #define GYRO_AVGCFG_16X 4 #define GYRO_AVGCFG_32X 5 #define GYRO_AVGCFG_64X 6 #define GYRO_AVGCFG_128X 7 #define ICM20645_REG_GYRO_XH 0x33 #define GYRO_FS_SEL (0x02<