Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
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

◆ SENSOR_SYNC_SEND_SONAR

#define SENSOR_SYNC_SEND_SONAR   TRUE

Definition at line 103 of file sonar_pwm.c.

◆ SONAR_MAX_RANGE

#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.

◆ SONAR_MEDIAN_SIZE

#define SONAR_MEDIAN_SIZE   7

The Median Filter strength.

Definition at line 83 of file sonar_pwm.c.

◆ SONAR_MIN_RANGE

#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.

◆ SONAR_OFFSET

#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.

◆ SONAR_PWM_OFFSET

#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.

◆ SONAR_PWM_PERIOD

#define SONAR_PWM_PERIOD   4096

Default to a 12 bit PWM sensor.

Definition at line 73 of file sonar_pwm.c.

◆ SONAR_SCALE

#define SONAR_SCALE   SONAR_PWM_PERIOD

Ranger scale or sensitivity as you wish.

Definition at line 78 of file sonar_pwm.c.

Function Documentation

◆ sonar_pwm_init()

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:

◆ sonar_pwm_read()

Variable Documentation

◆ sonar_pwm

struct SonarPwm sonar_pwm

Definition at line 106 of file sonar_pwm.c.

Referenced by sonar_pwm_init(), and sonar_pwm_read().