APM:Libraries
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
PX4::PX4AnalogSource Class Reference

#include <AnalogIn.h>

Inheritance diagram for PX4::PX4AnalogSource:
[legend]
Collaboration diagram for PX4::PX4AnalogSource:
[legend]

Public Member Functions

 PX4AnalogSource (int16_t pin, float initial_value)
 
float read_average ()
 
float read_latest ()
 
void set_pin (uint8_t p)
 
float voltage_average ()
 
float voltage_latest ()
 
float voltage_average_ratiometric ()
 
void set_stop_pin (uint8_t p)
 
void set_settle_time (uint16_t settle_time_ms)
 

Private Member Functions

void _add_value (float v, float vcc5V)
 
float _pin_scaler ()
 

Private Attributes

int16_t _pin
 
int16_t _stop_pin
 
uint16_t _settle_time_ms
 
float _value
 
float _value_ratiometric
 
float _latest_value
 
uint8_t _sum_count
 
float _sum_value
 
float _sum_ratiometric
 

Friends

class PX4::PX4AnalogIn
 

Detailed Description

Definition at line 20 of file AnalogIn.h.

Constructor & Destructor Documentation

◆ PX4AnalogSource()

PX4AnalogSource::PX4AnalogSource ( int16_t  pin,
float  initial_value 
)

Definition at line 71 of file AnalogIn.cpp.

Member Function Documentation

◆ _add_value()

void PX4AnalogSource::_add_value ( float  v,
float  vcc5V 
)
private

Definition at line 175 of file AnalogIn.cpp.

Referenced by PX4::PX4AnalogIn::_timer_tick().

Here is the caller graph for this function:

◆ _pin_scaler()

float PX4AnalogSource::_pin_scaler ( void  )
private

Definition at line 117 of file AnalogIn.cpp.

Referenced by voltage_average(), voltage_average_ratiometric(), and voltage_latest().

Here is the caller graph for this function:

◆ read_average()

float PX4AnalogSource::read_average ( )
virtual

Implements AP_HAL::AnalogSource.

Definition at line 94 of file AnalogIn.cpp.

Referenced by voltage_average().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_latest()

float PX4AnalogSource::read_latest ( )
virtual

Implements AP_HAL::AnalogSource.

Definition at line 109 of file AnalogIn.cpp.

Referenced by voltage_latest().

Here is the caller graph for this function:

◆ set_pin()

void PX4AnalogSource::set_pin ( uint8_t  p)
virtual

Implements AP_HAL::AnalogSource.

Definition at line 156 of file AnalogIn.cpp.

Here is the call graph for this function:

◆ set_settle_time()

void PX4::PX4AnalogSource::set_settle_time ( uint16_t  settle_time_ms)
inlinevirtual

Implements AP_HAL::AnalogSource.

Definition at line 33 of file AnalogIn.h.

◆ set_stop_pin()

void PX4AnalogSource::set_stop_pin ( uint8_t  p)
virtual

Implements AP_HAL::AnalogSource.

Definition at line 89 of file AnalogIn.cpp.

◆ voltage_average()

float PX4AnalogSource::voltage_average ( void  )
virtual

Implements AP_HAL::AnalogSource.

Definition at line 133 of file AnalogIn.cpp.

Referenced by voltage_average_ratiometric().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ voltage_average_ratiometric()

float PX4AnalogSource::voltage_average_ratiometric ( void  )
virtual

Implements AP_HAL::AnalogSource.

Definition at line 142 of file AnalogIn.cpp.

Here is the call graph for this function:

◆ voltage_latest()

float PX4AnalogSource::voltage_latest ( void  )
virtual

Implements AP_HAL::AnalogSource.

Definition at line 151 of file AnalogIn.cpp.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ PX4::PX4AnalogIn

friend class PX4::PX4AnalogIn
friend

Definition at line 22 of file AnalogIn.h.

Member Data Documentation

◆ _latest_value

float PX4::PX4AnalogSource::_latest_value
private

Definition at line 44 of file AnalogIn.h.

Referenced by _add_value(), read_latest(), and set_pin().

◆ _pin

int16_t PX4::PX4AnalogSource::_pin
private

Definition at line 37 of file AnalogIn.h.

Referenced by _pin_scaler(), PX4::PX4AnalogIn::_timer_tick(), PX4AnalogSource(), and set_pin().

◆ _settle_time_ms

uint16_t PX4::PX4AnalogSource::_settle_time_ms
private

Definition at line 39 of file AnalogIn.h.

Referenced by PX4::PX4AnalogIn::_timer_tick(), and set_settle_time().

◆ _stop_pin

int16_t PX4::PX4AnalogSource::_stop_pin
private

◆ _sum_count

uint8_t PX4::PX4AnalogSource::_sum_count
private

Definition at line 45 of file AnalogIn.h.

Referenced by _add_value(), read_average(), and set_pin().

◆ _sum_ratiometric

float PX4::PX4AnalogSource::_sum_ratiometric
private

Definition at line 47 of file AnalogIn.h.

Referenced by _add_value(), read_average(), and set_pin().

◆ _sum_value

float PX4::PX4AnalogSource::_sum_value
private

Definition at line 46 of file AnalogIn.h.

Referenced by _add_value(), read_average(), and set_pin().

◆ _value

float PX4::PX4AnalogSource::_value
private

Definition at line 42 of file AnalogIn.h.

Referenced by read_average(), and set_pin().

◆ _value_ratiometric

float PX4::PX4AnalogSource::_value_ratiometric
private

Definition at line 43 of file AnalogIn.h.

Referenced by read_average(), set_pin(), and voltage_average_ratiometric().


The documentation for this class was generated from the following files: