2019-12-04 08:03:33 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "AP_BattMonitor_SMBus.h"
|
|
|
|
|
|
|
|
// Base SUI class
|
|
|
|
class AP_BattMonitor_SMBus_SUI : public AP_BattMonitor_SMBus
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Constructor
|
|
|
|
AP_BattMonitor_SMBus_SUI(AP_BattMonitor &mon,
|
|
|
|
AP_BattMonitor::BattMonitor_State &mon_state,
|
|
|
|
AP_BattMonitor_Params ¶ms,
|
|
|
|
uint8_t cell_count
|
|
|
|
);
|
|
|
|
|
|
|
|
void init(void) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void timer(void) override;
|
|
|
|
void read_cell_voltages();
|
|
|
|
void update_health();
|
|
|
|
|
2022-08-24 05:12:26 -03:00
|
|
|
// read_block_bare - returns number of characters read if successful, zero if unsuccessful
|
2019-12-04 08:03:33 -04:00
|
|
|
bool read_block_bare(uint8_t reg, uint8_t* data, uint8_t len) const;
|
|
|
|
|
|
|
|
const uint8_t cell_count;
|
|
|
|
bool phase_voltages;
|
|
|
|
uint32_t last_volt_read_us;
|
|
|
|
};
|