APM:Libraries
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
F4Light::AnalogSource Class Reference

#include <AnalogIn.h>

Inheritance diagram for F4Light::AnalogSource:
[legend]
Collaboration diagram for F4Light::AnalogSource:
[legend]

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
 

Detailed Description

Definition at line 48 of file AnalogIn.h.

Constructor & Destructor Documentation

◆ AnalogSource()

AnalogSource::AnalogSource ( uint8_t  pin)

Definition at line 46 of file AnalogSource.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ _find_device()

const adc_dev* F4Light::AnalogSource::_find_device ( ) const
inlineprotected

Definition at line 83 of file AnalogIn.h.

Referenced by F4Light::AnalogIn::_timer_event(), set_pin(), setup_read(), and stop_read().

Here is the caller graph for this function:

◆ _read_average()

float AnalogSource::_read_average ( )

Definition at line 115 of file AnalogSource.cpp.

Referenced by read_average(), and set_settle_time().

Here is the caller graph for this function:

◆ get_pin()

int16_t F4Light::AnalogSource::get_pin ( void  )
inline

Definition at line 81 of file AnalogIn.h.

◆ initialized()

bool F4Light::AnalogSource::initialized ( )
inlineprotected

Definition at line 84 of file AnalogIn.h.

◆ new_sample()

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().

Here is the caller graph for this function:

◆ read_average()

float F4Light::AnalogSource::read_average ( )
inlinevirtual

Implements AP_HAL::AnalogSource.

Definition at line 53 of file AnalogIn.h.

Referenced by voltage_average_ratiometric().

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

◆ read_latest()

float F4Light::AnalogSource::read_latest ( )
inlinevirtual

Implements AP_HAL::AnalogSource.

Definition at line 54 of file AnalogIn.h.

Referenced by voltage_latest().

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

◆ reading_settled()

bool AnalogSource::reading_settled ( )

Definition at line 178 of file AnalogSource.cpp.

Referenced by set_settle_time().

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

◆ set_pin()

void AnalogSource::set_pin ( uint8_t  p)
virtual

Implements AP_HAL::AnalogSource.

Definition at line 86 of file AnalogSource.cpp.

Referenced by AnalogSource(), and read_latest().

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

◆ set_settle_time()

void F4Light::AnalogSource::set_settle_time ( uint16_t  settle_time_ms)
inlinevirtual

Implements AP_HAL::AnalogSource.

Definition at line 58 of file AnalogIn.h.

Here is the call graph for this function:

◆ set_stop_pin()

void F4Light::AnalogSource::set_stop_pin ( uint8_t  pin)
inlinevirtual

Implements AP_HAL::AnalogSource.

Definition at line 57 of file AnalogIn.h.

◆ setup_read()

void AnalogSource::setup_read ( )

Definition at line 132 of file AnalogSource.cpp.

Referenced by F4Light::AnalogIn::_timer_event(), and set_settle_time().

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

◆ stop_read()

void AnalogSource::stop_read ( )

Definition at line 165 of file AnalogSource.cpp.

Referenced by F4Light::AnalogIn::_timer_event(), and set_settle_time().

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

◆ voltage_average()

float AnalogSource::voltage_average ( void  )
virtual

Implements AP_HAL::AnalogSource.

Definition at line 65 of file AnalogSource.cpp.

Referenced by set_settle_time().

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

◆ voltage_average_ratiometric()

float AnalogSource::voltage_average_ratiometric ( void  )
virtual

Implements AP_HAL::AnalogSource.

Definition at line 80 of file AnalogSource.cpp.

Referenced by set_settle_time(), and voltage_average().

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

◆ voltage_latest()

float AnalogSource::voltage_latest ( void  )
virtual

Implements AP_HAL::AnalogSource.

Definition at line 70 of file AnalogSource.cpp.

Referenced by set_settle_time().

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

Friends And Related Function Documentation

◆ F4Light::AnalogIn

friend class F4Light::AnalogIn
friend

Definition at line 50 of file AnalogIn.h.

Member Data Documentation

◆ _init_done

bool F4Light::AnalogSource::_init_done
private

Definition at line 99 of file AnalogIn.h.

Referenced by initialized(), and set_pin().

◆ _last_average

float F4Light::AnalogSource::_last_average
private

Definition at line 90 of file AnalogIn.h.

Referenced by _read_average(), and set_pin().

◆ _latest

volatile uint16_t F4Light::AnalogSource::_latest
private

Definition at line 89 of file AnalogIn.h.

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

◆ _pin

uint8_t F4Light::AnalogSource::_pin
private

Definition at line 93 of file AnalogIn.h.

Referenced by get_pin(), set_pin(), setup_read(), and stop_read().

◆ _read_start_time_ms

uint32_t F4Light::AnalogSource::_read_start_time_ms
private

Definition at line 98 of file AnalogIn.h.

Referenced by reading_settled(), and setup_read().

◆ _settle_time_ms

uint16_t F4Light::AnalogSource::_settle_time_ms
private

Definition at line 97 of file AnalogIn.h.

Referenced by reading_settled(), set_settle_time(), and setup_read().

◆ _stop_pin

uint8_t F4Light::AnalogSource::_stop_pin
private

Definition at line 96 of file AnalogIn.h.

Referenced by set_stop_pin(), setup_read(), and stop_read().

◆ _sum

volatile uint32_t F4Light::AnalogSource::_sum
private

Definition at line 88 of file AnalogIn.h.

Referenced by _read_average(), new_sample(), and set_pin().

◆ _sum_count

volatile uint32_t F4Light::AnalogSource::_sum_count
private

Definition at line 87 of file AnalogIn.h.

Referenced by _read_average(), new_sample(), and set_pin().


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