Baro MPL3115A2 (I2C)
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="baro_mpl3115">
b'<define name="BARO_MPL3115_I2C_DEV" value="i2cX" />\n '
b'<define name="BARO_MPL3115_I2C_SLAVE_ADDR" value="0xC0" />\n '
b'<define name="BARO_MPL3115_SENDER_ID" value="20" />\n '
b'<define name="SENSOR_SYNC_SEND" />\n '
</module>
Module configuration options
Define Options
- name:
BARO_MPL3115_I2C_DEV
value: i2cX
Description: select which i2c peripheral to use (default i2c0)
- name:
BARO_MPL3115_I2C_SLAVE_ADDR
value: 0xC0
Description: i2c address (default factory: 0xC0)
- name:
BARO_MPL3115_SENDER_ID
value: 20
Description: ABI sender id
- name:
SENSOR_SYNC_SEND
value: None
Description: flag to enable sending BARO_MPL3115 message on every new measurement
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 baro_mpl3115.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="baro_mpl3115" dir="sensors" task="sensors">
<doc>
<description>Baro MPL3115A2 (I2C)</description>
<define name="BARO_MPL3115_I2C_DEV" value="i2cX" description="select which i2c peripheral to use (default i2c0)"/>
<define name="BARO_MPL3115_I2C_SLAVE_ADDR" value="0xC0" description="i2c address (default factory: 0xC0)"/>
<define name="BARO_MPL3115_SENDER_ID" value="20" description="ABI sender id"/>
<define name="SENSOR_SYNC_SEND" description="flag to enable sending BARO_MPL3115 message on every new measurement"/>
</doc>
<dep>
<depends>i2c</depends>
<provides>baro</provides>
</dep>
<header>
<file name="baro_mpl3115.h"/>
</header>
<init fun="baro_mpl3115_init()"/>
<periodic fun="baro_mpl3115_read_periodic()" freq="5."/>
<event fun="baro_mpl3115_read_event()"/>
<makefile target="ap">
<file name="baro_mpl3115.c"/>
<file name="mpl3115.c" dir="peripherals"/>
</makefile>
</module>