#include <TWI.h>
Abstract Two-Wire Interface Device Driver class.
Definition at line 33 of file TWI.h.
TWI::Device::Device |
( |
TWI & |
twi, |
|
|
uint8_t |
addr |
|
) |
| |
|
inline |
Construct Two-Wire Interface Device Driver with given bus and device address.
- Parameters
-
[in] | twi | bus manager. |
[in] | addr | device address. |
Definition at line 41 of file TWI.h.
bool TWI::Device::acquire |
( |
| ) |
|
|
inline |
Start transaction. Return true(1) if successful otherwise false(0).
- Returns
- bool.
Definition at line 52 of file TWI.h.
int TWI::Device::read |
( |
void * |
buf, |
|
|
size_t |
count |
|
) |
| |
|
inline |
Read data from device to given buffer.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | count | buffer size in bytes. |
- Returns
- number of bytes read or negative error code.
Definition at line 73 of file TWI.h.
bool TWI::Device::release |
( |
| ) |
|
|
inline |
Stop transaction. Return true(1) if successful otherwise false(0).
- Returns
- bool.
Definition at line 62 of file TWI.h.
int TWI::Device::write |
( |
const void * |
buf, |
|
|
size_t |
count |
|
) |
| |
|
inline |
Write data from the given buffer to device.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | count | buffer size in bytes. |
- Returns
- number of bytes written or negative error code.
Definition at line 84 of file TWI.h.
int TWI::Device::write |
( |
iovec_t * |
vp | ) |
|
|
inline |
Write data to device with from given io vector.
- Parameters
-
- Returns
- number of bytes written or negative error code.
Definition at line 94 of file TWI.h.
uint8_t TWI::Device::m_addr |
|
protected |
Two-Wire Interface Manager.
Definition at line 101 of file TWI.h.
The documentation for this class was generated from the following file: