Paparazzi UAS  v5.18.0_stable-1-g6993852-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
baro_bmp280_i2c module

Bosch-Sensortech BMP280xx pressure sensor

No detailed description...

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_bmp280_i2c">
2  <define name="BMP280_SLAVE_ADDR" value="BMP280_I2C_ADDR|BMP280_I2C_ADDR_ALT" />
3  <define name="BMP280_SYNC_SEND" />
4  <configure name="BMP280_I2C_DEV" value="i2cX" />
5 </module>

Module configuration options

Configure Options

  • name: BMP280_I2C_DEV value: i2cX
    Description: select which i2c peripheral to use (default i2c1)

Define Options

  • name: BMP280_SLAVE_ADDR value: BMP280_I2C_ADDR|BMP280_I2C_ADDR_ALT
    Description: i2c slave address (default BMP280_I2C_ADDR)
  • name: BMP280_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_bmp280_periodic()
    • Frequency in Hz: 50
    • 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_bmp280_i2c.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="baro_bmp280_i2c" dir="sensors">
<doc>
<description>
Bosch-Sensortech BMP280xx pressure sensor
</description>
<configure name="BMP280_I2C_DEV" value="i2cX" description="select which i2c peripheral to use (default i2c1)"/>
<define name="BMP280_SLAVE_ADDR" value="BMP280_I2C_ADDR|BMP280_I2C_ADDR_ALT" description="i2c slave address (default BMP280_I2C_ADDR)"/>
<define name="BMP280_SYNC_SEND" description="flag to transmit the data as it is acquired"/>
</doc>
<header>
<file name="baro_bmp280_i2c.h"/>
</header>
<init fun="baro_bmp280_init()"/>
<periodic fun="baro_bmp280_periodic()" freq="50"/>
<event fun="baro_bmp280_event()"/>
<makefile target="ap">
<configure name="BMP280_I2C_DEV" default="i2c1" case="upper|lower"/>
<define name="USE_$(BMP280_I2C_DEV_UPPER)"/>
<define name="BMP280_I2C_DEV" value="$(BMP280_I2C_DEV_LOWER)"/>
<file name="baro_bmp280_i2c.c"/>
<file name="bmp280_i2c.c" dir="peripherals"/>
</makefile>
</module>