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

#include <AnalogIn_IIO.h>

Inheritance diagram for AnalogSource_IIO:
[legend]
Collaboration diagram for AnalogSource_IIO:
[legend]

Public Member Functions

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

Private Member Functions

void init_pins (void)
 
void select_pin (void)
 

Private Attributes

float _value
 
float _latest
 
float _sum_value
 
float _voltage_scaling
 
uint8_t _sum_count
 
int16_t _pin
 
int _pin_fd
 
int fd_analog_sources [IIO_ANALOG_IN_COUNT]
 

Static Private Attributes

static const char * analog_sources []
 

Friends

class AnalogIn_IIO
 

Detailed Description

Definition at line 27 of file AnalogIn_IIO.h.

Constructor & Destructor Documentation

◆ AnalogSource_IIO()

AnalogSource_IIO::AnalogSource_IIO ( int16_t  pin,
float  initial_value,
float  voltage_scaling 
)

Definition at line 18 of file AnalogIn_IIO.cpp.

Referenced by AnalogIn_IIO::channel().

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

Member Function Documentation

◆ init_pins()

void AnalogSource_IIO::init_pins ( void  )
private

Definition at line 30 of file AnalogIn_IIO.cpp.

Referenced by AnalogSource_IIO().

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

◆ read_average()

float AnalogSource_IIO::read_average ( )
virtual

Implements AP_HAL::AnalogSource.

Definition at line 50 of file AnalogIn_IIO.cpp.

Referenced by voltage_average().

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

◆ read_latest()

float AnalogSource_IIO::read_latest ( )
virtual

Implements AP_HAL::AnalogSource.

Definition at line 64 of file AnalogIn_IIO.cpp.

Referenced by read_average(), and voltage_latest().

Here is the caller graph for this function:

◆ select_pin()

void AnalogSource_IIO::select_pin ( void  )
private

Definition at line 45 of file AnalogIn_IIO.cpp.

Referenced by AnalogSource_IIO(), and set_pin().

Here is the caller graph for this function:

◆ set_pin()

void AnalogSource_IIO::set_pin ( uint8_t  p)
virtual

Implements AP_HAL::AnalogSource.

Definition at line 97 of file AnalogIn_IIO.cpp.

Here is the call graph for this function:

◆ set_settle_time()

void AnalogSource_IIO::set_settle_time ( uint16_t  settle_time_ms)
virtual

Implements AP_HAL::AnalogSource.

Definition at line 116 of file AnalogIn_IIO.cpp.

◆ set_stop_pin()

void AnalogSource_IIO::set_stop_pin ( uint8_t  p)
virtual

Implements AP_HAL::AnalogSource.

Definition at line 113 of file AnalogIn_IIO.cpp.

◆ voltage_average()

float AnalogSource_IIO::voltage_average ( void  )
virtual

Implements AP_HAL::AnalogSource.

Definition at line 86 of file AnalogIn_IIO.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 AnalogSource_IIO::voltage_average_ratiometric ( void  )
inlinevirtual

Implements AP_HAL::AnalogSource.

Definition at line 38 of file AnalogIn_IIO.h.

Here is the call graph for this function:

◆ voltage_latest()

float AnalogSource_IIO::voltage_latest ( void  )
virtual

Implements AP_HAL::AnalogSource.

Definition at line 91 of file AnalogIn_IIO.cpp.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ AnalogIn_IIO

friend class AnalogIn_IIO
friend

Definition at line 29 of file AnalogIn_IIO.h.

Member Data Documentation

◆ _latest

float AnalogSource_IIO::_latest
private

Definition at line 41 of file AnalogIn_IIO.h.

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

◆ _pin

int16_t AnalogSource_IIO::_pin
private

Definition at line 45 of file AnalogIn_IIO.h.

Referenced by select_pin(), and set_pin().

◆ _pin_fd

int AnalogSource_IIO::_pin_fd
private

Definition at line 46 of file AnalogIn_IIO.h.

Referenced by read_latest(), and select_pin().

◆ _sum_count

uint8_t AnalogSource_IIO::_sum_count
private

Definition at line 44 of file AnalogIn_IIO.h.

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

◆ _sum_value

float AnalogSource_IIO::_sum_value
private

Definition at line 42 of file AnalogIn_IIO.h.

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

◆ _value

float AnalogSource_IIO::_value
private

Definition at line 40 of file AnalogIn_IIO.h.

Referenced by read_average(), and set_pin().

◆ _voltage_scaling

float AnalogSource_IIO::_voltage_scaling
private

Definition at line 43 of file AnalogIn_IIO.h.

Referenced by read_latest().

◆ analog_sources

const char * AnalogSource_IIO::analog_sources
staticprivate
Initial value:
= {
"in_voltage0_raw",
"in_voltage1_raw",
"in_voltage2_raw",
"in_voltage3_raw",
"in_voltage4_raw",
"in_voltage5_raw",
"in_voltage6_raw",
"in_voltage7_raw",
}

Definition at line 52 of file AnalogIn_IIO.h.

Referenced by init_pins().

◆ fd_analog_sources

int AnalogSource_IIO::fd_analog_sources[IIO_ANALOG_IN_COUNT]
private

Definition at line 47 of file AnalogIn_IIO.h.

Referenced by init_pins(), and select_pin().


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