Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
SoftI2cMaster Class Reference

Software I2C master class. More...

#include <I2cMaster.h>

Inheritance diagram for SoftI2cMaster:
I2cMasterBase

Public Member Functions

 SoftI2cMaster (uint8_t sdaPin, uint8_t sclPin)
 
uint8_t read (uint8_t last)
 
bool restart (uint8_t addressRW)
 
bool start (uint8_t addressRW)
 
void stop (void)
 
bool write (uint8_t b)
 

Detailed Description

Software I2C master class.

Member Function Documentation

uint8_t SoftI2cMaster::read ( uint8_t  last)
virtual

Read a byte

Parameters
[in]lastsend Ack if last is false else Nak to terminate read
Returns
byte read from I2C bus

Implements I2cMasterBase.

bool SoftI2cMaster::restart ( uint8_t  addressRW)
virtual

Send new address and read/write bit without sending a stop.

Parameters
[in]addressRWi2c address with read/write bit
Returns
true for success false for failure

Implements I2cMasterBase.

bool SoftI2cMaster::start ( uint8_t  addressRW)
virtual

Issue a start condition

Parameters
[in]addressRWi2c address with read/write bit
Returns
true for success false for failure

Implements I2cMasterBase.

void SoftI2cMaster::stop ( void  )
virtual

Issue a stop condition.

Implements I2cMasterBase.

bool SoftI2cMaster::write ( uint8_t  data)
virtual

Write a byte

Parameters
[in]databyte to write
Returns
true for Ack or false for Nak

Implements I2cMasterBase.