17 SEMF_INFO(
"data %p, dataSize is %u", data, dataSize);
47 SEMF_INFO(
"buffer %p, bufferSize is %u", buffer, bufferSize);
54 if (buffer ==
nullptr)
177 m_listening = listening;
@ Next
no start AND no stop condition
@ First
start condition, but no stop condition
Class for representing errors. Every error should have a unique source code. As a user feel encourage...
void onError(Error thrown)
Is called if an error occurred by hardware read or write access. Will emit error signal.
void startListening()
Starts to react on getting addressed.
virtual void readHardware(uint8_t buffer[], size_t bufferSize)=0
Hardware will read data. After finished read operation, onDataAvailable() function will be called.
void read(uint8_t buffer[], size_t bufferSize) override
For reading data, dataAvailable signal will be emitted after successful read.
bool isBusyReading() const override
Communication hardware is busy reading at the moment.
bool isBusyWriting() const override
Communication hardware is busy writing at the moment.
void write(const uint8_t data[], size_t dataSize) override
For writing data, dataWritten signal will be emitted after successful write.
virtual void writeHardware(const uint8_t data[], size_t dataSize)=0
Hardware will write data. After finished write operation, onDataWritten() function will be called.
void onDataWritten()
Is called after data are written by the hardware. Will emit dataWritten signal.
void stopListening()
Quits reacting on getting addressed.
uint8_t address() const override
Returns the I2C slave device address.
void setFrequency(uint32_t hz) override
Sets the speed (I2C baud rate).
void setBusy(bool isBusy)
Sets the busy flag.
void setFrame(CommunicationHardware::Frame frame) override
Sets the selected usage of start and stop condition.
virtual void stopListeningHardware()=0
bool isListening() const
Returns the listening flag.
virtual void startListeningHardware()=0
CommunicationHardware::Frame frame() const
Returns the actual frame mode setting.
virtual void setFrequencyHardware(uint32_t hz)=0
Configures the frequency of the bus.
virtual void setAddressHardware(uint8_t address)=0
Sets the address of the i2c hardware.
void setListening(bool listening)
Sets the listening flag.
void onDataAvailable()
Is called after data is available in the hardware. Will emit dataAvailable signal.
void setAddress(uint8_t address) override
Sets the address of the slave.
#define SEMF_WARNING(...)