ArduinoLibs
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
I2CMaster Class Referenceabstract

Abstract base class for I2C master implementations. More...

#include <I2CMaster.h>

Inheritance diagram for I2CMaster:
SoftI2C

Public Member Functions

virtual unsigned int maxTransferSize () const =0
 Returns the maximum number of bytes that can be read or written in a single request by this bus master.
 
virtual void startWrite (unsigned int address)
 Starts a write operation by sending a start condition and the I2C control byte. More...
 
virtual void write (uint8_t value)=0
 Writes a single byte value on the I2C bus. More...
 
virtual bool endWrite ()=0
 Ends the current write operation. More...
 
virtual bool startRead (unsigned int address, unsigned int count)=0
 Starts a read operation for count bytes by sending the start condition and the I2C control byte. More...
 
virtual unsigned int available ()=0
 Returns the number of bytes that are still available for reading. More...
 
virtual uint8_t read ()=0
 Reads a single byte from the I2C bus. More...
 

Detailed Description

Abstract base class for I2C master implementations.

See Also
SoftI2C

Definition at line 28 of file I2CMaster.h.

Member Function Documentation

unsigned int I2CMaster::available ( )
pure virtual

Returns the number of bytes that are still available for reading.

See Also
startRead(), read()

Implemented in SoftI2C.

bool I2CMaster::endWrite ( )
pure virtual

Ends the current write operation.

Returns true if the write operation was acknowledged; false otherwise.

See Also
startWrite(), write()

Implemented in SoftI2C.

uint8_t I2CMaster::read ( )
pure virtual

Reads a single byte from the I2C bus.

See Also
startRead(), available()

Implemented in SoftI2C.

bool I2CMaster::startRead ( unsigned int  address,
unsigned int  count 
)
pure virtual

Starts a read operation for count bytes by sending the start condition and the I2C control byte.

The address must be the 7-bit or 10-bit address of the I2C slave on the bus.

Returns true if the read request was acknowledged by the I2C slave or false otherwise. If true, this function should be followed by count calls to read() to fetch the bytes.

See Also
available(), read(), startWrite()

Implemented in SoftI2C.

void I2CMaster::startWrite ( unsigned int  address)
virtual

Starts a write operation by sending a start condition and the I2C control byte.

The address must be the 7-bit or 10-bit address of the I2C slave on the bus.

See Also
write(), endWrite(), startRead()

Reimplemented in SoftI2C.

void I2CMaster::write ( uint8_t  value)
pure virtual

Writes a single byte value on the I2C bus.

See Also
startWrite(), endWrite()

Implemented in SoftI2C.


The documentation for this class was generated from the following files: