Arduino-TWI
Two-Wire Interface (TWI) library for Arduino
|
#include <TWI.h>
Classes | |
class | Device |
Public Member Functions | |
TWI () | |
virtual bool | acquire ()=0 |
virtual bool | release ()=0 |
virtual int | read (uint8_t addr, void *buf, size_t count)=0 |
virtual int | write (uint8_t addr, const void *buf, size_t count) |
virtual int | write (uint8_t addr, iovec_t *vp)=0 |
Static Public Attributes | |
static const uint32_t | DEFAULT_FREQ = 100000L |
Protected Member Functions | |
void | lock () |
void | unlock () |
Protected Attributes | |
volatile bool | m_busy |
|
pure virtual |
Start bus transaction. Return true(1) if successful otherwise false(0).
Implemented in Hardware::TWI, Software::TWI< SDA_PIN, SCL_PIN >, and Hardware::TWI.
|
pure virtual |
Read data from device with given address into given buffer.
[in] | addr | device address. |
[in] | buf | buffer pointer. |
[in] | count | buffer size in bytes. |
Implemented in Hardware::TWI, Hardware::TWI, and Software::TWI< SDA_PIN, SCL_PIN >.
|
pure virtual |
Stop bus transaction. Return true(1) if successful otherwise false(0).
Implemented in Hardware::TWI, Software::TWI< SDA_PIN, SCL_PIN >, and Hardware::TWI.
|
inlinevirtual |
|
pure virtual |
Write data to device with from given io vector.
[in] | addr | device address. |
[in] | vp | io vector pointer. |
Implemented in Hardware::TWI, Hardware::TWI, and Software::TWI< SDA_PIN, SCL_PIN >.
|
static |