Treehopper C++ API
SMBusDevice.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 #include "I2c.h"
5 
6 namespace Treehopper {
8  public:
9  SMBusDevice(uint8_t address, I2c &i2cModule, int rateKHz = 100);
10 
11  ~SMBusDevice();
12 
17  uint8_t readByte();
18 
23  void writeByte(uint8_t data);
24 
29  void writeData(std::vector<uint8_t> data);
30 
36  std::vector<uint8_t> readData(size_t count);
37 
43  uint8_t readByteData(uint8_t reg);
44 
50  uint16_t readWordData(uint8_t reg);
51 
57  uint16_t readWordDataBE(uint8_t reg);
58 
63  uint16_t readWord();
64 
69  uint16_t readWordBE();
70 
76  void writeByteData(uint8_t reg, uint8_t data);
77 
83  void writeWordData(uint8_t reg, uint16_t data);
84 
90  void writeWordDataBE(uint8_t reg, uint16_t data);
91 
98  std::vector<uint8_t> readBufferData(uint8_t reg, size_t count);
99 
105  void writeBufferData(uint8_t reg, std::vector<uint8_t> data);
106 
107 
108  private:
109  uint8_t address;
110  int rateKhz;
111  I2c &i2c;
112  };
113 }
Base I2c interface.
Definition: I2c.h:10
Definition: SMBusDevice.h:7
Definition: AdcPin.h:3
#define TREEHOPPER_API
Definition: Treehopper.h:17