Treehopper C++ API
HardwareI2c.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "I2c.h"
4 
5 namespace Treehopper {
6  class TreehopperUsb;
7 
101  class TREEHOPPER_API HardwareI2c : public I2c {
102  public:
103  explicit HardwareI2c(TreehopperUsb &board);
104 
105  ~HardwareI2c() override;
106 
107  void speed(double value) override;
108 
109  double speed() override;
110 
111  void enabled(bool value) override;
112 
113  bool enabled() override;
114 
115  std::vector<uint8_t> sendReceive(uint8_t address, std::vector<uint8_t> data, size_t numBytesToRead = 0) override;
116 
117  private:
118  TreehopperUsb &board;
119  double _speed;
120  bool _enabled;
121 
122  void sendConfig();
123  };
124 }
Built-in I2C module.
Definition: HardwareI2c.h:101
Base I2c interface.
Definition: I2c.h:10
The core class for communicating with Treehopper USB boards.
Definition: TreehopperUsb.h:59
Definition: AdcPin.h:3
#define TREEHOPPER_API
Definition: Treehopper.h:17