<!DOCTYPE module SYSTEM "module.dtd">

<module name="rpm_sensor" dir="sensors">
  <doc>
    <description>RPM sensor based on time difference between pulses
      It uses an PWM input to measure the period between pulses.
    </description>
    <configure name="RPM_PWM_CHANNEL" value="PWM_INPUTX" description="Select PWM input channel for RPM sensor"/>
    <define name="RPM_PULSE_PER_RND" value="14" description="Amount of pulses per round"/>
    <define name="RPM_FILTER_TAU" value="0.3" description="1/cut-off-frequency = filter time"/>
  </doc>
  <depends>pwm_meas</depends>
  <header>
    <file name="rpm_sensor.h"/>
  </header>
  <init fun="rpm_sensor_init()"/>
  <periodic fun="rpm_sensor_periodic()" autorun="TRUE"/>
  <makefile>
    <file name="rpm_sensor.c"/>

    <configure name="RPM_PWM_CHANNEL" default="PWM_INPUT1"/>
    <define name="RPM_PWM_CHANNEL" value="$(RPM_PWM_CHANNEL)"/>
    <define name="$(RPM_PWM_CHANNEL)_TICKS_PER_USEC" value="1" />
    <define name="USE_$(RPM_PWM_CHANNEL)" value="PWM_PULSE_TYPE_ACTIVE_HIGH" />
  </makefile>
</module>

