trikRuntime
|
Abstract i2c device. More...
#include <i2cDevice.h>
Public Slots | |
void | send (int reg, int value) override |
Sends data to current device, if it is connected. More... | |
int | read (int reg) override |
Reads data by given I2C command number and returns the result. More... | |
Public Member Functions | |
I2cDevice (const trikKernel::Configurer &configurer, trikHal::MspI2cInterface &i2c, int bus, int address) | |
Constructor. More... | |
Status | status () const override |
Returns current status of the device. More... | |
Public Member Functions inherited from trikControl::I2cDeviceInterface | |
virtual void | send (int reg, int value)=0 |
Sends data to current device, if it is connected. More... | |
virtual int | read (int reg)=0 |
Reads data by given I2C command number and returns the result. 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... | |
Abstract i2c device.
I2cDevice::I2cDevice | ( | const trikKernel::Configurer & | configurer, |
trikHal::MspI2cInterface & | i2c, | ||
int | bus, | ||
int | address | ||
) |
Constructor.
configurer | - contains preparsed XML configuration. |
|
overrideslot |
Reads data by given I2C command number and returns the result.
|
overrideslot |
Sends data to current device, if it is connected.
|
overridevirtual |
Returns current status of the device.
Implements trikControl::DeviceInterface.