Baro MS5611 (I2C)
Measurement Specialties MS5611-01BA pressure sensor (I2C)
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="baro_ms5611_i2c">
2 <define name="SENSOR_SYNC_SEND" />
3 <configure name="MS5611_I2C_DEV" value="i2cX" />
Module configuration options
Configure Options
- name:
MS5611_I2C_DEV
value: i2cX
Description: select i2c peripheral to use (default i2c0)
Define Options
- name:
SENSOR_SYNC_SEND
value: None
Description: flag to enable sending BARO_MS5611 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.
- baro_ms5611_read()
- Frequency in Hz: 4
- Autorun: LOCK
Periodic function automatically starts after init and can't be stopped.
- baro_ms5611_periodic_check()
- Frequency in Hz: 40
- 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 baro_ms5611_i2c.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="baro_ms5611_i2c" dir="sensors">
<doc>
<description>
Baro MS5611 (I2C)
Measurement Specialties MS5611-01BA pressure sensor (I2C)
</description>
<configure name="MS5611_I2C_DEV" value="i2cX" description="select i2c peripheral to use (default i2c0)"/>
<define name="SENSOR_SYNC_SEND" description="flag to enable sending BARO_MS5611 message on every new measurement"/>
</doc>
<header>
<file name="baro_ms5611_i2c.h"/>
</header>
<init fun="baro_ms5611_init()"/>
<periodic fun="baro_ms5611_read()" freq="4"/>
<periodic fun="baro_ms5611_periodic_check()" freq="40"/>
<event fun="baro_ms5611_event()"/>
<makefile target="ap">
<configure name="MS5611_I2C_DEV" default="i2c0" case="upper|lower"/>
<define name="USE_$(MS5611_I2C_DEV_UPPER)"/>
<define name="MS5611_I2C_DEV" value="$(MS5611_I2C_DEV_LOWER)"/>
<file name="baro_ms5611_i2c.c"/>
<file name="ms5611.c" dir="peripherals"/>
<file name="ms5611_i2c.c" dir="peripherals"/>
</makefile>
</module>