2016-02-17 21:25:15 -04:00
|
|
|
#pragma once
|
2014-11-22 02:04:04 -04:00
|
|
|
|
2015-08-11 03:28:42 -03:00
|
|
|
#include <AP_Common/AP_Common.h>
|
|
|
|
#include <AP_Param/AP_Param.h>
|
|
|
|
#include <AP_Math/AP_Math.h>
|
2014-11-22 02:04:04 -04:00
|
|
|
#include "AP_BattMonitor_Backend.h"
|
|
|
|
|
2015-03-18 08:07:49 -03:00
|
|
|
#define AP_BATTMONITOR_SMBUS_TIMEOUT_MICROS 5000000 // sensor becomes unhealthy if no successful readings for 5 seconds
|
2014-11-22 02:04:04 -04:00
|
|
|
|
|
|
|
class AP_BattMonitor_SMBus : public AP_BattMonitor_Backend
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
/// Constructor
|
|
|
|
AP_BattMonitor_SMBus(AP_BattMonitor &mon, uint8_t instance, AP_BattMonitor::BattMonitor_State &mon_state) :
|
|
|
|
AP_BattMonitor_Backend(mon, instance, mon_state)
|
|
|
|
{}
|
|
|
|
|
|
|
|
// virtual destructor to reduce compiler warnings
|
|
|
|
virtual ~AP_BattMonitor_SMBus() {}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
// include specific implementations
|
|
|
|
#include "AP_BattMonitor_SMBus_PX4.h"
|
|
|
|
#include "AP_BattMonitor_SMBus_I2C.h"
|