Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/libraries/AP_BattMonitor/AP_BattMonitor_ESC.h
Views: 1798
/*1This program is free software: you can redistribute it and/or modify2it under the terms of the GNU General Public License as published by3the Free Software Foundation, either version 3 of the License, or4(at your option) any later version.56This program is distributed in the hope that it will be useful,7but WITHOUT ANY WARRANTY; without even the implied warranty of8MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9GNU General Public License for more details.1011You should have received a copy of the GNU General Public License12along with this program. If not, see <http://www.gnu.org/licenses/>.13*/14#pragma once1516#include <AP_Common/AP_Common.h>17#include <AP_HAL/AP_HAL.h>18#include <AP_ESC_Telem/AP_ESC_Telem.h>19#include "AP_BattMonitor_Backend.h"2021#if AP_BATTERY_ESC_ENABLED2223class AP_BattMonitor_ESC :public AP_BattMonitor_Backend24{25public:26// constructor. This incorporates initialisation as well.27AP_BattMonitor_ESC(AP_BattMonitor &mon, AP_BattMonitor::BattMonitor_State &mon_state, AP_BattMonitor_Params ¶ms);2829virtual ~AP_BattMonitor_ESC(void) {};3031// initialise32void init() override;3334// read the latest battery voltage35void read() override;3637// ESC_Telem provides current info38bool has_current() const override { return have_current; };3940// ESC_Telem provides temperature info41bool has_temperature() const override { return have_temperature; };4243// reset remaining percentage to given value44virtual bool reset_remaining(float percentage) override;4546static const struct AP_Param::GroupInfo var_info[];4748private:4950AP_Int32 _mask;5152bool have_current;53bool have_consumed_mah;54bool have_temperature;55float delta_mah;5657uint32_t last_read_us;58};5960#endif // AP_BATTERY_ESC_ENABLED616263