GM6000 Digital Heater Controller Branch: main
SDX-1330
List of all members | Public Member Functions | Protected Attributes
Driver::I2C::Arduino::Master Class Reference

This class implements the I2C interface using the Arduino framework and/or APIs. More...

Detailed Description

This class implements the I2C interface using the Arduino framework and/or APIs.

NOTE: Currently (8/2023) the 'noStop' semantics of the write/read methods is NOT supported.

#include <Master.h>

Inheritance diagram for Driver::I2C::Arduino::Master:
[legend]
Collaboration diagram for Driver::I2C::Arduino::Master:
[legend]

Public Member Functions

 Master (TwoWire &i2cInstance=Wire, uint32_t timeoutMs=50)
 Constructor.
 
bool start () noexcept
 See Driver::I2C::Master.
 
void stop () noexcept
 See Driver::I2C::Master.
 
Result_T writeToDevice (uint8_t device7BitAddress, size_t numBytesToTransmit, const void *srcData, bool noStop=false) noexcept
 See Driver::I2C::Master.
 
Result_T readFromDevice (uint8_t device7BitAddress, size_t numBytesToRead, void *dstData, bool noStop=false)
 See Driver::I2C::Master.
 
size_t setBaudRate (size_t newBaudRateHz) noexcept
 See Driver::I2C::Master.
 
size_t setTransactionTimeout (size_t maxTimeMs) noexcept
 See Driver::I2C::Master.
 
- Public Member Functions inherited from Driver::I2C::Master
Result_T registerWriteByte (uint8_t device7BitAddress, uint8_t reg, uint8_t value, bool noStop=false)
 Convenience method for common I2C operation.
 
template<class READ_TYPE >
Result_T registerRead (uint8_t device7BitAddress, uint8_t reg, READ_TYPE &dstReadResult)
 Convenience method for common I2C operation.
 
virtual ~Master ()
 Virtual destructor.
 

Protected Attributes

TwoWire & m_i2cDevice
 Handle an Ardunio driver instance.
 
uint32_t m_baudRate
 Current Baud rate.
 
uint32_t m_timeout_ms
 Current timeout.
 
bool m_started
 Track my started state.
 

Additional Inherited Members

- Public Types inherited from Driver::I2C::Master
enum  Result_T {
  eSUCCESS = 0 , eNO_ACK , eTIMEOUT , eNOT_STARTED ,
  eERROR
}
 Result codes. More...
 

Constructor & Destructor Documentation

◆ Master()

Driver::I2C::Arduino::Master::Master ( TwoWire &  i2cInstance = Wire,
uint32_t  timeoutMs = 50 
)

Constructor.

Member Function Documentation

◆ readFromDevice()

Result_T Driver::I2C::Arduino::Master::readFromDevice ( uint8_t  device7BitAddress,
size_t  numBytesToRead,
void *  dstData,
bool  noStop = false 
)
virtual

◆ setBaudRate()

size_t Driver::I2C::Arduino::Master::setBaudRate ( size_t  newBaudRateHz)
virtualnoexcept

◆ setTransactionTimeout()

size_t Driver::I2C::Arduino::Master::setTransactionTimeout ( size_t  maxTimeMs)
virtualnoexcept

◆ start()

bool Driver::I2C::Arduino::Master::start ( )
virtualnoexcept

◆ stop()

void Driver::I2C::Arduino::Master::stop ( )
virtualnoexcept

◆ writeToDevice()

Result_T Driver::I2C::Arduino::Master::writeToDevice ( uint8_t  device7BitAddress,
size_t  numBytesToTransmit,
const void *  srcData,
bool  noStop = false 
)
virtualnoexcept

Member Data Documentation

◆ m_baudRate

uint32_t Driver::I2C::Arduino::Master::m_baudRate
protected

Current Baud rate.

◆ m_i2cDevice

TwoWire& Driver::I2C::Arduino::Master::m_i2cDevice
protected

Handle an Ardunio driver instance.

◆ m_started

bool Driver::I2C::Arduino::Master::m_started
protected

Track my started state.

◆ m_timeout_ms

uint32_t Driver::I2C::Arduino::Master::m_timeout_ms
protected

Current timeout.


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