trikRuntime
|
Provides direct interaction with I2C device. More...
#include <mspI2cCommunicator.h>
Public Member Functions | |
MspI2cCommunicator (const trikKernel::Configurer &configurer, trikHal::MspI2cInterface &i2c) | |
Constructor. More... | |
~MspI2cCommunicator () override | |
void | send (const QByteArray &data) override |
Send data to current device, if it is connected. More... | |
int | read (const QByteArray &data) override |
Reads data by given I2C command number and returns the result. More... | |
Status | status () const override |
Returns current status of the device. More... | |
Public Member Functions inherited from trikControl::DeviceInterface | |
DeviceInterface ()=default | |
virtual | ~DeviceInterface ()=default |
Additional Inherited Members | |
Public Types inherited from trikControl::DeviceInterface | |
enum | Status { Status::permanentFailure, Status::temporaryFailure, Status::off, Status::starting, Status::ready, Status::stopping } |
Device status. More... | |
Static Public Member Functions inherited from trikControl::DeviceInterface | |
static Status | combine (const DeviceInterface &underlying, const DeviceInterface::Status &dependent) |
Helper method to return status of a device relying on other device to work. More... | |
Provides direct interaction with I2C device.
MspI2cCommunicator::MspI2cCommunicator | ( | const trikKernel::Configurer & | configurer, |
trikHal::MspI2cInterface & | i2c | ||
) |
Constructor.
configurer | - contains preparsed XML configuration. |
|
override |
|
overridevirtual |
Reads data by given I2C command number and returns the result.
Implements trikControl::MspCommunicatorInterface.
|
overridevirtual |
Send data to current device, if it is connected.
Implements trikControl::MspCommunicatorInterface.
|
overridevirtual |
Returns current status of the device.
Implements trikControl::DeviceInterface.