
IMU_UMARIM_CFLAGS  = -DUSE_IMU
IMU_UMARIM_CFLAGS += -DIMU_TYPE_H=\"boards/umarim/imu_umarim.h\"

IMU_UMARIM_SRCS    = $(SRC_SUBSYSTEMS)/imu.c             \
                     $(SRC_BOARD)/imu_umarim.c

IMU_UMARIM_I2C_DEV=i2c1
IMU_UMARIM_CFLAGS += -DUSE_I2C
IMU_UMARIM_CFLAGS += -DUSE_I2C1 -DI2C1_SCLL=25 -DI2C1_SCLH=25

IMU_UMARIM_CFLAGS += -DIMU_UMARIM_I2C_DEV=$(IMU_UMARIM_I2C_DEV)
IMU_UMARIM_SRCS += peripherals/itg3200.c
IMU_UMARIM_SRCS += peripherals/adxl345_i2c.c

# with default UMARIM_GYRO_SMPLRT_DIV (gyro output 50Hz)
# the AHRS_PROPAGATE_FREQUENCY needs to be adjusted accordingly
AHRS_PROPAGATE_FREQUENCY ?= 50
AHRS_CORRECT_FREQUENCY ?= 50
ap.CFLAGS += -DAHRS_PROPAGATE_FREQUENCY=$(AHRS_PROPAGATE_FREQUENCY)
ap.CFLAGS += -DAHRS_CORRECT_FREQUENCY=$(AHRS_CORRECT_FREQUENCY)

ap.CFLAGS += $(IMU_UMARIM_CFLAGS)
ap.srcs   += $(IMU_UMARIM_SRCS)

