Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
simple driver to deal with one sonar sensor on ADC More...
#include "std.h"
Go to the source code of this file.
Data Structures | |
struct | SonarAdc |
Functions | |
void | sonar_adc_init (void) |
void | sonar_adc_read (void) |
Read ADC value to update sonar measurement. More... | |
Variables | |
struct SonarAdc | sonar_adc |
simple driver to deal with one sonar sensor on ADC
Definition in file sonar_adc.h.
struct SonarAdc |
Definition at line 32 of file sonar_adc.h.
Data Fields | ||
---|---|---|
float | distance | Distance measured in meters. |
uint16_t | meas | Raw ADC value. |
uint16_t | offset | Sonar offset in ADC units. |
void sonar_adc_init | ( | void | ) |
Definition at line 56 of file sonar_adc.c.
References adc_buf_channel(), DEFAULT_AV_NB_SAMPLE, SonarAdc::meas, SonarAdc::offset, sonar_adc, sonar_adc_buf, and SONAR_OFFSET.
void sonar_adc_read | ( | void | ) |
Read ADC value to update sonar measurement.
Definition at line 68 of file sonar_adc.c.
References AGL_SONAR_ADC_ID, adc_buf::av_nb_sample, DefaultChannel, DefaultDevice, SonarAdc::distance, get_sys_time_usec(), SonarAdc::meas, SonarAdc::offset, sonar_adc, sonar_adc_buf, SONAR_SCALE, stateGetPositionEnu_f(), adc_buf::sum, and EnuCoor_f::z.
|
extern |
Definition at line 1 of file sonar_adc.c.
Referenced by sonar_adc_init(), sonar_adc_read(), and sonar_pwm_read().