AP_BattMonitor_SMBus_Maxell.h 1014 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include <AP_Common/AP_Common.h>
  3. #include <AP_Param/AP_Param.h>
  4. #include <AP_Math/AP_Math.h>
  5. #include "AP_BattMonitor_SMBus.h"
  6. #include <AP_HAL/I2CDevice.h>
  7. class AP_BattMonitor_SMBus_Maxell : public AP_BattMonitor_SMBus
  8. {
  9. public:
  10. // Constructor
  11. AP_BattMonitor_SMBus_Maxell(AP_BattMonitor &mon,
  12. AP_BattMonitor::BattMonitor_State &mon_state,
  13. AP_BattMonitor_Params &params,
  14. AP_HAL::OwnPtr<AP_HAL::I2CDevice> dev);
  15. private:
  16. void timer(void) override;
  17. // check if PEC supported with the version value in SpecificationInfo() function
  18. // returns true once PEC is confirmed as working or not working
  19. bool check_pec_support();
  20. // read_block - returns number of characters read if successful, zero if unsuccessful
  21. uint8_t read_block(uint8_t reg, uint8_t* data, bool append_zero) const;
  22. uint8_t _pec_confirmed; // count of the number of times PEC has been confirmed as working
  23. };