AP_BattMonitor_SMBus_Solo.h 782 B

123456789101112131415161718192021222324252627
  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_Solo : public AP_BattMonitor_SMBus
  8. {
  9. public:
  10. // Constructor
  11. AP_BattMonitor_SMBus_Solo(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. // read_block - returns number of characters read if successful, zero if unsuccessful
  18. uint8_t read_block(uint8_t reg, uint8_t* data, uint8_t max_len, bool append_zero) const;
  19. uint8_t _button_press_count;
  20. };