General electrical interface
No detailed description...
Example for airframe file
Add to your firmware section:
<module name="electrical"/>
Module functions
Init Functions
These initialization functions are called once on startup.
Periodic Functions
These functions are called periodically at the specified frequency from the module periodic loop.
- electrical_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 electrical.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="electrical" dir="energy" task="core">
<doc>
<description>
General electrical interface
</description>
</doc>
<settings>
<dl_settings>
<dl_settings NAME="Electrical">
<dl_setting var="avg_reset" min="0" step="1" max="1" values="FALSE|TRUE" handler="avg_reset" module="modules/energy/electrical" type="fun"/>
</dl_settings>
</dl_settings>
</settings>
<dep>
<depends>adc</depends>
<provides>electrical</provides>
</dep>
<header>
<file name="electrical.h"/>
</header>
<init fun="electrical_init()"/>
<periodic fun="electrical_periodic()" freq="10"/>
<makefile target="fbw|sim|nps" firmware="fixedwing">
<file name="electrical.c"/>
<test firmware="fixedwing">
<define name="ELECTRICAL_PERIODIC_FREQ" value="10"/>
</test>
</makefile>
<makefile target="ap" firmware="fixedwing" cond="ifeq (,$(findstring $(SEPARATE_FBW),0 FALSE))">
<file name="electrical.c"/>
</makefile>
<makefile firmware="rotorcraft">
<file name="electrical.c"/>
</makefile>
<makefile firmware="rover">
<file name="electrical.c"/>
</makefile>
</module>