AceWire
0.4.0
Unified interface for selecting different I2C implementations on Arduino platforms
|
25 #ifndef ACE_WIRE_THEXENO_WIRE_INTERFACE_H
26 #define ACE_WIRE_THEXENO_WIRE_INTERFACE_H
40 template <
typename T_WIRE>
63 mWire.beginTransmission(addr);
72 uint8_t
write(uint8_t data)
const {
73 return (uint8_t) mWire.write(data);
90 return mWire.endTransmission(sendStop);
104 uint8_t
requestFrom(uint8_t addr, uint8_t quantity,
bool sendStop =
true)
106 return mWire.requestFrom(addr, quantity, (uint8_t) sendStop);
uint8_t endTransmission(bool sendStop=true) const
Send the data in the buffer, with a STOP condition if sendStop is true.
uint8_t beginTransmission(uint8_t addr) const
Prepare the write buffer to accept a sequence of data, and save the addr for transmission when endTra...
uint8_t write(uint8_t data) const
Write data into the write buffer.
ThexenoWireInterface(T_WIRE &wire)
Constructor.
void end() const
End the interface.
uint8_t read() const
Read byte from the TwoWire receive buffer.
A thin wrapper around the TwoWire class from the https://github.com/thexeno/HardWire-Arduino-Library ...
uint8_t requestFrom(uint8_t addr, uint8_t quantity, bool sendStop=true) const
Read bytes from the slave and store in buffer owned by TwoWire and send a STOP condition if sendStop ...
void begin() const
Initialize the interface.