<!DOCTYPE module SYSTEM "module.dtd">

<module name="sonar">
  <doc>
    <description>
     Maxbotix Sonar.
     On Booz board, ADC_0 should be use by default (payload connector)
    </description>
    <configure name="ADC_SONAR" value="ADC_X" description="select ADC to use with the sonar"/>
  </doc>
  <header>
    <file name="sonar_maxbotix.h"/>
    <file name="ins.h" dir="subsystems"/>
  </header>
  <init fun="maxbotix_init()"/>
  <periodic fun="maxbotix_read()" freq="10"/>
  <event fun="SonarEvent(ins_update_sonar)"/>
  <makefile>
    <file name="sonar_maxbotix.c"/>
  </makefile>
  <makefile target="ap">
    <raw>
# set ADC_SONAR to ADC_0 as default
ifeq ($(ADC_SONAR),)
ADC_SONAR = ADC_0
endif
    </raw>
    <define name="ADC_CHANNEL_SONAR" value="$(ADC_SONAR)"/>
    <define name="USE_$(ADC_SONAR)"/>
    <define name="USE_SONAR"/>
  </makefile>

</module>
