<!DOCTYPE module SYSTEM "module.dtd">

<module name="sonar">
  <doc>
    <description>
     Sonar ADC driver.
     Reads an anlog sonar sensor and outputs sonar distance in [m]
    </description>
    <configure name="ADC_SONAR" value="ADC_X" description="select ADC to use with the sonar"/>
    <define name="SONAR_OFFSET" value="0"  description="sensor offset in [adc] - default is 0"/>
    <define name="SONAR_SCALE" value="0.0166" description="sensor scale factor [m/adc] - default is 0.0166"/>
    <define name="USE_SONAR" value="" description="activate use of sonar in INS extended filter (only rotorcraft)"/>
  </doc>

  <header>
    <file name="sonar_adc.h"/>
  </header>

  <init fun="sonar_adc_init()"/>
  <periodic fun="sonar_adc_read()" freq="10"/>

  <makefile target="ap|sim">
    <file name="sonar_adc.c"/>
  </makefile>
  <makefile target="ap">
    <define name="ADC_CHANNEL_SONAR" value="$(ADC_SONAR)"/>
    <define name="USE_$(ADC_SONAR)"/>
  </makefile>

</module>
