2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
23 #include "drivers/bus.h"
25 #define ICM20649_BIT_RESET (0x80)
27 #define ICM20649_RA_REG_BANK_SEL 0x7F
30 #define ICM20649_RA_WHO_AM_I 0x00
31 #define ICM20649_RA_PWR_MGMT_1 0x06
32 #define ICM20649_RA_PWR_MGMT_2 0x07
33 #define ICM20649_RA_INT_PIN_CFG 0x0F
34 #define ICM20649_RA_INT_ENABLE_1 0x11
35 #define ICM20649_RA_GYRO_XOUT_H 0x33
36 #define ICM20649_RA_ACCEL_XOUT_H 0x2D
39 #define ICM20649_RA_GYRO_SMPLRT_DIV 0x00
40 #define ICM20649_RA_GYRO_CONFIG_1 0x01
41 #define ICM20649_RA_ACCEL_CONFIG 0x14
43 enum icm20649_gyro_fsr_e
{
44 ICM20649_FSR_500DPS
= 0,
51 enum icm20649_accel_fsr_e
{
56 NUM_ICM20649_ACCEL_FSR
59 void icm20649AccInit(accDev_t
*acc
);
60 void icm20649GyroInit(gyroDev_t
*gyro
);
62 uint8_t icm20649SpiDetect(const extDevice_t
*dev
);
64 bool icm20649SpiAccDetect(accDev_t
*acc
);
65 bool icm20649SpiGyroDetect(gyroDev_t
*gyro
);
67 bool icm20649GyroReadSPI(gyroDev_t
*gyro
);
68 bool icm20649AccRead(accDev_t
*acc
);