semf
|
This interface standardized the read and write interface for communication hardware like CAN, SPI and protocols. More...
#include <communication.h>
Public Member Functions | |
virtual | ~Communication ()=default |
virtual void | write (const uint8_t data[], size_t dataSize)=0 |
For writing data, dataWritten signal will be emitted after successful write. More... | |
virtual void | read (uint8_t buffer[], size_t bufferSize)=0 |
For reading data, dataAvailable signal will be emitted after successful read. More... | |
virtual void | stopRead ()=0 |
virtual void | stopWrite ()=0 |
virtual bool | isBusyReading () const =0 |
Communication hardware is busy reading at the moment. More... | |
virtual bool | isBusyWriting () const =0 |
Communication hardware is busy writing at the moment. More... | |
Public Attributes | |
Signal | dataWritten |
Signal | dataAvailable |
Signal | writeStopped |
Signal | readStopped |
Signal< Error > | error |
This interface standardized the read and write interface for communication hardware like CAN, SPI and protocols.
Definition at line 24 of file communication.h.
|
virtualdefault |
|
pure virtual |
Communication hardware is busy reading at the moment.
Implemented in semf::CanHardware, semf::I2cMasterHardware, semf::I2cSlaveHardware, semf::SpiMasterHardware, semf::SpiSlaveHardware, and semf::UartHardware.
|
pure virtual |
Communication hardware is busy writing at the moment.
Implemented in semf::CanHardware, semf::I2cMasterHardware, semf::I2cSlaveHardware, semf::SpiMasterHardware, semf::SpiSlaveHardware, and semf::UartHardware.
|
pure virtual |
For reading data, dataAvailable
signal will be emitted after successful read.
buffer | Buffer to store received bytes in. |
bufferSize | Size of receive buffer. |
Implemented in semf::CanHardware, semf::I2cMasterHardware, semf::I2cSlaveHardware, semf::SpiMasterHardware, semf::SpiSlaveHardware, and semf::UartHardware.
|
pure virtual |
Stops the read process as fast as possible without destroying anything. The readStopped
Signal gets emitted if the call was successful.
Implemented in semf::SoftI2cMaster, semf::SpiMasterHardware, semf::SpiSlaveHardware, semf::Stm32Can, semf::Stm32I2cMaster, semf::Stm32I2cSlave, and semf::Stm32Uart.
|
pure virtual |
Stops the write process as fast as possible without destroying anything. The writeStopped
Signal gets emitted if the call was successful.
Implemented in semf::SoftI2cMaster, semf::SpiMasterHardware, semf::SpiSlaveHardware, semf::Stm32Can, semf::Stm32I2cMaster, semf::Stm32I2cSlave, and semf::Stm32Uart.
|
pure virtual |
For writing data, dataWritten
signal will be emitted after successful write.
data | Array, containing data to write. |
dataSize | Size of write data. |
Implemented in semf::CanHardware, semf::I2cMasterHardware, semf::I2cSlaveHardware, semf::SpiMasterHardware, semf::SpiSlaveHardware, and semf::UartHardware.
Signal semf::app::Communication::dataAvailable |
Signal is emitted after size of data from called read()
function are received.
Definition at line 58 of file communication.h.
Signal semf::app::Communication::dataWritten |
Signal is emitted after data from called write()
function are written.
Definition at line 56 of file communication.h.
Signal is emitted if any error happens in the communication hardware or hardware abstraction layer.
Definition at line 64 of file communication.h.
Signal semf::app::Communication::readStopped |
Signal is emitted after writing was canceled by stopRead()
.
Definition at line 62 of file communication.h.
Signal semf::app::Communication::writeStopped |
Signal is emitted after writing was canceled by stopWrite()
.
Definition at line 60 of file communication.h.