trikRuntime
trikControl::I2cDevice Class Reference

Abstract i2c device. More...

#include <i2cDevice.h>

Inheritance diagram for trikControl::I2cDevice:
Collaboration diagram for trikControl::I2cDevice:

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...
 

Detailed Description

Abstract i2c device.

Constructor & Destructor Documentation

I2cDevice::I2cDevice ( const trikKernel::Configurer configurer,
trikHal::MspI2cInterface i2c,
int  bus,
int  address 
)

Constructor.

Parameters
configurer- contains preparsed XML configuration.

Member Function Documentation

int I2cDevice::read ( int  reg)
overrideslot

Reads data by given I2C command number and returns the result.

void I2cDevice::send ( int  reg,
int  value 
)
overrideslot

Sends data to current device, if it is connected.

I2cDevice::Status I2cDevice::status ( ) const
overridevirtual

Returns current status of the device.

Implements trikControl::DeviceInterface.


The documentation for this class was generated from the following files: