APM:Libraries
|
#include <AnalogIn.h>
Public Member Functions | |
AnalogSource (uint8_t pin) | |
float | read_average () |
float | read_latest () |
void | set_pin (uint8_t p) |
void | set_stop_pin (uint8_t pin) |
void | set_settle_time (uint16_t settle_time_ms) |
float | voltage_average () |
float | voltage_latest () |
float | voltage_average_ratiometric () |
void | new_sample (uint16_t) |
void | setup_read () |
void | stop_read () |
bool | reading_settled () |
float | _read_average () |
int16_t | get_pin () |
Protected Member Functions | |
const adc_dev * | _find_device () const |
bool | initialized () |
Private Attributes | |
volatile uint32_t | _sum_count |
volatile uint32_t | _sum |
volatile uint16_t | _latest |
float | _last_average |
uint8_t | _pin |
uint8_t | _stop_pin |
uint16_t | _settle_time_ms |
uint32_t | _read_start_time_ms |
bool | _init_done |
Friends | |
class | F4Light::AnalogIn |
Definition at line 48 of file AnalogIn.h.
AnalogSource::AnalogSource | ( | uint8_t | pin | ) |
|
inlineprotected |
Definition at line 83 of file AnalogIn.h.
Referenced by F4Light::AnalogIn::_timer_event(), set_pin(), setup_read(), and stop_read().
float AnalogSource::_read_average | ( | ) |
Definition at line 115 of file AnalogSource.cpp.
Referenced by read_average(), and set_settle_time().
|
inline |
Definition at line 81 of file AnalogIn.h.
|
inlineprotected |
Definition at line 84 of file AnalogIn.h.
void AnalogSource::new_sample | ( | uint16_t | sample | ) |
Definition at line 187 of file AnalogSource.cpp.
Referenced by F4Light::AnalogIn::_timer_event(), and set_settle_time().
|
inlinevirtual |
Implements AP_HAL::AnalogSource.
Definition at line 53 of file AnalogIn.h.
Referenced by voltage_average_ratiometric().
|
inlinevirtual |
Implements AP_HAL::AnalogSource.
Definition at line 54 of file AnalogIn.h.
Referenced by voltage_latest().
bool AnalogSource::reading_settled | ( | ) |
Definition at line 178 of file AnalogSource.cpp.
Referenced by set_settle_time().
|
virtual |
Implements AP_HAL::AnalogSource.
Definition at line 86 of file AnalogSource.cpp.
Referenced by AnalogSource(), and read_latest().
|
inlinevirtual |
Implements AP_HAL::AnalogSource.
Definition at line 58 of file AnalogIn.h.
|
inlinevirtual |
Implements AP_HAL::AnalogSource.
Definition at line 57 of file AnalogIn.h.
void AnalogSource::setup_read | ( | ) |
Definition at line 132 of file AnalogSource.cpp.
Referenced by F4Light::AnalogIn::_timer_event(), and set_settle_time().
void AnalogSource::stop_read | ( | ) |
Definition at line 165 of file AnalogSource.cpp.
Referenced by F4Light::AnalogIn::_timer_event(), and set_settle_time().
|
virtual |
Implements AP_HAL::AnalogSource.
Definition at line 65 of file AnalogSource.cpp.
Referenced by set_settle_time().
|
virtual |
Implements AP_HAL::AnalogSource.
Definition at line 80 of file AnalogSource.cpp.
Referenced by set_settle_time(), and voltage_average().
|
virtual |
Implements AP_HAL::AnalogSource.
Definition at line 70 of file AnalogSource.cpp.
Referenced by set_settle_time().
|
friend |
Definition at line 50 of file AnalogIn.h.
|
private |
Definition at line 99 of file AnalogIn.h.
Referenced by initialized(), and set_pin().
|
private |
Definition at line 90 of file AnalogIn.h.
Referenced by _read_average(), and set_pin().
|
private |
Definition at line 89 of file AnalogIn.h.
Referenced by new_sample(), read_latest(), and set_pin().
|
private |
Definition at line 93 of file AnalogIn.h.
Referenced by get_pin(), set_pin(), setup_read(), and stop_read().
|
private |
Definition at line 98 of file AnalogIn.h.
Referenced by reading_settled(), and setup_read().
|
private |
Definition at line 97 of file AnalogIn.h.
Referenced by reading_settled(), set_settle_time(), and setup_read().
|
private |
Definition at line 96 of file AnalogIn.h.
Referenced by set_stop_pin(), setup_read(), and stop_read().
|
private |
Definition at line 88 of file AnalogIn.h.
Referenced by _read_average(), new_sample(), and set_pin().
|
private |
Definition at line 87 of file AnalogIn.h.
Referenced by _read_average(), new_sample(), and set_pin().