Baro MS5611 (SPI)
Measurement Specialties MS5611-01BA pressure sensor (SPI)
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_ms5611_spi">
b'<define name="SENSOR_SYNC_SEND" />\n '
b'<configure name="MS5611_SPI_DEV" value="spiX" />\n '
b'<configure name="MS5611_SLAVE_IDX" value="SPI_SLAVE0" />\n '
</module>
Module configuration options
Configure Options
- name:
MS5611_SPI_DEV
value: spiX
Description: select spi peripheral to use (default spi1)
- name:
MS5611_SLAVE_IDX
value: SPI_SLAVE0
Description: SPI slave select index
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_spi.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="baro_ms5611_spi" dir="sensors" task="sensors">
<doc>
<description>
Baro MS5611 (SPI)
Measurement Specialties MS5611-01BA pressure sensor (SPI)
</description>
<configure name="MS5611_SPI_DEV" value="spiX" description="select spi peripheral to use (default spi1)"/>
<configure name="MS5611_SLAVE_IDX" value="SPI_SLAVE0" description="SPI slave select index"/>
<define name="SENSOR_SYNC_SEND" description="flag to enable sending BARO_MS5611 message on every new measurement"/>
</doc>
<dep>
<depends>spi_master</depends>
<provides>baro</provides>
</dep>
<header>
<file name="baro_ms5611_spi.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_SPI_DEV" default="spi1" case="upper|lower"/>
<configure name="MS5611_SLAVE_IDX" default="spi_slave0" case="upper|lower"/>
<define name="USE_$(MS5611_SPI_DEV_UPPER)" />
<define name="USE_$(MS5611_SLAVE_IDX_UPPER)" />
<define name="MS5611_SPI_DEV" value="$(MS5611_SPI_DEV_LOWER)" />
<define name="MS5611_SLAVE_IDX" value="$(MS5611_SLAVE_IDX_UPPER)" />
<file name="baro_ms5611_spi.c"/>
<file name="ms5611.c" dir="peripherals"/>
<file name="ms5611_spi.c" dir="peripherals"/>
</makefile>
</module>