APM:Libraries
Public Member Functions | Protected Attributes | List of all members
AP_BattMonitor_Analog Class Reference

#include <AP_BattMonitor_Analog.h>

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

Public Member Functions

 AP_BattMonitor_Analog (AP_BattMonitor &mon, AP_BattMonitor::BattMonitor_State &mon_state, AP_BattMonitor_Params &params)
 Constructor. More...
 
void read ()
 Read the battery voltage and current. Should be called at 10hz. More...
 
bool has_consumed_energy () const override
 returns true if battery monitor provides consumed energy info More...
 
bool has_current () const override
 returns true if battery monitor provides current info More...
 
void init (void) override
 
- Public Member Functions inherited from AP_BattMonitor_Backend
 AP_BattMonitor_Backend (AP_BattMonitor &mon, AP_BattMonitor::BattMonitor_State &mon_state, AP_BattMonitor_Params &params)
 
virtual ~AP_BattMonitor_Backend (void)
 
virtual bool has_cell_voltages () const
 
uint8_t capacity_remaining_pct () const
 capacity_remaining_pct - returns the % battery capacity remaining (0 ~ 100) More...
 
void update_resistance_estimate ()
 
virtual void handle_bi_msg (float voltage, float current, float temperature)
 

Protected Attributes

AP_HAL::AnalogSource_volt_pin_analog_source
 
AP_HAL::AnalogSource_curr_pin_analog_source
 
- Protected Attributes inherited from AP_BattMonitor_Backend
AP_BattMonitor_mon
 
AP_BattMonitor::BattMonitor_State_state
 
AP_BattMonitor_Params_params
 

Detailed Description

Definition at line 114 of file AP_BattMonitor_Analog.h.

Constructor & Destructor Documentation

◆ AP_BattMonitor_Analog()

AP_BattMonitor_Analog::AP_BattMonitor_Analog ( AP_BattMonitor mon,
AP_BattMonitor::BattMonitor_State mon_state,
AP_BattMonitor_Params params 
)

Constructor.

Definition at line 10 of file AP_BattMonitor_Analog.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ has_consumed_energy()

bool AP_BattMonitor_Analog::has_consumed_energy ( ) const
inlineoverridevirtual

returns true if battery monitor provides consumed energy info

Reimplemented from AP_BattMonitor_Backend.

Definition at line 125 of file AP_BattMonitor_Analog.h.

Here is the call graph for this function:

◆ has_current()

bool AP_BattMonitor_Analog::has_current ( ) const
overridevirtual

returns true if battery monitor provides current info

return true if battery provides current info

Implements AP_BattMonitor_Backend.

Definition at line 58 of file AP_BattMonitor_Analog.cpp.

Referenced by has_consumed_energy(), and read().

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

◆ init()

void AP_BattMonitor_Analog::init ( void  )
inlineoverridevirtual

Implements AP_BattMonitor_Backend.

Definition at line 130 of file AP_BattMonitor_Analog.h.

◆ read()

void AP_BattMonitor_Analog::read ( void  )
virtual

Read the battery voltage and current. Should be called at 10hz.

Implements AP_BattMonitor_Backend.

Definition at line 24 of file AP_BattMonitor_Analog.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _curr_pin_analog_source

AP_HAL::AnalogSource* AP_BattMonitor_Analog::_curr_pin_analog_source
protected

Definition at line 135 of file AP_BattMonitor_Analog.h.

Referenced by AP_BattMonitor_Analog(), and read().

◆ _volt_pin_analog_source

AP_HAL::AnalogSource* AP_BattMonitor_Analog::_volt_pin_analog_source
protected

Definition at line 134 of file AP_BattMonitor_Analog.h.

Referenced by AP_BattMonitor_Analog(), and read().


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