ST IST8310 magnetometer.
No detailed description...
Example for airframe file
Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!
1 <module name="mag_ist8310">
2 <define name="MODULE_IST8310_SYNC_SEND" value="TRUE|FALSE" />
3 <define name="MODULE_IST8310_UPDATE_AHRS" value="TRUE|FALSE" />
4 <define name="IST8310_CHAN_X_SIGN" value="+|-" />
5 <define name="IST8310_CHAN_Y_SIGN" value="+|-" />
6 <define name="IST8310_CHAN_Z_SIGN" value="+|-" />
7 <define name="IST8310_CHAN_X" value="0|1|2" />
8 <define name="IST8310_CHAN_Y" value="0|1|2" />
9 <define name="IST8310_CHAN_Z" value="0|1|2" />
10 <configure name="MAG_IST8310_I2C_DEV" value="i2cX" />
Module configuration options
Configure Options
- name:
MAG_IST8310_I2C_DEV
value: i2cX
Description: I2C device to use
Define Options
- name:
MODULE_IST8310_SYNC_SEND
value: TRUE|FALSE
Description: Send IMU_RAW message with each new measurement (default: FALSE)
- name:
MODULE_IST8310_UPDATE_AHRS
value: TRUE|FALSE
Description: Copy measurements to imu and send as ABI message (default: FALSE)
- name:
IST8310_CHAN_X_SIGN
value: +|-
Description: Reverse polarity of x axis (default: +)
- name:
IST8310_CHAN_Y_SIGN
value: +|-
Description: Reverse polarity of y axis (default: +)
- name:
IST8310_CHAN_Z_SIGN
value: +|-
Description: Reverse polarity of z axis (default: +)
- name:
IST8310_CHAN_X
value: 0|1|2
Description: Channel id of x axis (default: 0)
- name:
IST8310_CHAN_Y
value: 0|1|2
Description: Channel id of y axis (default: 1)
- name:
IST8310_CHAN_Z
value: 0|1|2
Description: Channel id of z axis (default: 2)
Airframe file section
- section name:
MAG_IST8310
prefix: IST8310_
- name
MAG_TO_IMU_PHI
value: 0.0
Description: Rotation between sensor frame and IMU frame (phi angle)
- name
MAG_TO_IMU_THETA
value: 0.0
Description: Rotation between sensor frame and IMU frame (theta angle)
- name
MAG_TO_IMU_PSI
value: 0.0
Description: Rotation between sensor frame and IMU frame (psi angle)
Module functions
Init Functions
These initialization functions are called once on startup.
Event Functions
These event functions are called in each cycle of the module event loop.
Periodic Functions
These functions are called periodically at the specified frequency from the module periodic loop.
Files
Header Files
The following headers are automatically included in modules.h
Source Files
Raw mag_ist8310.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="mag_ist8310" dir="sensors">
<doc>
<description>
ST IST8310 magnetometer.
</description>
<configure name="MAG_IST8310_I2C_DEV" value="i2cX" description="I2C device to use"/>
<define name="MODULE_IST8310_SYNC_SEND" value="TRUE|FALSE" description="Send IMU_RAW message with each new measurement (default: FALSE)"/>
<define name="MODULE_IST8310_UPDATE_AHRS" value="TRUE|FALSE" description="Copy measurements to imu and send as ABI message (default: FALSE)"/>
<define name="IST8310_CHAN_X_SIGN" value="+|-" description="Reverse polarity of x axis (default: +)"/>
<define name="IST8310_CHAN_Y_SIGN" value="+|-" description="Reverse polarity of y axis (default: +)"/>
<define name="IST8310_CHAN_Z_SIGN" value="+|-" description="Reverse polarity of z axis (default: +)"/>
<define name="IST8310_CHAN_X" value="0|1|2" description="Channel id of x axis (default: 0)"/>
<define name="IST8310_CHAN_Y" value="0|1|2" description="Channel id of y axis (default: 1)"/>
<define name="IST8310_CHAN_Z" value="0|1|2" description="Channel id of z axis (default: 2)"/>
<section name="MAG_IST8310" prefix="IST8310_">
<define name="MAG_TO_IMU_PHI" value="0.0" description="Rotation between sensor frame and IMU frame (phi angle)"/>
<define name="MAG_TO_IMU_THETA" value="0.0" description="Rotation between sensor frame and IMU frame (theta angle)"/>
<define name="MAG_TO_IMU_PSI" value="0.0" description="Rotation between sensor frame and IMU frame (psi angle)"/>
</section>
</doc>
<header>
<file name="mag_ist8310.h"/>
</header>
<init fun="mag_ist8310_module_init()"/>
<periodic fun="mag_ist8310_module_periodic()" freq="50"/>
<periodic fun="mag_ist8310_report()" freq="10" autorun="FALSE"/>
<event fun="mag_ist8310_module_event()"/>
<makefile target="ap">
<file name="mag_ist8310.c"/>
<file name="ist8310.c" dir="peripherals"/>
<raw>
ifeq ($(MAG_IST8310_I2C_DEV),)
$(error mag_ist8310 module error: please configure MAG_IST8310_I2C_DEV)
endif
</raw>
<configure name="MAG_IST8310_I2C_DEV" case="upper|lower"/>
<define name="USE_$(MAG_IST8310_I2C_DEV_UPPER)"/>
<define name="MAG_IST8310_I2C_DEV" value="$(MAG_IST8310_I2C_DEV_LOWER)"/>
</makefile>
</module>