Module XML file: baro_bmp.xml
No detailed description...
Example for airframe file
This example contains all possible configuration options, not all of them are mandatory!
2 <load name="baro_bmp.xml">
3 <define name="SENSOR_SYNC_SEND" />
4 <configure name="BMP_I2C_DEV" value="i2cX" />
Module configuration options
Configure Options
- name:
BMP_I2C_DEV
value: i2cX
Description: select which i2c peripheral to use (default i2c0)
Define Options
- name:
SENSOR_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_bmp_periodic()
- Frequency in Hz: 15
- 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_bmp.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="baro_bmp" dir="sensors">
<doc>
<description>Bosch BMP085 pressure sensor</description>
<configure name="BMP_I2C_DEV" value="i2cX" description="select which i2c peripheral to use (default i2c0)"/>
<define name="SENSOR_SYNC_SEND" description="flag to transmit the data as it is acquired"/>
</doc>
<header>
<file name="baro_bmp.h"/>
</header>
<init fun="baro_bmp_init()"/>
<periodic fun="baro_bmp_periodic()" freq="15"/>
<event fun="baro_bmp_event()"/>
<makefile target="ap">
<raw>
BMP_I2C_DEV ?= i2c0
BMP_I2C_DEV_LOWER=$(shell echo $(BMP_I2C_DEV) | tr A-Z a-z)
BMP_I2C_DEV_UPPER=$(shell echo $(BMP_I2C_DEV) | tr a-z A-Z)
</raw>
<define name="USE_$(BMP_I2C_DEV_UPPER)"/>
<define name="BMP_I2C_DEV" value="$(BMP_I2C_DEV_LOWER)"/>
<file name="baro_bmp.c"/>
<file name="bmp085.c" dir="peripherals"/>
</makefile>
</module>