hmc5843 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!
<module name="mag_hmc5843">
b'<configure name="HMC5843_I2C_DEV" value="i2cX" />\n '
</module>
Module configuration options
Configure Options
- name:
HMC5843_I2C_DEV
value: i2cX
Description: select which i2c peripheral to use (default i2c0)
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.
- hmc5843_module_periodic()
- Frequency in Hz: 60
- Autorun: LOCK
Periodic function automatically starts after init and can't be stopped.
Files
Header Files
The following headers are automatically included in modules.h
Source Files
Raw mag_hmc5843.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="mag_hmc5843" dir="sensors" task="sensors">
<doc>
<description>hmc5843 magnetometer</description>
<configure name="HMC5843_I2C_DEV" value="i2cX" description="select which i2c peripheral to use (default i2c0)"/>
</doc>
<dep>
<depends>i2c,@imu</depends>
<provides>mag</provides>
</dep>
<header>
<file name="mag_hmc5843.h"/>
</header>
<init fun="hmc5843_module_init()"/>
<periodic fun="hmc5843_module_periodic()" freq="60"/>
<event fun="hmc5843_module_event()"/>
<makefile>
<configure name="HMC5843_I2C_DEV" default="i2c0" case="upper|lower"/>
<define name="USE_$(HMC5843_I2C_DEV_UPPER)"/>
<define name="HMC5843_I2C_DEV" value="$(HMC5843_I2C_DEV_LOWER)"/>
<file name="mag_hmc5843.c"/>
<file name="hmc5843.c" dir="peripherals"/>
<define name="HMC5843_NO_IRQ"/>
<test>
<define name="HMC5843_I2C_DEV" value="i2c1"/>
<define name="USE_I2C1"/>
<define name="DOWNLINK_TRANSPORT" value="pprz_tp"/>
<define name="DOWNLINK_DEVICE" value="uart0"/>
<define name="USE_UART0"/>
<define name="HMC5843_NO_IRQ"/>
</test>
</makefile>
</module>