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 AMSYS (I2C)

Module XML file: baro_amsys.xml

Module to read a Amsys AMS 5812-0150-A barometric sensor via I2C.

Example for airframe file

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

1 <modules>
2  <load name="baro_amsys.xml">
3  <define name="BARO_AMSYS_MAX_PRESSURE" value="103400" />
4  <define name="BARO_AMSYS_SCALE" value="1" />
5  <define name="BARO_AMSYS_FILTER" value="0." />
6  <define name="BARO_AMSYS_SYNC_SEND" />
7  <configure name="BARO_AMSYS_I2C_DEV" value="i2cX" />
8  </load>
9 </modules>

Module configuration options

Configure Options

  • name: BARO_AMSYS_I2C_DEV value: i2cX
    Description: select which i2c peripheral to use (default i2c0)

Define Options

  • name: BARO_AMSYS_MAX_PRESSURE value: 103400
    Description: max sensor pressure (Pa) (default: 103400 for -0150)
  • name: BARO_AMSYS_SCALE value: 1
    Description: sensor scale factor (default: 1)
  • name: BARO_AMSYS_FILTER value: 0.
    Description: sensor filter (default: 0. max:1)
  • name: BARO_AMSYS_SYNC_SEND value: None
    Description: flag to transmit the data as it is acquired

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_amsys_read_periodic()
    • Frequency in Hz: 10.
    • 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_amsys.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="baro_amsys" dir="sensors">
<doc>
<description>
Baro AMSYS (I2C).
Module to read a Amsys AMS 5812-0150-A barometric sensor via I2C.
</description>
<configure name="BARO_AMSYS_I2C_DEV" value="i2cX" description="select which i2c peripheral to use (default i2c0)"/>
<define name="BARO_AMSYS_MAX_PRESSURE" value="103400" description="max sensor pressure (Pa) (default: 103400 for -0150)"/>
<define name="BARO_AMSYS_SCALE" value="1" description="sensor scale factor (default: 1)"/>
<define name="BARO_AMSYS_FILTER" value="0." description="sensor filter (default: 0. max:1)"/>
<define name="BARO_AMSYS_SYNC_SEND" description="flag to transmit the data as it is acquired"/>
</doc>
<settings>
<dl_settings>
<dl_settings NAME="AMSYS">
<dl_settings NAME="Baro">
<dl_setting MAX="1" MIN="0" STEP="0.001" VAR="baro_filter" shortname="baro_filter" module="modules/sensors/baro_amsys" param="BARO_FILTER"/>
</dl_settings>
</dl_settings>
</dl_settings>
</settings>
<header>
<file name="baro_amsys.h"/>
</header>
<init fun="baro_amsys_init()"/>
<periodic fun="baro_amsys_read_periodic()" freq="10."/>
<event fun="BaroAmsysEvent()"/>
<makefile target="ap">
<raw>
BARO_AMSYS_I2C_DEV ?= i2c0
BARO_AMSYS_I2C_DEV_LOWER=$(shell echo $(BARO_AMSYS_I2C_DEV) | tr A-Z a-z)
BARO_AMSYS_I2C_DEV_UPPER=$(shell echo $(BARO_AMSYS_I2C_DEV) | tr a-z A-Z)
</raw>
<define name="USE_$(BARO_AMSYS_I2C_DEV_UPPER)"/>
<define name="BARO_AMSYS_I2C_DEV" value="$(BARO_AMSYS_I2C_DEV_LOWER)"/>
<file name="baro_amsys.c"/>
</makefile>
</module>