Paparazzi UAS  v6.0_unstable-91-g69c55a0-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
sonar_pwm.c File Reference
#include "modules/sonar/sonar_pwm.h"
#include "mcu_periph/pwm_input.h"
#include "subsystems/abi.h"
#include "filters/median_filter.h"
#include "subsystems/datalink/telemetry.h"
#include "pprzlink/messages.h"
#include "generated/airframe.h"
+ Include dependency graph for sonar_pwm.c:

Go to the source code of this file.

Macros

#define SONAR_OFFSET   0
 The input channel of the PWM based sensor. More...
 
#define SONAR_PWM_PERIOD   4096
 Default to a 12 bit PWM sensor. More...
 
#define SONAR_SCALE   SONAR_PWM_PERIOD
 Ranger scale or sensitivity as you wish. More...
 
#define SONAR_MEDIAN_SIZE   7
 The Median Filter strength. More...
 
#define SONAR_MIN_RANGE   0.15f
 The minimum range for the device to be able to measure. More...
 
#define SONAR_MAX_RANGE   7.0f
 The maximum range for the device to be able to measure. More...
 
#define SONAR_PWM_OFFSET   820
 Some sensor may need an initial PWM offset (823 usec in the case of an EZ1 sensor) More...
 
#define SENSOR_SYNC_SEND_SONAR   TRUE
 

Functions

void sonar_pwm_init (void)
 
void sonar_pwm_read (void)
 

Variables

struct SonarPwm sonar_pwm
 

Macro Definition Documentation

#define SENSOR_SYNC_SEND_SONAR   TRUE

Definition at line 103 of file sonar_pwm.c.

#define SONAR_MAX_RANGE   7.0f

The maximum range for the device to be able to measure.

Definition at line 93 of file sonar_pwm.c.

Referenced by sonar_pwm_read().

#define SONAR_MEDIAN_SIZE   7

The Median Filter strength.

Definition at line 83 of file sonar_pwm.c.

Referenced by sonar_pwm_init().

#define SONAR_MIN_RANGE   0.15f

The minimum range for the device to be able to measure.

Definition at line 88 of file sonar_pwm.c.

Referenced by sonar_pwm_read().

#define SONAR_OFFSET   0

The input channel of the PWM based sensor.

Ranger offset value for what considered the distance should be zero

Definition at line 68 of file sonar_pwm.c.

Referenced by sonar_pwm_init().

#define SONAR_PWM_OFFSET   820

Some sensor may need an initial PWM offset (823 usec in the case of an EZ1 sensor)

Definition at line 98 of file sonar_pwm.c.

Referenced by sonar_pwm_read().

#define SONAR_PWM_PERIOD   4096

Default to a 12 bit PWM sensor.

Definition at line 73 of file sonar_pwm.c.

#define SONAR_SCALE   SONAR_PWM_PERIOD

Ranger scale or sensitivity as you wish.

Definition at line 78 of file sonar_pwm.c.

Referenced by sonar_pwm_init().

Function Documentation

void sonar_pwm_init ( void  )

Definition at line 109 of file sonar_pwm.c.

References init_median_filter_f(), SonarPwm::offset, SonarPwm::raw, SonarPwm::scale, sonar_filt, SONAR_MEDIAN_SIZE, SONAR_OFFSET, sonar_pwm, and SONAR_SCALE.

+ Here is the call graph for this function:

Variable Documentation

struct SonarPwm sonar_pwm

Definition at line 106 of file sonar_pwm.c.

Referenced by sonar_pwm_init(), and sonar_pwm_read().