10#ifndef SEMF_COMMUNICATION_I2CSCANNER_H_
11#define SEMF_COMMUNICATION_I2CSCANNER_H_
58 void startScan(uint16_t firstAddress = 0, uint16_t lastAddress = 0x7F);
77 void onI2cAcknowledge();
82 void onI2cNotAcknowledge(
Error thrown);
87 uint16_t m_addressBegin = 0;
89 uint16_t m_addressEnd = 0;
91 uint16_t m_addressIterator = 0;
93 SEMF_SLOT(m_onI2cAcknowledgeSlot,
I2cScanner, *
this, onI2cAcknowledge);
95 SEMF_SLOT(m_onI2cNotAcknowledgeSlot,
I2cScanner, *
this, onI2cNotAcknowledge,
Error);
97 static constexpr Error::ClassID kSemfClassId = Error::ClassID::I2cScanner;
Class for representing errors. Every error should have a unique source code. As a user feel encourage...
For using the I2C in master mode.
This class scans a given address range on an I2C master hardware to identify available devices.
I2cScanner(I2cMasterHardware &hardware)
Constructor.
ErrorCode
Error codes for this class. Error ID identify a unique error() / onError call (excluding transferring...
Signal< uint16_t > deviceFound
void startScan(uint16_t firstAddress=0, uint16_t lastAddress=0x7F)
Starts scan process for the address range from firstAddress to lastAddress. For all found devices,...
I2cScanner(const I2cScanner &other)=delete
virtual ~I2cScanner()=default