SparkFun_smol_Power_Board_Arduino_Library
SparkFun_smol_Power_Board_IO.h
Go to the documentation of this file.
1 
22 #ifndef __SFE_SMOL_POWER_BOARD_IO__
23 #define __SFE_SMOL_POWER_BOARD_IO__
24 
25 #include <Arduino.h>
26 #include <Wire.h> // Needed for I2C communication
27 
29 
32 {
33 private:
34  TwoWire* _i2cPort;
35  byte _address;
36 
37 public:
40 
42  bool begin(byte address, TwoWire& wirePort);
43 
45  bool isConnected();
46 
48  bool readSingleByte(byte registerAddress, byte* buffer, byte waitMS = 0);
49 
51  bool writeSingleByte(byte registerAddress, byte value);
52 
54  bool readMultipleBytes(byte registerAddress, byte* buffer, byte packetLength, byte waitMS = 0);
55 
57  bool writeMultipleBytes(byte registerAddress, const byte* buffer, byte packetLength);
58 };
59 
60 #endif // /__SFE_SMOL_POWER_BOARD_IO__
Definition: SparkFun_smol_Power_Board_IO.h:32
bool readMultipleBytes(byte registerAddress, byte *buffer, byte packetLength, byte waitMS=0)
Read multiple bytes from the SparkFun smôl Power Board over I2C. First the register address is writte...
Definition: SparkFun_smol_Power_Board_IO.cpp:113
bool begin(byte address, TwoWire &wirePort)
Begin communication with the SparkFun smôl Power Board over I2C.
Definition: SparkFun_smol_Power_Board_IO.cpp:43
bool writeSingleByte(byte registerAddress, byte value)
Write a single byte to the SparkFun smôl Power Board over I2C.
Definition: SparkFun_smol_Power_Board_IO.cpp:169
SMOL_POWER_BOARD_IO()
Create an object to communicate with the SparkFun smôl Power Board over I2C.
Definition: SparkFun_smol_Power_Board_IO.h:39
bool writeMultipleBytes(byte registerAddress, const byte *buffer, byte packetLength)
Write multiple bytes to the SparkFun smôl Power Board over I2C.
Definition: SparkFun_smol_Power_Board_IO.cpp:86
bool isConnected()
Reads the smôl Power Board's I2C address and confirms it matches _address.
Definition: SparkFun_smol_Power_Board_IO.cpp:56
bool readSingleByte(byte registerAddress, byte *buffer, byte waitMS=0)
Read a single byte from the SparkFun smôl Power Board over I2C. First the register address is written...
Definition: SparkFun_smol_Power_Board_IO.cpp:144