AceWire
0.4.0
Unified interface for selecting different I2C implementations on Arduino platforms
|
A thin wrapper around the SlowSoftWire
class provided by the https://github.com/felias-fogg/SlowSoftWire project so that it becomes compatible with the AceWire API.
More...
#include <FeliasFoggWireInterface.h>
Public Member Functions | |
FeliasFoggWireInterface (T_WIRE &wire) | |
Constructor. More... | |
void | begin () const |
Initial the interface. More... | |
void | end () const |
End the interface. More... | |
uint8_t | beginTransmission (uint8_t addr) const |
Prepare the write buffer to accept a sequence of data, and save the addr for transmission when endTransmission() is called. More... | |
uint8_t | write (uint8_t data) const |
Write data into the write buffer. More... | |
uint8_t | endTransmission (bool sendStop=true) const |
Send the data in the buffer, and return the following status code: More... | |
uint8_t | requestFrom (uint8_t addr, uint8_t quantity, bool sendStop=true) const |
Read bytes from the slave and store in buffer owned by SoftWire. More... | |
uint8_t | read () const |
Read byte from buffer. | |
FeliasFoggWireInterface (const FeliasFoggWireInterface &)=default | |
FeliasFoggWireInterface & | operator= (const FeliasFoggWireInterface &)=default |
A thin wrapper around the SlowSoftWire
class provided by the https://github.com/felias-fogg/SlowSoftWire project so that it becomes compatible with the AceWire API.
The SlowSoftWire class uses a 32-byte RX buffer and a 32-byte TX buffer.
T_WIRE | underlying I2C class which will always be SlowSoftWire |
Definition at line 41 of file FeliasFoggWireInterface.h.
|
inlineexplicit |
Constructor.
wire | instance of SlowSoftWire |
Definition at line 47 of file FeliasFoggWireInterface.h.
|
inline |
Initial the interface.
Currently does nothing.
Definition at line 50 of file FeliasFoggWireInterface.h.
|
inline |
Prepare the write buffer to accept a sequence of data, and save the addr for transmission when endTransmission()
is called.
addr
is simply written into a buffer Definition at line 62 of file FeliasFoggWireInterface.h.
|
inline |
|
inline |
Send the data in the buffer, and return the following status code:
sendStop | controls whether or not a STOP condition is sent at the end of the buffer |
Definition at line 89 of file FeliasFoggWireInterface.h.
|
inline |
Read bytes from the slave and store in buffer owned by SoftWire.
addr | I2C address |
quantity | number of bytes to read from I2C bus |
sendStop | controls whether the STOP condition should be sent |
Definition at line 103 of file FeliasFoggWireInterface.h.
|
inline |
Write data into the write buffer.
Definition at line 72 of file FeliasFoggWireInterface.h.