Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
HMC58xx magnetometer

Module XML file: mag_hmc58xx.xml

Module for standalone operation/logging of a HMC58xx magnetometer.

Example for airframe file

This example contains all possible configuration options, not all of them are mandatory!

1 <modules>
2  <load name="mag_hmc58xx.xml">
3  <define name="MODULE_HMC58XX_SYNC_SEND" value="TRUE|FALSE" />
4  <define name="MODULE_HMC58XX_UPDATE_AHRS" value="TRUE|FALSE" />
5  <configure name="MAG_HMC58XX_I2C_DEV" value="i2c1" />
6  </load>
7 </modules>

Module configuration options

Configure Options

  • name: MAG_HMC58XX_I2C_DEV value: i2c1
    Description: I2C device to use (e.g. i2c1)

Define Options

    Description: Send IMU_RAW message with each new measurement (default: FALSE)
    Description: Copy measurements to imu and send as ABI message (default: FALSE)

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.


Header Files

The following headers are automatically included in modules.h

Source Files

Raw mag_hmc58xx.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="sensors">
HMC58xx magnetometer.
Module for standalone operation/logging of a HMC58xx magnetometer.
<configure name="MAG_HMC58XX_I2C_DEV" value="i2c1" description="I2C device to use (e.g. i2c1)"/>
<define name="MODULE_HMC58XX_SYNC_SEND" value="TRUE|FALSE" description="Send IMU_RAW message with each new measurement (default: FALSE)"/>
<define name="MODULE_HMC58XX_UPDATE_AHRS" value="TRUE|FALSE" description="Copy measurements to imu and send as ABI message (default: FALSE)"/>
<file name="mag_hmc58xx.h"/>
<init fun="mag_hmc58xx_module_init()"/>
<periodic fun="mag_hmc58xx_module_periodic()" freq="60"/>
<periodic fun="mag_hmc58xx_report()" freq="10" autorun="FALSE"/>
<event fun="mag_hmc58xx_module_event()"/>
<makefile target="ap">
<file name="mag_hmc58xx.c"/>
<file name="hmc58xx.c" dir="peripherals"/>
ifeq ($(MAG_HMC58XX_I2C_DEV),)
$(error mag_hmc58xx module error: please configure MAG_HMC58XX_I2C_DEV)
MAG_HMC58XX_I2C_DEV_UPPER=$(shell echo $(MAG_HMC58XX_I2C_DEV) | tr a-z A-Z)
MAG_HMC58XX_I2C_DEV_LOWER=$(shell echo $(MAG_HMC58XX_I2C_DEV) | tr A-Z a-z)
<define name="USE_$(MAG_HMC58XX_I2C_DEV_UPPER)"/>
<define name="MAG_HMC58XX_I2C_DEV" value="$(MAG_HMC58XX_I2C_DEV_LOWER)"/>