Paparazzi UAS  v5.15_devel-112-g521f3cf
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
baro_ms5611_spi module

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!

1 <module name="baro_ms5611_spi">
2  <define name="SENSOR_SYNC_SEND" />
3  <configure name="MS5611_SPI_DEV" value="spiX" />
4  <configure name="MS5611_SLAVE_IDX" value="SPI_SLAVE0" />
5 </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">
<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>
<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"/>
<raw>
include $(CFG_SHARED)/spi_master.makefile
</raw>
<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>