Skip to content

Commit

Permalink
add icm42605 in MatekH743 as substitution for icm20602
Browse files Browse the repository at this point in the history
  • Loading branch information
MATEKSYS committed Sep 4, 2021
1 parent 37ac80f commit 8e0c578
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/main/fc/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ groups:
- name: gyro_to_use
condition: USE_DUAL_GYRO
min: 0
max: 1
max: 2
default_value: 0
- name: gyro_abg_alpha
description: "Alpha factor for Gyro Alpha-Beta-Gamma filter"
Expand Down
5 changes: 3 additions & 2 deletions src/main/target/MATEKH743/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
#include "drivers/pinio.h"
#include "drivers/sensor.h"

BUSDEV_REGISTER_SPI_TAG(busdev_imu1_6000, DEVHW_MPU6000, IMU1_SPI_BUS, IMU1_CS_PIN, IMU1_EXTI_PIN, 0, DEVFLAGS_NONE, IMU1_ALIGN);
BUSDEV_REGISTER_SPI_TAG(busdev_imu2_6500, DEVHW_MPU6500, IMU2_SPI_BUS, IMU2_CS_PIN, IMU2_EXTI_PIN, 1, DEVFLAGS_NONE, IMU2_ALIGN);
BUSDEV_REGISTER_SPI_TAG(busdev_imu0, DEVHW_MPU6000, MPU6000_SPI_BUS, MPU6000_CS_PIN, MPU6000_EXTI_PIN, 0, DEVFLAGS_NONE, IMU_MPU6000_ALIGN);
BUSDEV_REGISTER_SPI_TAG(busdev_imu1, DEVHW_MPU6500, MPU6500_SPI_BUS, MPU6500_CS_PIN, MPU6500_EXTI_PIN, 1, DEVFLAGS_NONE, IMU_MPU6500_ALIGN);
BUSDEV_REGISTER_SPI_TAG(busdev_imu2, DEVHW_ICM42605, ICM42605_SPI_BUS, ICM42605_CS_PIN, ICM42605_EXTI_PIN, 2, DEVFLAGS_NONE, IMU_ICM42605_ALIGN);

const timerHardware_t timerHardware[] = {
DEF_TIM(TIM3, CH3, PB0, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 0), // S1
Expand Down
29 changes: 19 additions & 10 deletions src/main/target/MATEKH743/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#define USE_EXTI
#define USE_MPU_DATA_READY_SIGNAL

// *************** SPI1 IMU1 *************************
// *************** SPI1 IMU0 MPU6000 ****************
#define USE_SPI
#define USE_SPI_DEVICE_1
#define SPI1_SCK_PIN PA5
Expand All @@ -46,23 +46,32 @@

#define USE_IMU_MPU6000

#define IMU1_ALIGN CW0_DEG_FLIP
#define IMU1_SPI_BUS BUS_SPI1
#define IMU1_CS_PIN PC15
#define IMU1_EXTI_PIN PB2
#define IMU_MPU6000_ALIGN CW0_DEG_FLIP
#define MPU6000_SPI_BUS BUS_SPI1
#define MPU6000_CS_PIN PC15
#define MPU6000_EXTI_PIN PB2

// *************** SPI4 IMU2 *************************
// *************** SPI4 IMU1 ICM20602 **************
#define USE_SPI_DEVICE_4
#define SPI4_SCK_PIN PE12
#define SPI4_MISO_PIN PE13
#define SPI4_MOSI_PIN PE14

#define USE_IMU_MPU6500

#define IMU2_ALIGN CW0_DEG_FLIP
#define IMU2_SPI_BUS BUS_SPI4
#define IMU2_CS_PIN PE11
#define IMU2_EXTI_PIN PE15
#define IMU_MPU6500_ALIGN CW0_DEG_FLIP
#define MPU6500_SPI_BUS BUS_SPI4
#define MPU6500_CS_PIN PE11
#define MPU6500_EXTI_PIN PE15

// *************** SPI4 IMU2 ICM42605 **************
#define USE_IMU_ICM42605

#define IMU_ICM42605_ALIGN CW90_DEG_FLIP
#define ICM42605_SPI_BUS BUS_SPI4
#define ICM42605_CS_PIN PC13
#define ICM42605_EXTI_PIN PC14


// *************** SPI2 OSD ***********************
#define USE_SPI_DEVICE_2
Expand Down

0 comments on commit 8e0c578

Please sign in to comment.