Module XML file: adc_generic.xml
No detailed description...
Example for airframe file
This example contains all possible configuration options, not all of them are mandatory!
2 <load name="adc_generic.xml">
3 <configure name="ADC_CHANNEL_GENERIC1" value="ADCX" />
4 <configure name="ADC_CHANNEL_GENERIC2" value="ADCX" />
Module configuration options
Configure Options
- name:
ADC_CHANNEL_GENERIC1
value: ADCX
Description: choose which ADC is used for input 1
- name:
ADC_CHANNEL_GENERIC2
value: ADCX
Description: choose which ADC is used for input 2
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.
- adc_generic_periodic()
- Frequency in Hz: 4
- 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 adc_generic.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="adc_generic" dir="adcs">
<doc>
<description>Generic ADC</description>
<configure name="ADC_CHANNEL_GENERIC1" value="ADCX" description="choose which ADC is used for input 1"/>
<configure name="ADC_CHANNEL_GENERIC2" value="ADCX" description="choose which ADC is used for input 2"/>
</doc>
<header>
<file name="adc_generic.h"/>
</header>
<init fun="adc_generic_init()"/>
<periodic fun="adc_generic_periodic()" freq="4"/>
<makefile target="ap">
<file name="adc_generic.c"/>
<raw>
ifneq ($(ADC_CHANNEL_GENERIC1),)
ap.CFLAGS += -DADC_CHANNEL_GENERIC1=$(ADC_CHANNEL_GENERIC1) -DUSE_$(ADC_CHANNEL_GENERIC1)
endif
ifneq ($(ADC_CHANNEL_GENERIC2),)
ap.CFLAGS += -DADC_CHANNEL_GENERIC2=$(ADC_CHANNEL_GENERIC2) -DUSE_$(ADC_CHANNEL_GENERIC2)
endif
</raw>
</makefile>
</module>