APM:Libraries
Public Member Functions | Protected Attributes | Private Attributes | List of all members
AP_BattMonitor_Backend Class Referenceabstract

#include <AP_BattMonitor_Backend.h>

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

Public Member Functions

 AP_BattMonitor_Backend (AP_BattMonitor &mon, AP_BattMonitor::BattMonitor_State &mon_state, AP_BattMonitor_Params &params)
 
virtual ~AP_BattMonitor_Backend (void)
 
virtual void init ()=0
 
virtual void read ()=0
 
virtual bool has_consumed_energy () const
 returns true if battery monitor instance provides consumed energy info More...
 
virtual bool has_current () const =0
 returns true if battery monitor instance provides current info More...
 
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_BattMonitor_mon
 
AP_BattMonitor::BattMonitor_State_state
 
AP_BattMonitor_Params_params
 

Private Attributes

uint32_t _resistance_timer_ms
 
float _voltage_filt
 
float _current_max_amps
 
float _current_filt_amps
 
float _resistance_voltage_ref
 
float _resistance_current_ref
 

Detailed Description

Definition at line 21 of file AP_BattMonitor_Backend.h.

Constructor & Destructor Documentation

◆ AP_BattMonitor_Backend()

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

Definition at line 25 of file AP_BattMonitor_Backend.cpp.

◆ ~AP_BattMonitor_Backend()

virtual AP_BattMonitor_Backend::~AP_BattMonitor_Backend ( void  )
inlinevirtual

Definition at line 29 of file AP_BattMonitor_Backend.h.

Here is the call graph for this function:

Member Function Documentation

◆ capacity_remaining_pct()

uint8_t AP_BattMonitor_Backend::capacity_remaining_pct ( ) const

capacity_remaining_pct - returns the % battery capacity remaining (0 ~ 100)

Definition at line 34 of file AP_BattMonitor_Backend.cpp.

Referenced by AP_BattMonitor::capacity_remaining_pct(), and has_cell_voltages().

Here is the caller graph for this function:

◆ handle_bi_msg()

virtual void AP_BattMonitor_Backend::handle_bi_msg ( float  voltage,
float  current,
float  temperature 
)
inlinevirtual

Reimplemented in AP_BattMonitor_UAVCAN.

Definition at line 53 of file AP_BattMonitor_Backend.h.

◆ has_cell_voltages()

virtual bool AP_BattMonitor_Backend::has_cell_voltages ( ) const
inlinevirtual

Reimplemented in AP_BattMonitor_SMBus.

Definition at line 44 of file AP_BattMonitor_Backend.h.

Referenced by AP_BattMonitor::has_cell_voltages().

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

◆ has_consumed_energy()

virtual bool AP_BattMonitor_Backend::has_consumed_energy ( ) const
inlinevirtual

returns true if battery monitor instance provides consumed energy info

Reimplemented in AP_BattMonitor_Analog.

Definition at line 38 of file AP_BattMonitor_Backend.h.

Referenced by AP_BattMonitor::has_consumed_energy().

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

◆ has_current()

virtual bool AP_BattMonitor_Backend::has_current ( ) const
pure virtual

returns true if battery monitor instance provides current info

Implemented in AP_BattMonitor_Analog, AP_BattMonitor_SMBus, AP_BattMonitor_Bebop, and AP_BattMonitor_UAVCAN.

Referenced by has_consumed_energy(), AP_BattMonitor::has_current(), and update_resistance_estimate().

Here is the caller graph for this function:

◆ init()

virtual void AP_BattMonitor_Backend::init ( )
pure virtual

Implemented in AP_BattMonitor_Analog, AP_BattMonitor_SMBus, AP_BattMonitor_Bebop, and AP_BattMonitor_UAVCAN.

Referenced by AP_BattMonitor::init(), and ~AP_BattMonitor_Backend().

Here is the caller graph for this function:

◆ read()

virtual void AP_BattMonitor_Backend::read ( )
pure virtual

Implemented in AP_BattMonitor_Analog, AP_BattMonitor_SMBus, AP_BattMonitor_Bebop, and AP_BattMonitor_UAVCAN.

Referenced by AP_BattMonitor::read(), and ~AP_BattMonitor_Backend().

Here is the caller graph for this function:

◆ update_resistance_estimate()

void AP_BattMonitor_Backend::update_resistance_estimate ( )

Definition at line 48 of file AP_BattMonitor_Backend.cpp.

Referenced by has_cell_voltages(), and AP_BattMonitor::read().

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

Member Data Documentation

◆ _current_filt_amps

float AP_BattMonitor_Backend::_current_filt_amps
private

Definition at line 66 of file AP_BattMonitor_Backend.h.

Referenced by update_resistance_estimate().

◆ _current_max_amps

float AP_BattMonitor_Backend::_current_max_amps
private

Definition at line 65 of file AP_BattMonitor_Backend.h.

Referenced by update_resistance_estimate().

◆ _mon

AP_BattMonitor& AP_BattMonitor_Backend::_mon
protected

Definition at line 57 of file AP_BattMonitor_Backend.h.

◆ _params

AP_BattMonitor_Params& AP_BattMonitor_Backend::_params
protected

◆ _resistance_current_ref

float AP_BattMonitor_Backend::_resistance_current_ref
private

Definition at line 68 of file AP_BattMonitor_Backend.h.

Referenced by update_resistance_estimate().

◆ _resistance_timer_ms

uint32_t AP_BattMonitor_Backend::_resistance_timer_ms
private

Definition at line 63 of file AP_BattMonitor_Backend.h.

Referenced by update_resistance_estimate().

◆ _resistance_voltage_ref

float AP_BattMonitor_Backend::_resistance_voltage_ref
private

Definition at line 67 of file AP_BattMonitor_Backend.h.

Referenced by update_resistance_estimate().

◆ _state

AP_BattMonitor::BattMonitor_State& AP_BattMonitor_Backend::_state
protected

◆ _voltage_filt

float AP_BattMonitor_Backend::_voltage_filt
private

Definition at line 64 of file AP_BattMonitor_Backend.h.

Referenced by update_resistance_estimate().


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