APM:Libraries
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AP_BattMonitor_SMBus_Maxell Class Reference

#include <AP_BattMonitor_SMBus_Maxell.h>

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

Public Member Functions

 AP_BattMonitor_SMBus_Maxell (AP_BattMonitor &mon, AP_BattMonitor::BattMonitor_State &mon_state, AP_BattMonitor_Params &params, AP_HAL::OwnPtr< AP_HAL::I2CDevice > dev)
 
- Public Member Functions inherited from AP_BattMonitor_SMBus
 AP_BattMonitor_SMBus (AP_BattMonitor &mon, AP_BattMonitor::BattMonitor_State &mon_state, AP_BattMonitor_Params &params, AP_HAL::OwnPtr< AP_HAL::I2CDevice > dev)
 Constructor. More...
 
virtual ~AP_BattMonitor_SMBus ()
 
bool has_cell_voltages () const override
 
bool has_current () const override
 returns true if battery monitor instance 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_consumed_energy () const
 returns true if battery monitor instance provides consumed energy info More...
 
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)
 

Private Member Functions

void timer (void) override
 
bool check_pec_support ()
 
uint8_t read_block (uint8_t reg, uint8_t *data, bool append_zero) const
 

Private Attributes

uint8_t _pec_confirmed
 

Additional Inherited Members

- Public Types inherited from AP_BattMonitor_SMBus
enum  BATTMONITOR_SMBUS {
  BATTMONITOR_SMBUS_TEMP = 0x08, BATTMONITOR_SMBUS_VOLTAGE = 0x09, BATTMONITOR_SMBUS_CURRENT = 0x0A, BATTMONITOR_SMBUS_REMAINING_CAPACITY = 0x0F,
  BATTMONITOR_SMBUS_FULL_CHARGE_CAPACITY = 0x10, BATTMONITOR_SMBUS_SPECIFICATION_INFO = 0x1A, BATTMONITOR_SMBUS_SERIAL = 0x1C, BATTMONITOR_SMBUS_MANUFACTURE_NAME = 0x20,
  BATTMONITOR_SMBUS_MANUFACTURE_DATA = 0x23
}
 
- Protected Member Functions inherited from AP_BattMonitor_SMBus
void read (void) override
 read the battery_voltage and current, should be called at 10hz More...
 
bool read_full_charge_capacity (void)
 
bool read_remaining_capacity (void)
 
bool read_temp (void)
 
bool read_serial_number (void)
 
bool read_word (uint8_t reg, uint16_t &data) const
 
uint8_t get_PEC (const uint8_t i2c_addr, uint8_t cmd, bool reading, const uint8_t buff[], uint8_t len) const
 get_PEC - calculate packet error correction code of buffer More...
 
- Protected Attributes inherited from AP_BattMonitor_SMBus
AP_HAL::OwnPtr< AP_HAL::I2CDevice_dev
 
bool _pec_supported
 
int32_t _serial_number = -1
 
uint16_t _full_charge_capacity
 
bool _has_cell_voltages
 
- Protected Attributes inherited from AP_BattMonitor_Backend
AP_BattMonitor_mon
 
AP_BattMonitor::BattMonitor_State_state
 
AP_BattMonitor_Params_params
 

Detailed Description

Definition at line 9 of file AP_BattMonitor_SMBus_Maxell.h.

Constructor & Destructor Documentation

◆ AP_BattMonitor_SMBus_Maxell()

AP_BattMonitor_SMBus_Maxell::AP_BattMonitor_SMBus_Maxell ( AP_BattMonitor mon,
AP_BattMonitor::BattMonitor_State mon_state,
AP_BattMonitor_Params params,
AP_HAL::OwnPtr< AP_HAL::I2CDevice dev 
)

Definition at line 34 of file AP_BattMonitor_SMBus_Maxell.cpp.

Member Function Documentation

◆ check_pec_support()

bool AP_BattMonitor_SMBus_Maxell::check_pec_support ( )
private

Definition at line 136 of file AP_BattMonitor_SMBus_Maxell.cpp.

Referenced by timer().

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

◆ read_block()

uint8_t AP_BattMonitor_SMBus_Maxell::read_block ( uint8_t  reg,
uint8_t *  data,
bool  append_zero 
) const
private

Definition at line 91 of file AP_BattMonitor_SMBus_Maxell.cpp.

Referenced by check_pec_support().

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

◆ timer()

void AP_BattMonitor_SMBus_Maxell::timer ( void  )
overrideprivatevirtual

Implements AP_BattMonitor_SMBus.

Definition at line 41 of file AP_BattMonitor_SMBus_Maxell.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _pec_confirmed

uint8_t AP_BattMonitor_SMBus_Maxell::_pec_confirmed
private

Definition at line 30 of file AP_BattMonitor_SMBus_Maxell.h.

Referenced by check_pec_support().


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