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

Airspeed AMSYS (I2C)

Driver for a Amsys Differential Presure Sensor I2C (AMS 5812-0003-D) (AMS 5812-0001-D)

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="airspeed_amsys">
2  <define name="AIRSPEED_AMSYS_MAXPRESURE" value="2068" />
3  <define name="AIRSPEED_AMSYS_SCALE" value="1.0" />
4  <define name="AIRSPEED_AMSYS_FILTER" value="0." />
5  <define name="AIRSPEED_AMSYS_SYNC_SEND" />
6  <define name="USE_AIRSPEED_AMSYS" value="TRUE|FALSE" />
7  <configure name="AIRSPEED_AMSYS_I2C_DEV" value="i2c0" />
8 </module>

Module configuration options

Configure Options

  • name: AIRSPEED_AMSYS_I2C_DEV value: i2c0
    Description: change default i2c peripheral

Define Options

  • name: AIRSPEED_AMSYS_MAXPRESURE value: 2068
    Description: max sensor pressure (Pa) (default: 2068 for AMS 5812-0003-D)(for AMS 5812-0001-D use 1034)
  • name: AIRSPEED_AMSYS_SCALE value: 1.0
    Description: sensor scale factor (default: 1.0)
  • name: AIRSPEED_AMSYS_FILTER value: 0.
    Description: sensor filter (default: 0. max:1)
  • name: AIRSPEED_AMSYS_SYNC_SEND value: None
    Description: flag to transmit the data as it is acquired
  • name: USE_AIRSPEED_AMSYS value: TRUE|FALSE
    Description: set airspeed in state interface

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.

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw airspeed_amsys.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="airspeed_amsys" dir="sensors">
<doc>
<description>
Airspeed AMSYS (I2C)
Driver for a Amsys Differential Presure Sensor I2C
(AMS 5812-0003-D)
(AMS 5812-0001-D)
</description>
<configure name="AIRSPEED_AMSYS_I2C_DEV" value="i2c0" description="change default i2c peripheral"/>
<define name="AIRSPEED_AMSYS_MAXPRESURE" value="2068" description="max sensor pressure (Pa) (default: 2068 for AMS 5812-0003-D)(for AMS 5812-0001-D use 1034)"/>
<define name="AIRSPEED_AMSYS_SCALE" value="1.0" description="sensor scale factor (default: 1.0)"/>
<define name="AIRSPEED_AMSYS_FILTER" value="0." description="sensor filter (default: 0. max:1)"/>
<define name="AIRSPEED_AMSYS_SYNC_SEND" description="flag to transmit the data as it is acquired"/>
<define name="USE_AIRSPEED_AMSYS" value="TRUE|FALSE" description="set airspeed in state interface"/>
</doc>
<settings>
<dl_settings>
<dl_settings NAME="AMSYS">
<dl_settings NAME="Airspeed">
<dl_setting MAX="3" MIN="0" STEP="0.001" VAR="airspeed_scale" shortname="air_scale" module="modules/sensors/airspeed_amsys" param="AIRSPEED_SCALE"/>
<dl_setting MAX="1" MIN="0" STEP="0.001" VAR="airspeed_filter" shortname="air_filter" module="modules/sensors/airspeed_amsys" param="AIRSPEED_FILTER"/>
</dl_settings>
</dl_settings>
</dl_settings>
</settings>
<header>
<file name="airspeed_amsys.h"/>
</header>
<init fun="airspeed_amsys_init()"/>
<periodic fun="airspeed_amsys_read_periodic()" freq="60."/>
<event fun="AirspeedAmsysEvent()"/>
<makefile>
<configure name="AIRSPEED_AMSYS_I2C_DEV" default="i2c0" case="upper|lower"/>
<define name="USE_$(AIRSPEED_AMSYS_I2C_DEV_UPPER)"/>
<define name="AIRSPEED_AMSYS_I2C_DEV" value="$(AIRSPEED_AMSYS_I2C_DEV_LOWER)"/>
<file name="airspeed_amsys.c"/>
</makefile>
</module>