semf
semf::I2c Class Referenceabstract

Interface for I2C specific functionalities, which are not solved in a generic way in CommunicationHardware. More...

#include <i2c.h>

Inheritance diagram for semf::I2c:
Inheritance graph
Collaboration diagram for semf::I2c:
Collaboration graph

Public Member Functions

virtual ~I2c ()=default
 
virtual void setFrequency (uint32_t hz)=0
 Sets the speed (I2C baud rate). More...
 
virtual uint8_t address () const =0
 Returns the I2C slave device address. More...
 
virtual void setAddress (uint8_t address)=0
 

Detailed Description

Interface for I2C specific functionalities, which are not solved in a generic way in CommunicationHardware.

See also
CommunicationHardware
I2cMasterHardware

Definition at line 24 of file i2c.h.

Constructor & Destructor Documentation

◆ ~I2c()

virtual semf::I2c::~I2c ( )
virtualdefault

Member Function Documentation

◆ address()

virtual uint8_t semf::I2c::address ( ) const
pure virtual

Returns the I2C slave device address.

Returns
Device address.

Implemented in semf::I2cMasterHardware, and semf::I2cSlaveHardware.

◆ setAddress()

virtual void semf::I2c::setAddress ( uint8_t  address)
pure virtual
Note
Sets the address of the i2c. When this function is called by a master it specifies the address of the slave for further I/O operations. When this function is called by a slave it sets the main address of its own.
Parameters
addressDevice address (0x00 - 0x80)

Implemented in semf::I2cMasterHardware, and semf::I2cSlaveHardware.

◆ setFrequency()

virtual void semf::I2c::setFrequency ( uint32_t  hz)
pure virtual

Sets the speed (I2C baud rate).

Parameters
hzFrequency in hz.

Implemented in semf::I2cSlaveHardware, semf::Stm32I2cMaster, and semf::Stm32I2cSlave.