Consists of two (internal) IMU's and one internal magneto. Also an optional external magneto. L3GD20 + LSM303D
Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!
These initialization functions are called once on startup.
These event functions are called in each cycle of the module event loop.
These functions are called periodically at the specified frequency from the module periodic loop.
<!DOCTYPE module SYSTEM "module.dtd">
<module name="imu_px4fmu_v2.4" dir="imu" task="sensors">
<doc>
<description>
PX4 Pixhawk IMU via SPI.
Consists of two (internal) IMU's and one internal magneto. Also an optional external magneto.
L3GD20 + LSM303D
</description>
<configure name="IMU_PX4FMU_SPI_DEV" value="spi1" description="SPI device to use"/>
<configure name="IMU_L3G_SPI_SLAVE_IDX" value="SPI_SLAVE0" description="slave select pin for the L3GD20"/>
<configure name="IMU_LSM_SPI_SLAVE_IDX" value="SPI_SLAVE1" description="slave select pin for the LSM303D"/>
<define name="IMU_PX4_DISABLE_MAG" value="FALSE" description="define to TRUE to disable the mag on the Pixhawk"/>
</doc>
<dep>
<depends>spi_master,i2c,imu_common</depends>
<provides>imu,mag</provides>
</dep>
<header>
<file name="imu_px4fmu_v2.4.h"/>
</header>
<init fun="imu_px4_init()"/>
<periodic fun="imu_px4_periodic()"/>
<event fun="imu_px4_event()"/>
<makefile target="!sim|nps|fbw">
<configure name="IMU_PX4FMU_SPI_DEV" default="spi1" case="lower|upper"/>
<define name="IMU_PX4FMU_SPI_DEV" value="$(IMU_PX4FMU_SPI_DEV_LOWER)"/>
<define name="USE_$(IMU_PX4FMU_SPI_DEV_UPPER)"/>
<configure name="IMU_L3G_SPI_SLAVE_IDX" default="SPI_SLAVE0"/>
<define name="USE_$(IMU_L3G_SPI_SLAVE_IDX)"/>
<define name="IMU_L3G_SPI_SLAVE_IDX" value="$(IMU_L3G_SPI_SLAVE_IDX)"/>
<configure name="IMU_LSM_SPI_SLAVE_IDX" default="SPI_SLAVE1"/>
<define name="USE_$(IMU_LSM_SPI_SLAVE_IDX)"/>
<define name="IMU_LSM_SPI_SLAVE_IDX" value="$(IMU_LSM_SPI_SLAVE_IDX)"/>
<file name="l3gd20_spi.c" dir="peripherals"/>
<file name="lsm303d_spi.c" dir="peripherals"/>
<file name="hmc58xx.c" dir="peripherals"/>
<file name="imu_px4fmu_v2.4.c"/>
<test>
<define name="IMU_PX4FMU_SPI_DEV" value="spi1"/>
<define name="IMU_L3G_SPI_SLAVE_IDX" value="SPI_SLAVE0"/>
<define name="IMU_LSM_SPI_SLAVE_IDX" value="SPI_SLAVE1"/>
<define name="SPI_MASTER"/>
<define name="USE_SPI1"/>
<define name="USE_SPI_SLAVE0"/>
<define name="USE_SPI_SLAVE1"/>
<define name="USE_I2C2"/>
<define name="PERIODIC_FREQUENCY" value="512"/>
<define name="IMU_PX4_PERIODIC_FREQ" value="512"/>
</test>
</makefile>
</module>