From 67cf942d0484f60fcea024aad32e2a14e0dc8cc2 Mon Sep 17 00:00:00 2001 From: Tommy Vestermark Date: Sun, 12 Jul 2015 09:06:58 +0200 Subject: [PATCH] Add some documentation to pulse demodulators Hopefully this will help potential driver writers --- include/pulse_demod.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/pulse_demod.h b/include/pulse_demod.h index 98ae16d9..0e133123 100644 --- a/include/pulse_demod.h +++ b/include/pulse_demod.h @@ -25,6 +25,9 @@ /// The presence of a pulse is: /// - Presence of a pulse equals 1 /// - Absence of a pulse equals 0 +/// @param device->short_limit: Nominal width of pulse [samples] +/// @param device->long_limit: Nominal width of bit period [samples] +/// @param device->reset_limit: Maximum gap size before End Of Message [samples]. /// @return number of events processed int pulse_demod_pcm_rz(const pulse_data_t *pulses, struct protocol_state *device); @@ -36,6 +39,9 @@ int pulse_demod_pcm_rz(const pulse_data_t *pulses, struct protocol_state *device /// Gap between pulses determine the encoding: /// - Short gap will add a 0 bit /// - Long gap will add a 1 bit +/// @param device->short_limit: Threshold between short and long gap [samples] +/// @param device->long_limit: Maximum gap size before new row of bits [samples] +/// @param device->reset_limit: Maximum gap size before End Of Message [samples]. /// @return number of events processed int pulse_demod_ppm(const pulse_data_t *pulses, struct protocol_state *device); @@ -46,6 +52,9 @@ int pulse_demod_ppm(const pulse_data_t *pulses, struct protocol_state *device); /// Gap between pulses may be of fixed size or variable (e.g. fixed period) /// - Short pulse will add a 1 bit /// - Long pulse will add a 0 bit +/// @param device->short_limit: Threshold between short and long pulse [samples] +/// @param device->long_limit: Maximum gap size before new row of bits [samples] +/// @param device->reset_limit: Maximum gap size before End Of Message [samples]. /// @param device->demod_arg = 0: Do not remove any startbits /// @param device->demod_arg = 1: First bit in each message is considered a startbit and not stored in bitbuffer /// @return number of events processed @@ -57,6 +66,9 @@ int pulse_demod_pwm(const pulse_data_t *pulses, struct protocol_state *device); /// Demodulate a Pulse Width Modulation (PWM) signal consisting of short, middle and long high pulses. /// Gap between pulses may be of fixed size or variable (e.g. fixed period) /// The sync bit will add a new row to the bitbuffer +/// @param device->short_limit: Threshold between short and middle pulse [samples] +/// @param device->long_limit: Threshold between middle and long pulse [samples] +/// @param device->reset_limit: Maximum gap size before End Of Message [samples]. /// @param device->demod_arg = 0: Short pulse is sync, middle is 0, long is 1 /// @param device->demod_arg = 1: Short pulse is 0, middle is sync, long is 1 /// @param device->demod_arg = 2: Short pulse is 0, middle is 1, long is sync @@ -73,6 +85,9 @@ int pulse_demod_pwm_ternary(const pulse_data_t *pulses, struct protocol_state *d /// than 1.5 times the clock half period (short_width) it is declared a data edge where: /// - Rising edge means bit = 0 /// - Falling edge means bit = 1 +/// @param device->short_limit: Nominal width of clock half period [samples] +/// @param device->long_limit: Not used +/// @param device->reset_limit: Maximum gap size before End Of Message [samples]. /// @return number of events processed int pulse_demod_manchester_zerobit(const pulse_data_t *pulses, struct protocol_state *device);