Module XML file: temp_temod.xml
No detailed description...
Example for airframe file
This example contains all possible configuration options, not all of them are mandatory!
2 <load name="temp_temod.xml">
3 <define name="TEMOD_TYPE" value="type" />
4 <configure name="TEMOD_I2C_DEV" value="i2cX" />
Module configuration options
Configure Options
- name:
TEMOD_I2C_DEV
value: i2cX
Description: select i2c peripheral to use (default i2c0)
Define Options
- name:
TEMOD_TYPE
value: type
Description: device type (default TEMOD_I2C_R1)
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.
- temod_periodic()
- Frequency in Hz: 8
- 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 temp_temod.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="temp_temod" dir="meteo">
<doc>
<description>Hygrosens TEMOD-I2C-Rx temperature sensor</description>
<configure name="TEMOD_I2C_DEV" value="i2cX" description="select i2c peripheral to use (default i2c0)"/>
<define name="TEMOD_TYPE" value="type" description="device type (default TEMOD_I2C_R1)"/>
</doc>
<header>
<file name="temp_temod.h"/>
</header>
<init fun="temod_init()"/>
<periodic fun="temod_periodic()" freq="8"/>
<event fun="temod_event()"/>
<makefile target="ap">
<raw>
TEMOD_I2C_DEV ?= i2c0
TEMOD_I2C_DEV_LOWER=$(shell echo $(TEMOD_I2C_DEV) | tr A-Z a-z)
TEMOD_I2C_DEV_UPPER=$(shell echo $(TEMOD_I2C_DEV) | tr a-z A-Z)
</raw>
<define name="USE_$(TEMOD_I2C_DEV_UPPER)"/>
<define name="TEMOD_I2C_DEV" value="$(TEMOD_I2C_DEV_LOWER)"/>
<file name="temp_temod.c"/>
</makefile>
</module>