semf
|
This interface standardized the read and write interface between the communication hardware like CAN, SPI and all protocols. More...
#include <communicationhardware.h>
Public Types | |
enum class | Type { SynchronousMaster = 1 , SynchronousSlave , Asynchronous } |
enum class | Frame : uint8_t { First = 0x01 , Next = 0x08 , Last = 0x10 , FirstAndLast = 0x11 } |
Public Member Functions | |
virtual | ~CommunicationHardware ()=default |
virtual void | init ()=0 |
virtual void | deinit ()=0 |
virtual Type | type () const =0 |
Returns the hardware type. More... | |
virtual void | setFrame (Frame frame)=0 |
Sets the selected usage of start and stop condition. More... | |
Public Member Functions inherited from semf::app::Communication | |
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... | |
Additional Inherited Members | |
Public Attributes inherited from semf::app::Communication | |
Signal | dataWritten |
Signal | dataAvailable |
Signal | writeStopped |
Signal | readStopped |
Signal< Error > | error |
This interface standardized the read and write interface between the communication hardware like CAN, SPI and all protocols.
Definition at line 22 of file communicationhardware.h.
|
strong |
Frame Modes (used e.g. in SPI and I2C)
Enumerator | |
---|---|
First | start condition, but no stop condition |
Next | no start AND no stop condition |
Last | stop condition |
FirstAndLast | start AND stop condition |
Definition at line 33 of file communicationhardware.h.
|
strong |
To identify the hardware type in higher classes like protocols.
Enumerator | |
---|---|
SynchronousMaster | Synchronous master like |
SynchronousSlave | Synchronous slave like |
Asynchronous | Asynchronous interface like |
Definition at line 26 of file communicationhardware.h.
|
virtualdefault |
|
pure virtual |
Deinitializes the hardware
Implemented in semf::SoftI2cMaster, semf::Stm32Can, semf::Stm32I2cMaster, semf::Stm32I2cSlave, semf::Stm32SpiMaster, semf::Stm32SpiSlave, and semf::Stm32Uart.
|
pure virtual |
Initializes the hardware.
Implemented in semf::SoftI2cMaster, semf::Stm32Can, semf::Stm32I2cMaster, semf::Stm32I2cSlave, semf::Stm32SpiMaster, semf::Stm32SpiSlave, and semf::Stm32Uart.
|
pure virtual |
Sets the selected usage of start and stop condition.
frame | frame mode |
Implemented in semf::I2cMasterHardware, semf::I2cSlaveHardware, semf::SpiMasterHardware, semf::CommunicationHardwareAsynchronous, and semf::SpiSlaveHardware.
|
pure virtual |
Returns the hardware type.
Implemented in semf::CommunicationHardwareAsynchronous, semf::CommunicationHardwareSynchronousMaster, and semf::CommunicationHardwareSynchronousSlave.