Paparazzi UAS  v5.8.2_stable-0-g6260b7c
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 XML file: baro_ms5611_spi.xml

Measurement Specialties MS5611-01BA pressure sensor (SPI)

Example for airframe file

This example contains all possible configuration options, not all of them are mandatory!

1 <modules>
2  <load name="baro_ms5611_spi.xml">
3  <define name="SENSOR_SYNC_SEND" />
4  <configure name="MS5611_SPI_DEV" value="spiX" />
5  <configure name="MS5611_SLAVE_IDX" value="SPI_SLAVE0" />
6  </load>
7 </modules>

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.


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">
Baro MS5611 (SPI)
Measurement Specialties MS5611-01BA pressure sensor (SPI)
<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"/>
<file name="baro_ms5611_spi.h"/>
<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">
MS5611_SPI_DEV ?= spi1
MS5611_SPI_DEV_LOWER=$(shell echo $(MS5611_SPI_DEV) | tr A-Z a-z)
MS5611_SPI_DEV_UPPER=$(shell echo $(MS5611_SPI_DEV) | tr a-z A-Z)
MS5611_SLAVE_IDX ?= spi_slave0
MS5611_SLAVE_IDX_LOWER=$(shell echo $(MS5611_SLAVE_IDX) | tr A-Z a-z)
MS5611_SLAVE_IDX_UPPER=$(shell echo $(MS5611_SLAVE_IDX) | tr a-z A-Z)
include $(CFG_SHARED)/spi_master.makefile
<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"/>