<!DOCTYPE module SYSTEM "module.dtd">

<module name="imu_b2_v1.2" dir="imu">
  <doc>
    <description>
      Booz2 IMU v1.2
    </description>
    <section name="IMU" prefix="IMU_">
      <define name="GYRO_X_NEUTRAL" value="33924"/>
      <define name="GYRO_Y_NEUTRAL" value="33417"/>
      <define name="GYRO_Z_NEUTRAL" value="32809"/>

      <define name="GYRO_X_SENS" value="1.01" integer="16"/>
      <define name="GYRO_Y_SENS" value="1.01" integer="16"/>
      <define name="GYRO_Z_SENS" value="1.01" integer="16"/>

      <define name="ACCEL_X_NEUTRAL" value="32081"/>
      <define name="ACCEL_Y_NEUTRAL" value="33738"/>
      <define name="ACCEL_Z_NEUTRAL" value="32441"/>

      <define name="ACCEL_X_SENS" value="2.50411474" integer="16"/>
      <define name="ACCEL_Y_SENS" value="2.48126183" integer="16"/>
      <define name="ACCEL_Z_SENS" value="2.51396167" integer="16"/>

      <define name="MAG_X_NEUTRAL" value="2358"/>
      <define name="MAG_Y_NEUTRAL" value="2362"/>
      <define name="MAG_Z_NEUTRAL" value="2119"/>

      <define name="MAG_X_SENS" value="3.4936416" integer="16"/>
      <define name="MAG_Y_SENS" value="3.607713" integer="16"/>
      <define name="MAG_Z_SENS" value="4.90788848" integer="16"/>
      <define name="MAG_45_HACK" value="1"/>
    </section>
  </doc>
  <autoload name="imu_b2_common"/>
  <header>
    <file name="imu_b2.h" dir="subsystems/imu"/>
  </header>

  <makefile target="!sim|nps|fbw">
    <define name="IMU_B2_VERSION_1_2"/>
    <define name="IMU_B2_MAG_TYPE" value="IMU_B2_MAG_HMC58XX"/>
    <file name="hmc58xx.c" dir="peripherals"/>
    <raw>
ifeq ($(ARCH), lpc21)
$(TARGET).CFLAGS += -DIMU_B2_I2C_DEV=i2c1 -DUSE_I2C1
else ifeq ($(ARCH), stm32)
$(TARGET).CFLAGS += -DIMU_B2_I2C_DEV=i2c2 -DUSE_I2C2
endif
    </raw>
  </makefile>
</module>
