Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
sonar_adc.h File Reference

simple driver to deal with one sonar sensor on ADC More...

#include "std.h"
+ Include dependency graph for sonar_adc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SonarEvent(_handler)
 

Functions

void sonar_adc_init (void)
 
void sonar_adc_read (void)
 Read ADC value to update sonar measurement. More...
 

Variables

uint16_t sonar_meas
 Raw ADC value. More...
 
bool_t sonar_data_available
 New data available. More...
 
float sonar_distance
 Sonar distance in m. More...
 

Detailed Description

simple driver to deal with one sonar sensor on ADC

Definition in file sonar_adc.h.

Macro Definition Documentation

#define SonarEvent (   _handler)
Value:
{ \
_handler(); \
} \
}
if(PrimarySpektrumState.SpektrumTimer)--PrimarySpektrumState.SpektrumTimer
#define FALSE
Definition: imu_chimu.h:141
bool_t sonar_data_available
New data available.
Definition: sonar_adc.c:53

Definition at line 47 of file sonar_adc.h.

Function Documentation

void sonar_adc_init ( void  )

Definition at line 62 of file sonar_adc.c.

References adc_buf_channel(), DEFAULT_AV_NB_SAMPLE, FALSE, sonar_adc, sonar_data_available, sonar_distance, sonar_meas, SONAR_OFFSET, sonar_offset, SONAR_SCALE, and sonar_scale.

+ Here is the call graph for this function:

void sonar_adc_read ( void  )

Read ADC value to update sonar measurement.

Definition at line 76 of file sonar_adc.c.

References adc_buf::av_nb_sample, DefaultChannel, DefaultDevice, sonar_adc, sonar_data_available, sonar_distance, sonar_meas, sonar_offset, sonar_scale, stateGetPositionEnu_f(), adc_buf::sum, TRUE, and EnuCoor_f::z.

+ Here is the call graph for this function:

Variable Documentation

bool_t sonar_data_available

New data available.

Definition at line 53 of file sonar_adc.c.

Referenced by sonar_adc_init(), and sonar_adc_read().

float sonar_distance

Sonar distance in m.

Definition at line 54 of file sonar_adc.c.

Referenced by sonar_adc_init(), and sonar_adc_read().

uint16_t sonar_meas

Raw ADC value.

Definition at line 52 of file sonar_adc.c.

Referenced by ins_update_baro(), ins_update_sonar(), sonar_adc_init(), and sonar_adc_read().